FS#12009 - Load ehci-hcd before uhci_hcd and ohci_hcd

Attached to Project: Arch Linux
Opened by Peter Csepely (Thief_hu) - Wednesday, 05 November 2008, 19:19 GMT
Last edited by Thomas Bächler (brain0) - Monday, 19 January 2009, 10:07 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To Tobias Powalowski (tpowa)
Aaron Griffin (phrakture)
Thomas Bächler (brain0)
Architecture All
Severity Low
Priority Normal
Reported Version None
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
There is a warning in system log:

"Warning! ehci_hcd should always be loaded before uhci_hcd and ohci_hcd, not after"

Maybe an udev rule can fix it, but I don't know how :) Thank you very much.

Additional info:
* package version(s)
kernel26: 2.6.27.4-1

* config and/or log files etc.
dmesg output attached
This task depends upon

This task blocks these from closing
 FS#11289 - unable to enumerate USB device 
Closed by  Thomas Bächler (brain0)
Monday, 19 January 2009, 10:07 GMT
Reason for closing:  Fixed
Comment by Tobias Powalowski (tpowa) - Sunday, 09 November 2008, 08:33 GMT
don't know why your system does this, but you can avoid this by loding the usb modules in MODULES= array in rc.conf
Comment by Peter Csepely (Thief_hu) - Sunday, 09 November 2008, 11:00 GMT
It doesn't solve the problem, warning remains. It seems to me these modules are loaded when initrd's init run. What if I put ehci and uhci into mkinitcio.conf's MODULES array?
Comment by Tobias Powalowski (tpowa) - Sunday, 09 November 2008, 13:34 GMT
ah now i can confirm this on my machine too
Comment by Peter Csepely (Thief_hu) - Sunday, 09 November 2008, 17:55 GMT
If ehci_hcd is added to mkinitcpio.conf's MODULES array after recreating initrd image, reboot and no more warning message.
Comment by Dan McGee (toofishes) - Thursday, 13 November 2008, 02:04 GMT
Aaron- you mentioned you knew some modprobe magic to address this; want to take it on?
Comment by Aaron Griffin (phrakture) - Thursday, 13 November 2008, 05:51 GMT
in some file, /etc/modprobe.d/load-ehci-first:
install ohci_hcd modprobe ehci_hcd && modprobe ohci_hcd
install uhci_hcd modprobe ehci_hcd && modprobe uhci_hcd

The "install" command says "hey when you modprobe X, do this instead". I don't think we can use modprobe -a here, because the order might not be guaranteed.

BUT, as others have pointed out, the problem appears to be in mkinitcpio more than anything.
Comment by Thomas Bächler (brain0) - Thursday, 13 November 2008, 08:08 GMT
Not true, the usb modules shouldn't be in mkinitcpio anyway, unless you explicitly tell it to add them or add the usbinput hook.

I don't like the modprobe magic. The ehci should only be loaded on machines that support usb 2.0. This worked great until now, I vote for kernel bug (see my previous comment).
Comment by Dan McGee (toofishes) - Thursday, 13 November 2008, 13:59 GMT
You are going to have a terribly hard time convincing them this is a kernel bug, that is why I hadn't addressed that comment.

commit 9beeee6584b9aa4f9192055512411484a2a624df
Author: Alan Stern <stern@rowland.harvard.edu>
Date: Thu Oct 2 11:48:13 2008 -0400

USB: EHCI: log a warning if ehci-hcd is not loaded first

This patch (as1139) adds a warning to the system log whenever ehci-hcd
is loaded after ohci-hcd or uhci-hcd. Nowadays most distributions are
pretty good about not doing this; maybe the warning will help convince
anyone still doing it wrong.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org> [2.6.27]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Comment by Aaron Griffin (phrakture) - Thursday, 13 November 2008, 17:04 GMT
To be clear, it's not so much magic. That's the way modprobe's install command has been used long before udev was even a concept. The other options would be to add ehci to the modules.dep entries for ohci and uhci, which will force modprobe to load it first.
Comment by Thomas Bächler (brain0) - Thursday, 13 November 2008, 17:25 GMT
The modprobe.d file would be fine and could even be copied to the initramfs, no trouble here, however:

1) The above commit doesn't give a reason why ehci should be loaded first, it just says that this is the way it is
2) ehci-hcd would then be loaded also on systems with no ehci controller. That doesn't fit into my understanding of how module autoloading should work, but then, any other distribution probably does it this way, or not at all.
Comment by Anne O'Nymous (veoxe) - Friday, 21 November 2008, 20:39 GMT
ehci should be loaded before uhci/ohci, since a device capable of both USB1.1 and USB2.0 will get USB1.1 speeds if it is already inserted during boot time. Then ohci_hcd will "grab" the device as soon as this module is loaded.
Comment by Damjan Georgievski (damjan) - Saturday, 27 December 2008, 02:17 GMT
Maybe the more proper script would be:

install ohci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe --ignore-install ohci_hcd $CMDLINE_OPTS
install uhci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe --ignore-install uhci_hcd $CMDLINE_OPTS

changes from the above are:
* use absolute paths to modprobe
* try to load uhci_hcd even if "modprobe ehci_hcd" fails (; instead of &&)
* use the proper --ignore-install to avoid recursive loop
* supply the user requested command line options to the modprobe command
Comment by Thomas Bächler (brain0) - Sunday, 11 January 2009, 14:40 GMT
New filesystem in testing contains a modprobe.d file, mkinitcpio still needs to be adjusted.

Loading...