Re: question on flushing buffers and spinning down disk

Oliver Neukum <[email protected]>
Newsgroups gmane.linux.usb.devel,gmane.linux.scsi
Message-ID <[email protected]>
Am Freitag 28 September 2007 schrieb Alan Stern:
> On Fri, 28 Sep 2007, Oliver Neukum wrote:
> 
> > Am Donnerstag 27 September 2007 schrieb Alan Stern:
> > > Have you thought about how autoresume would fit into this picture?  I
> > > don't think you can rely on usb-storage telling the SCSI core to resume
> > > devices when it gets handed a command, because the commands to spin-up
> > > the drives would have to be transmitted first.  (The sample patch you
> 
> I had another look at your patch.  It calls scsi_device_quiesce(), 
> which causes all normal requests to be deferred.  Hence under normal 
> operation the device would never autoresume -- user requests would be 
> deferred and never sent to usb-storage.

Unless I am very mistaken, further down in storage_suspend, I call

+	/* In case of autosuspend device must be unblocked again */
+	if (us->pusb_dev->auto_pm) {
+err_unblock:
+		shost_for_each_device(sdev, host) {
+			if (sdev == sdev2) {
+				scsi_device_put(sdev);
+				break;
+			}
+			scsi_device_resume(sdev);

which again allows normal io, so the autoresume is triggered.
It may deadlock, you are right about that, but it is definitely triggered.
I verified that experimentally.

	Regards
		Oliver


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.