Re: [PATCH v2 2/5] usb: musb: call musb_port_suspend from musb_bus_suspend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2 Oct 2013, Daniel Mack wrote:

> On 02.10.2013 14:01, Sebastian Andrzej Siewior wrote:
> > On 10/02/2013 01:14 PM, Daniel Mack wrote:
> >> On 02.10.2013 12:49, Sebastian Andrzej Siewior wrote:
> 
> >>> What happens if the device is unplugged while the host is suspended and
> >>> not there on resume?
> >>
> >> That condition is detected and a full teardown of the connected drivers
> >> is conducted. Try what happens on your notebook when you do that.
> >> Embedded systems should behave just the same.
> > 
> > I had the feeling that the USB device gets disconnected and
> > re-enumerated on resume.
> 
> Yes. The device looses its +5V power supply, so it has to be reset and
> re-enumerated on resume of course. It's just that USB drivers know about
> the state the device has to be put back into after resume, and don't
> assume the device was disconnected and reconnected. The latter would
> (for usb-storage) also cause paritions to be removed and added.

This description may be slightly misleading.

According to the USB spec, a device is not supposed to lose its +5V 
power supply during suspend.  Therefore it does not need to be reset 
and re-enumerated upon resume.  (Except that some devices don't handle 
suspend properly because of buggy firmware; they _do_ need to be 
reset.)

Of course, some systems don't follow the spec.  If they can't supply
suspend power to the host controller and the USB bus, then the device
_will_ need to be reset and re-enumerated.

Some USB drivers (those which define a reset_resume method) are able to
handle this -- they put the device back into the right state and then
act as if nothing had happened.  Others aren't; they get unbound and
rebound just as though the device really had been disconnected and
reconnected.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux