Re: [RFC] usb: storage: Auto-suspend when media is removed.

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

 



Am Montag, 12. Juli 2010, 16:34:11 schrieb Alan Stern:
> On Mon, 12 Jul 2010, Oliver Neukum wrote:
> 
> > Am Montag, 12. Juli 2010, 04:02:58 schrieb Alan Stern:
> > > On Sun, 11 Jul 2010, Oliver Neukum wrote:
> > > 
> > > > I am afraid this is not quite the case. If the device was just opened and closed,
> > > > the normal heuristics make sense. If the device reports that no medium is present,
> > > > you should suspend at once.
> > > 
> > > In theory, yes.  But how many programs continue to hold the device file 
> > > open after they learn that no medium is present?  And do so without 
> > > sending more transfer requests?
> > 
> > None that I know of. But do they need to? It seems to me that the normal
> > polling will continously open/close devices are a rate comparable to the
> > standard time the heuristics uses.
> 
> That statement is a little unclear.  Do you mean that the normal
> polling programs will open the device file (which automatically sends a
> TEST UNIT READY command) and then close the device file each time they
> poll for media present?  I think that's right; as far as I know they do
> not hold the device file open between polls.  (If any of them do, they
> ought to be changed.)

Yes.

> I don't see how it affects the topic of this discussion, though.  It 
> means that suspending whenever you learn there is no media will yield 
> essentially the same result as suspending whenever the device file is 
> closed.

If you suspend as soon as you close, yes. If you use the heuristics
of waiting a little time before you suspend, no.

> As for the time required...  I have thought several times that perhaps
> we should have an "autosuspend_ms" attribute in addition to (if not
> instead of) the "autosuspend" file.  While delays much shorter than 50
> or 100 ms don't make any sense, that still leaves a lot of room between
> 50 and 1000 ms, which is the shortest we can currently accomodate.

The people at Sony/Ericsson tested that with cdc-acm. No useful
power savings. It might be different with storage. Though I see no gain
in any delay if we learn that no medium is present.

> > Now we could shift this to user space,
> 
> Shift what to user space?

Setting delay to 0 as soon as user space learns that no medium is present.

> >  but I doubt we'd get it in
> > in a reasonable time frame. And I believe this is a feature we could
> > use in the long run.
> 
> Do you mean we could use autosuspend for storage devices in general, or
> that we could use autosuspend whenever no media is present?

The feature of a driver letting the core know that the device will be idle
from now on for some time. 

	Regards
		Oliver
--
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