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

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

 



On Sun, 11 Jul 2010, Oliver Neukum wrote:

> Am Sonntag, 11. Juli 2010, 17:43:08 schrieb Alan Stern:
> > On Sun, 11 Jul 2010, Oliver Neukum wrote:
> > 
> > > Yes. The original patch was a hack. However this approach has some
> > > merit that could prove important in practice. It seems to me that we'll
> > > have to live with user space polling the devices for new media.
> > > If we cannot prevent it, we need to minimize damage. That requires
> > > 
> > > a) detecting the drive is empty
> > > b) suspend immediately without delay
> > > 
> > > Sarah has solved the first half of the problem.
> > 
> > The SCSI runtime PM patches also solve it, and they do a better job 
> > because they will allow autosuspend not only when the drive is empty 
> > but also when the device file isn't open.
> > 
> > The "without delay" part is solved simply by setting the autosuspend 
> > delay to 0.
> 
> 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?

Besides, you surely must agree that this patch is a tremendous layering
violation.  If we really want to allow autosuspend under the
circumstances just described, the right place to do it is in the SCSI 
disk driver.

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