Re: Hibernation with LPM, was: Re: xhci: LPM issues using Western Digital harddrive

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

 



On Tue, 16 Oct 2012, Sarah Sharp wrote:

> > Okay.  But that still leaves a question: Is it reasonable to call
> > xhci-hcd's bus_suspend method without first putting all the devices on
> > the bus into U3?  If it is then generic_suspend() can avoid calling
> > usb_port_suspend() for the FREEZE and PRETHAW events, even on a USB-3
> > bus.
> 
> I think we really do need to place all the devices into suspend during
> the FREEZE or PRETHAW.  The xHCI specification says that before a host
> can be suspended, the driver shall "Stop all USB activity by issuing
> Stop Endpoint Commands for each endpoint in the Running state."  I
> assume that's because the endpoint rings need to be stopped, or the host
> may attempt to do DMA to get the next TRB for a periodic endpoint.
> 
> Currently, the xHCI driver kind of hacks around this.  If bus_suspend is
> called and one of the rootports is not in U3, then it issues a Stop
> Endpoint command with the 'suspend' bit set, and places the root port
> link into U3.  But that only stops the endpoints on devices attached to
> the roothub, not ones that are deeper in the tree.  So the xHCI host
> could, for example, go fetch a TRB from a periodic endpoint of a device
> on the second hub tier, in the middle of the hibernate operation.
> 
> Since the xHCI spec really wants us to suspend all devices, I would
> rather the hibernate actually do that for both USB 2.0 and USB 3.0
> devices.

Well, we're talking about two different things.  Stopping the endpoints
comes under the heading of "quiescing", whereas putting a link into U3
comes under the heading of "going to low power".  FREEZE and PRETHAW
require the host controller (and all the USB devices) to be quiescent,
but they do not require anything to be in a low-power state.

It seems reasonable that we could have separate callbacks for these two
different things.  FREEZE and PRETHAW could invoke the callback that 
stops a device's endpoints and skip the callback that puts the device 
into U3.

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