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: Pavel Machek <pavel@ucw.cz>,
	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 23:33:14 +0200	[thread overview]
Message-ID: <200709282333.15203.oliver@neukum.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0709281101460.4062-100000@iolanthe.rowland.org>

Am Freitag 28 September 2007 schrieb Alan Stern:
> On Fri, 28 Sep 2007, Oliver Neukum wrote:
> 
> > Am Donnerstag 27 September 2007 schrieb Alan Stern:
> > > 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)?
> > 
> > Then a philosophical answer. The highest entity which understands what
> > it is doing when using power management. Highest here to be understood
> > not as a position in the device tree, but in the flow of information.
> 
> In this sense, sd is higher than usb-storage, right?  Because I/O
> requests pass through sd first, then usb-storage, on their way to the 
> device.

Yes, but sr doesn't know hardware.

> My point is that when dealing with SCSI disks, sd understands the 
> implications of Power Management better than usb-storage does.  
> Similarly, when dealing with SCSI cd drives, sr understands the 
> implications of Power Management better than usb-storage.

No. The capabilities of the hardware are determined by USB.
USB imposes two strict rules.

1. The host cannot talk to a suspended device (keeping it suspended)
2. Power consumption is very limited

It makes no sense to talk about power management of devices as
such. You need to talk about devices on the bus type they are connected
to.
 
> Hence by your own argument, the SCSI high-level drivers should be 
> responsible for autosuspending their respective devices.  usb-storage, 
> on the other hand, should be responsible only for suspending the 
> transport, since that's what it does understand.

The weakest link of the chain determines the whole.
 
> > That is in our case usb-storage. Sr or sd can't do it because they don't
> > and can't understand power management.
> 
> That's simply not true.  If sd didn't understand Power Management then 
> sd_suspend() and sd_resume() would be empty.

It understands on and off. The methods simply do what is to be done
to safely switch off a disk.
 
> > Now they might be asked to provide some helpers. An open count and
> > notifications about the state of the queue would be obvious. Other
> > suggestions?
> 
> I still think you're trying to go about it all backwards.

I am using the point where the logical flow of information and the device
tree diverge.

	Regards
		Oliver
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2007-09-28 21:32 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                                       ` [linux-usb-devel] " Oliver Neukum
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                                           ` Oliver Neukum [this message]
2007-09-29 16:38                                             ` [linux-usb-devel] " 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=200709282333.15203.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=pavel@ucw.cz \
    --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