Bug 5433

Summary: modprobe ehci-hcd freezes system
Product: Drivers Reporter: Petteri Räty (betelgeuse)
Component: USBAssignee: Greg Kroah-Hartman (greg)
Status: RESOLVED CODE_FIX    
Severity: normal CC: dbrownell, stern
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.14_rc4 Subsystem:
Regression: --- Bisected commit-id:
Bug Depends on:    
Bug Blocks: 5089    

Description Petteri Räty 2005-10-13 14:32:58 UTC
Most recent kernel where this bug did not occur: Something between 2.6.10 and 2.6.12
Distribution: Gentoo
Hardware Environment: x86, P4
Software Environment: Gentoo ~x86 (testing)
Problem Description:
after modprobe ehci-hcd the system does not respond any more

Steps to reproduce:
modprobe ehci-hcd

See http://bugs.gentoo.org/show_bug.cgi?id=108919 for more information
Comment 1 Greg Kroah-Hartman 2005-10-13 15:48:59 UTC

*** This bug has been marked as a duplicate of 5428 ***
Comment 2 Alan Stern 2005-10-15 19:30:27 UTC
I was able to track down a similar problem on my computer.  The entire system
doesn't hang, only the modprobe process.  The hang occurs in the following pathway:

    usb_add_hcd -> ehci_reset -> ehci_port_power -> ehci_hub_control

As part of its startup, ehci_hub_control tries to acquire ehci->lock.  However
the spinlock has not yet been initialized, and so modprobe hangs.

I don't know how David will want to fix this.
Comment 3 David Brownell 2005-10-15 20:11:36 UTC
Hmm, I suspect the root cause is that the root hub init changes didn't 
involve adding a new init() method ... the original reset() method 
did that, but the new one assumes that's already been done.  And 
reset() of course needs to be done without necessarily initializing 
HCD data structures.  An add() should init() then later reset(). 
 
This would seem to explain another report I've gotten on the 2.6.15 
queue; thanks Alan!  (I'm actually surprised that OHCI never sees 
this problem... the reason is that it's got a stupid reset method, 
which ignores the failures that can happen when reset-at-runtime 
reinitializes things.) 
 
 
Comment 4 David Brownell 2005-10-16 08:09:13 UTC
More info on this.  This isn't an issue with 2.6.14-rc4 since 
the first thing done by ehci_hc_reset() is to initialize 
that spinlock.  But it's an issue with the 2.6.15 prepatches. 
Comment 5 Petteri Räty 2005-10-17 10:34:17 UTC
I disabled "Enable legacy USB support" in kernel and after that it works. It
would be better of course if that would not cause a system freeze but at least I
know how to fix this problem now.
Comment 6 Greg Kroah-Hartman 2005-10-17 11:29:38 UTC
On Mon, Oct 17, 2005 at 10:36:55AM -0700, bugme-daemon@kernel-bugs.osdl.org wrote:
> I disabled "Enable legacy USB support" in kernel

You mean, in the BIOS, not kernel, right?
Comment 7 Petteri Räty 2005-10-17 11:32:09 UTC
In the BIOS of course. Stupid me. 
Comment 8 Greg Kroah-Hartman 2005-11-14 21:43:29 UTC
Great, glad we have a fix.