USB does not work after resuming from STR

Bug #13964 reported by Martin Pitt
24
Affects Status Importance Assigned to Milestone
linux-source-2.6.15 (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

After my iBook G4 resumes from suspend-to-RAM, USB drives do not work any more.
Also, my USB WLAN adapter only works after suspending/resuming again.

I found an easy workaround by creating two scripts:

$ cat /etc/power/suspend.d/usb
#!/bin/sh
rmmod ohci_hcd
rmmod ehci_hcd

$ cat /etc/power/resume.d/usb
#!/bin/sh
modprobe ohci_hcd
modprobe ehci_hcd

I CC'ed some other ppc-using folks; does this happen for you as well? If so, I'd
like to include this fix into the official pbbuttonsd package.

Revision history for this message
Benjamin Herrenschmidt (benh-kernel) wrote :

Removing the host controller driver is usually not a good idea. They are part of
the suspend process and if you remove them, you'll probably consume more power
than expected. However, unplugging the devices should help.

There are various issues with USB and sleep in linux. I'm trying to find a
solution with the USB folks, but it's not a simple problem.

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #1)
> Removing the host controller driver is usually not a good idea. They are part of
> the suspend process and if you remove them, you'll probably consume more power
> than expected. However, unplugging the devices should help.

Oh, I already did unplug the devices (both the WLAN and the flash memory stick).
In the case of the WLAN I did:

 - shut down network interface (wlan0)
 - unplug the device
 - removed the modules (prism2_usb and p80211)
 - sleep
 - resume
 - load the modules again
 - plug -> device is not powered

Same for the flash drive, the device does not get power if the USB driver
(ohci_hcd) is loaded.

However, if the ohci modules should be loaded when going to sleep, then it also
works to drop suspend.d/usb and instead do:

$ cat /etc/power/resume.d/usb
#!/bin/sh
rmmod ohci_hcd
rmmod ehci_hcd
modprobe ohci_hcd
modprobe ehci_hcd

Revision history for this message
Martin Pitt (pitti) wrote :

A better version of this script:

$ cat /etc/power/resume.d/usb
#!/bin/sh
rmmod ohci_hcd && modprobe ohci_hcd
rmmod ehci_hcd && modprobe ehci_hcd
rmmod uhci_hcd && modprobe uhci_hcd

This will reload the module only if if was loaded before.

Since I did not get any feedback for this, I could not put this into Hoary. In
Breezy we will see lots of kernel updates, so it does not make sense to put it
into Breezy early. If this does not work out of the box by August, I will upload
this workaround at that time.

Revision history for this message
Martin Pitt (pitti) wrote :

*** Bug 14451 has been marked as a duplicate of this bug. ***

Revision history for this message
Benjamin Herrenschmidt (benh-kernel) wrote :

I think a patch fixing that went into 2.6.12, can you try -rc6 ?

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #5)
> I think a patch fixing that went into 2.6.12, can you try -rc6 ?

Indeed, that works fine without the resume.d script now.

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #6)
> (In reply to comment #5)
> > I think a patch fixing that went into 2.6.12, can you try -rc6 ?
>
> Indeed, that works fine without the resume.d script now.

-rc6 is already in Breezy universe, I will close that bug as soon as 2.6.12
final comes out and goes into main.

Revision history for this message
Martin Pitt (pitti) wrote :

> -rc6 is already in Breezy universe, I will close that bug as soon as 2.6.12
> final comes out and goes into main.

.. 2.6.12 is in main, closing.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.