Comment 324 for bug 88746

Revision history for this message
Toby Dickenson (toby-tarind) wrote :

I previously reported that USB devices were not working on my nforce2 system when connected via hub after a dapper to hardy upgrade. I had tried the suggested workarounds here and nothing helped *except* blacklisting ehci_hcd, So Ive been living with usb 1 speeds for a month :-( But now I have a fix...

Robert North has describes two implementations of the autosuspend workaround in this bug report. Firstly at https://bugs.launchpad.net/ubuntu/hardy/+source/linux/+bug/88746/comments/188 he suggests setting /sys/module/usbcore/parameters/autosuspend to -1 and reloading ehci-hcd. This is what I tested, and it did not help. After further debugging I independantly found a working solution which is identical to his second suggestion at https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/88746/comments/209. This involves including the setting in modprobe.d and rebooting.

The first solution was insufficient in my case because the value in /sys/module/usbcore/parameters/autosuspend is a default which is applied to newly detected devices, but reloading echi-hcd was insufficent to force the redetection of all my usb devices. A transcript of the first workaround:

root@dumpet:~# rmmod ehci_hcd
root@dumpet:~# echo -1>/sys/module/usbcore/parameters/autosuspend
root@dumpet:~# cat /sys/module/usbcore/parameters/autosuspend
-1
root@dumpet:~# modprobe ehci_hcd
root@dumpet:~# cat /sys/module/usbcore/parameters/autosuspend
-1
root@dumpet:~# find /sys/ -name "autosuspend"
/sys/devices/pci0000:00/0000:00:02.0/usb1/power/autosuspend
/sys/devices/pci0000:00/0000:00:02.1/usb2/power/autosuspend
/sys/devices/pci0000:00/0000:00:02.2/usb3/power/autosuspend
/sys/devices/pci0000:00/0000:00:02.2/usb3/3-2/power/autosuspend
/sys/module/usbcore/parameters/autosuspend
root@dumpet:~# cat `find /sys/ -name "autosuspend"`
2
2
-1
-1
-1

Two devices were left using autosuspend. I can patch them manually to get a working system:

root@dumpet:~# echo -1 > /sys/devices/pci0000:00/0000:00:02.0/usb1/power/autosuspend
root@dumpet:~# echo -1 > /sys/devices/pci0000:00/0000:00:02.1/usb2/power/autosuspend
root@dumpet:~# cat `find /sys/ -name "autosuspend"`
-1
-1
-1
-1
-1

Setting it in modprobe.d is much better because the option will be set sufficiently early that no devices ever have autosuspend turned on. That link again:
https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/88746/comments/209

Robert described that second workaround as "to apply the workaround permanently", but it is obviously deeper than that.

I guess the default 2 second timeout on autosuspend may explain the various posts which say it _sometimes_ works.... I works if the device is inserted within 2 seconds of other usb activity.