Re: Autosuspend for mass storage?

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

 



On Sun, 2 Aug 2009, Oliver Neukum wrote:

> Am Samstag, 1. August 2009 17:56:00 schrieb Alan Stern:
> > On Sat, 1 Aug 2009, Oliver Neukum wrote:
> > > Am Samstag, 1. August 2009 03:54:04 schrieb Alan Stern:
> > > > On Sat, 1 Aug 2009, Oliver Neukum wrote:
> 
> > Neither more nor less -- it's not our concern.  The right approach is
> > to have the storage driver not carry out its own suspend until the SCSI
> > suspend routines have been called.  That way we don't violate layering.
> > And if anything goes wrong, we can blame the SCSI people.  :-)
> 
> This approach is, I am afraid, of limited utility. sd and its siblings
> are not drivers for hardware, they implement a set of commands.
> They can tell you they are busy, but not whether hardware cannot
> be suspended because state that can't be restored would be lost.
> 
> The SCSI layer is written to export such stuff to transport handlers.

And there is no USB transport class.  We really should write one.  But
how would it know whether there is any state to lose?

> > It means we have to figure out how to be sure that the SCSI suspend
> > routines have been invoked.
> 
> We call them ;-) ?

That's backward.  USB shouldn't tell SCSI that it's time to suspend a
device, since USB doesn't know what the device is doing.  In fact, USB
doesn't even know what devices there are!  (It's not aware of targets
or LUNs, only of the host.)  Things should work the other way around:  
SCSI (or the transport class) should tell USB when the host is not
being used and can safely be suspended.

> > Or to put it another way, we should do _exactly_ what sd would do -- by
> > asking sd to do it!  Or more properly, by getting the SCSI core to tell
> > the appropriate drivers to do their own things.
> 
> These are really two different proposals.

You mean mine is different from your proposal?  Yes, certainly.  As I
said, your proposal violates layering by working backward.

> > In any event, we will eventually want to tie this in with Rafael's new
> > runtime PM infrastructure.  If usb-storage and SCSI both use it then
> > the integration should be fairly easy.
> 
> Eventually or now? Do we have to wait for the framework to be merged?

I think we should.  Otherwise all the SCSI work will have to be redone 
to use the framework, anyway.

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