public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb-devel@lists.sourceforge.net,
	James Bottomley <James.Bottomley@steeleye.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [linux-usb-devel] question on flushing buffers and spinning down disk
Date: Fri, 28 Sep 2007 10:17:56 +0200	[thread overview]
Message-ID: <200709281017.56901.oliver@neukum.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0709271600200.7735-100000@iolanthe.rowland.org>

Am Donnerstag 27 September 2007 schrieb Alan Stern:
> On Thu, 27 Sep 2007, Oliver Neukum wrote:
> 
> > > > 1. autosuspend should not be specific to USB
> > > 
> > > Correct.  Which means support for it should be added to the SCSI
> > > drivers.  SCSI autosuspend shouldn't be kluged into usb-storage in a
> > > way that basically ignores what the SCSI layer is doing.
> > 
> > It isn't. The decision to autosuspend is based on activity on the bus.
> > Now you might argue that the decision to do an autosuspend should
> > always propagate upwards from the lowest level of the device tree.
> > Then I ask why?
> 
> Because that's how I have always thought of it...  :-)
> 
> You're right; there's no showstopping reason particular subsystems like
> SCSI can't use a different approach.  However bus activity alone isn't
> a sufficient criterion.  For example, suppose somebody sends a PLAY
> AUDIO command to a SCSI cdrom drive.  There won't be any bus activity
> while the music is playing, but the device will be active and so it
> shouldn't be suspended.  Thus the sr driver would want to fail an
> autosuspend call.

sr isn't a device driver. Furthermore it is generic. It can't know whether
any power saving measure would prevent some activity from being carried
out. It seems to me that we need to be conservative. Any device that
is opened by user space must not be autosuspended. But how to fit this
into SCSI?

> Anyway, if we do end up going this route then there should be a routine
> added to the SCSI core which would call the suspend methods for all the
> attached devices.  This doesn't belong in usb-storage (and even worse, 
> it shouldn't be duplicated in all the other low-level drivers); rather,
> usb-storage should simply be able to call the new routine.

We are moving in circles. In an earlier thread you argued that a suspend
call should not walk the device tree in case of runtime power management.
 
> 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
> posted will deadlock: The other command can't begin until the spin-up
> command completes, and the spin-up command won't get sent to
> usb-storage until the original command completes.)  In other words,
> autoresume must be handled at the level of the SCSI core.

That's a difficult one. I need to ponder this a bit.
 
[..]

> There's also a philosophical objection.  Who is in a better position to
> judge when a device like a SCSI drive should be autosuspended: its own
> driver (sd) or someone else (usb-storage)?

SCSI doesn't know about power management. It cannot, it is not a notion
native to SCSI. It just knows how to safely put drives into a state other
than fully active (flushing buffers/spin down)
You are expecting too much of SCSI core.

	Regards
		Oliver


  parent reply	other threads:[~2007-09-28  8:16 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-18  8:32 question on flushing buffers and spinning down disk Oliver Neukum
2007-09-18 14:01 ` James Bottomley
2007-09-18 14:15   ` Oliver Neukum
2007-09-18 14:26     ` James Bottomley
2007-09-24 10:33       ` Oliver Neukum
2007-09-24 14:38         ` Alan Stern
2007-09-24 15:21           ` Oliver Neukum
2007-09-24 15:34             ` Alan Stern
2007-09-24 16:47               ` Oliver Neukum
2007-09-24 17:10                 ` Alan Stern
2007-09-24 19:16                   ` [linux-usb-devel] " Oliver Neukum
2007-09-24 19:39                     ` Alan Stern
2007-09-24 20:00                       ` [linux-usb-devel] " Oliver Neukum
2007-09-25 14:13                         ` Alan Stern
2007-09-25 15:11                           ` Oliver Neukum
2007-09-28  4:27                             ` Greg KH
2007-09-28  7:02                               ` Oliver Neukum
2007-09-28 19:33                                 ` Greg KH
2007-09-25  7:50                       ` Oliver Neukum
2007-09-25 15:03                         ` Alan Stern
2007-09-27 11:40                           ` Oliver Neukum
2007-09-27 16:01                             ` Alan Stern
2007-09-27 18:12                               ` Oliver Neukum
2007-09-27 19:07                                 ` [linux-usb-devel] " Alan Stern
2007-09-27 19:26                                   ` Oliver Neukum
2007-09-27 20:26                                     ` Alan Stern
2007-09-27 20:54                                       ` Steve Calfee
2007-09-27 21:16                                         ` Alan Stern
2007-09-27 21:37                                           ` U. George
2007-09-28  8:17                                       ` Oliver Neukum [this message]
2007-09-28 15:01                                         ` Alan Stern
2007-09-28  8:22                                       ` [linux-usb-devel] " Oliver Neukum
2007-09-28 21:11                                         ` Alan Stern
2007-09-28 21:47                                           ` Oliver Neukum
2007-09-29 15:56                                             ` Alan Stern
2007-09-29 16:12                                               ` [linux-usb-devel] " Oliver Neukum
2007-09-28  9:04                                       ` Oliver Neukum
2007-09-28 15:07                                         ` Alan Stern
2007-09-28 21:33                                           ` [linux-usb-devel] " Oliver Neukum
2007-09-29 16:38                                             ` Alan Stern
2007-09-29 17:52                                               ` Oliver Neukum
2007-09-29 19:06                                                 ` Alan Stern
2007-09-29 20:06                                                   ` Oliver Neukum
2007-09-29 20:56                                                     ` Alan Stern
2007-09-29 21:03                                                     ` David Brownell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200709281017.56901.oliver@neukum.org \
    --to=oliver@neukum.org \
    --cc=James.Bottomley@steeleye.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox