USB ehci_hcd woes

Posting to help the next person who runs into this problem and Googles for help.

I noticed that several log files in /var/log/ on my T400 running Ubuntu 10.04 were filling up with stuff like

... kernel: ... usb 2-4: new high speed USB device using ehci_hcd and address 17 
... kernel: ... usb 2-4: device descriptor read/all, error -71 
... kernel: ... hub 2-0:1.0: unable to enumerate USB device on port 4 
... kernel: ... usb 2-4: new high speed USB device using ehci_hcd and address 19 
... kernel: ... usb 2-4: device not accepting address 19, error -71 
... kernel: ... hub 2-0:1.0: unable to enumerate USB device on port 4 
... kernel: ... usb 2-4: new high speed USB device using ehci_hcd and address 21 
... kernel: ... usb 2-4: device descriptor read/all, error -71 
... kernel: ... hub 2-0:1.0: unable to enumerate USB device on port 4 
... kernel: ... usb 2-4: new high speed USB device using ehci_hcd and address 23 

And by ‘filling up’, I meant 10s of megabytes each, across several log files. And there wasn’t a USB device plugged in. (There’d been a thumb drive plugged in briefly before noticing the problem, but the log spewage continued after a cold restart.)

When I went digging for info, it sounded like this might be a problem with some USB device/chipset combinations. In my case, it’s probably a flakey USB chip.

To stop the spew, I added the following to /etc/rc.local

cd /sys/bus/pci/drivers/ehci_hcd
echo -n "0000:00:1d.7" > unbind
cd /sys/bus/pci/drivers/uhci_hcd
echo -n "0000:00:1d.1" > unbind

I unbound ehci_hcd and uhci_hcd because both were showing up in my logs. You might only need one. If you only need to unbind ehci_hcd, you’ll be downgrading the speed of that USB port, which may just be what you need to do to make things work. You’ll also need to adjust those numbers to correspond to how your drivers are numbered, which will be evident when you look at the files in /sys/bus/pci/drivers/*. Since unbind doesn’t survive a reboot, it’s a simple matter of

sudo tail -f /var/log/syslog

in one window while you try an echo in another to verify that the log spewage stops.

Good luck. There’s the chance that this is an entirely wrong thing to do, so caveat emptor.

Edited to add that’s a bug filed against this that makes for interesting reading.