Bug 12592

Summary: fw_card_add adds card to the list even on enable failure
Product: Drivers Reporter: Petr Vandrovec (vandrove)
Component: IEEE1394Assignee: Stefan Richter (stefanr)
Status: CLOSED CODE_FIX    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.29-rc3 Subsystem:
Regression: --- Bisected commit-id:
Attachments: Patch to get rid of crash
dmesg from unpatched kernel

Description Petr Vandrovec 2009-02-01 01:26:43 UTC
Latest working kernel version:  never
Earliest failing kernel version:  always
Distribution:  Debian
Hardware Environment:  Two "FireWire (IEEE 1394): Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)" devices in one box, with on-board device ill...
Software Environment:  New FW stack
Problem Description:

When Vista boots on the hardware, it does something bad to the on-board firewire adapter, so it starts failing to enable card:

firewire_ohci 0000:01:09.0: PCI INT A -> Link[APC4] -> GSI 19 (level, low) -> IRQ 19
firewire_ohci 0000:01:09.0: setting latency timer to 64
firewire_ohci: failed to set phy reg bits.
firewire_ohci 0000:01:09.0: PCI INT A disabled
firewire_ohci: probe of 0000:01:09.0 failed with error -5

When that happens, fw_add_card adds card to the list of all devices, but then returns an error.  Caller then thinks that things went wrong, and releases card structure.  Then when fw_add_card is invoked for second device, kernel reports linked list corruption, as first (released) card is still in the list...

Steps to reproduce:

Get box with one broken and one working card, and try loading firewire-ohci module.
Comment 1 Petr Vandrovec 2009-02-01 01:28:40 UTC
Created attachment 20056 [details]
Patch to get rid of crash
Comment 2 Petr Vandrovec 2009-02-01 01:29:35 UTC
Created attachment 20057 [details]
dmesg from unpatched kernel
Comment 3 Stefan Richter 2009-02-01 02:25:22 UTC
Patch committed to linux1394-2.6.git, will push it for one of the next -rc's.
Comment 4 Stefan Richter 2009-02-09 14:36:42 UTC
fix merged in 2.6.29-rc4