lkml.org 
[lkml]   [2007]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [linux-usb-devel] USB deadlock after resume
On Wed, 21 Nov 2007, Laurent Pinchart wrote:

> > > When you suspend, you cut off vbus (afaik, correct me if I'm wrong),
> > > which means your device will get disconnected. One way to avoid this is
> > > enabling CONFIG_USB_PERSIST and trying with that on.
> >
> > Suspend may or may not cut off power.
>
> I've always been confused by this.
>
> If I'm not mistaken, there are three kind of suspend modes: autosuspend,

You mean runtime (AKA dynamic) suspend -- autosuspend is merely one
type of runtime suspend.

> suspend to RAM and suspend to disk.

The nomenclature du jour is just plain "suspend" for suspend-to-RAM and
"hibernation" for suspend-to-disk.

> In the first case I expect the USB hub
> (either root hub or external hub) to make the bus idle but not power it down.

Correct.

> In the last case I suspect the USB bus to be powered down.

Usually, not but always! Some Macs have been known to keep USB suspend
current available during hibernation.

> What controls the USB bus power on suspended ports ? Is it handled by the
> system (BIOS, ...) ? Is it allowed to power down the ports or keep them
> powered as it chooses ? What are the rules set in stone ?

There are no rules set in stone. :-)

Systems are _supposed_ to keep the ports powered during suspend, but
some may fail to do so. It depends on the firmware (i.e., BIOS for
PCs) and the motherboard design.

> > If it does cut off power, resume() will never be called, instead either
> > disconnect() or reset_resume().
>
> What is reset_resume() for ? Which one will be called on resume after a bus
> power down ?

This is explained in Documentation/usb/power-management.txt. If the
USB Persist facility has been enabled for a device then reset_resume
will be called, to indicate that the device had to be reset as part of
the resume procedure. If USB Persist isn't enabled then the disconnect
method will be called and the device will be re-enumerated, exactly as
though it had been unplugged and then plugged back in.

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-21 22:59    [W:0.034 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site