From: Aaron Lu <aaron.lu@intel.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
Jeff Garzik <jgarzik@pobox.com>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Oliver Neukum <oneukum@suse.de>,
Linux-pm mailing list <linux-pm@vger.kernel.org>,
SCSI development list <linux-scsi@vger.kernel.org>,
linux-ide@vger.kernel.org
Subject: Re: [PATCH v7 2/6] scsi: sr: support runtime pm
Date: Tue, 09 Oct 2012 15:20:39 +0800 [thread overview]
Message-ID: <5073D047.5060601@intel.com> (raw)
In-Reply-To: <1349691716.2615.34.camel@dabdike.int.hansenpartnership.com>
On 10/08/2012 06:21 PM, James Bottomley wrote:
> On Mon, 2012-10-08 at 17:27 +0800, Aaron Lu wrote:
>> On Sun, Sep 30, 2012 at 03:43:27PM -0400, Alan Stern wrote:
>>> On Sun, 30 Sep 2012, Jeff Garzik wrote:
>>>
>>>> The simple fact of "only ZPODD devices out there are ATA" is not the
>>>> decision-maker for where the code should live. It is more a question
>>>> where ZPODD belongs in the device/command set model currently employed.
>>>
>>> I don't really accept this argument. It's a little like saying: The
>>> tty layer uses ioctl commands to control RS232 line settings; therefore
>>> RS232 settings should be handled in the VFS layer as part of the ioctl
>>> core.
>>>
>>> Regardless, according to Aaron the ZP power-off stuff is currently
>>> implemented only in ACPI, tied more closely to the ATA layer than the
>>> SCSI layer (though not part of either). It is not part of the SCSI
>>> spec in any form.
>>
>> The mechanism of SATA ODD zero power model is specified in Mount Fuji
>> spec v8 section 15 describing what the ODD needs support, how to sense
>> if the ODD is ready to be powered off and on power up what needs to be
>> done, etc. And the actual power off and wakeup is implemented in ACPI
>> and SATA.
>>
>>> Now it's true that determining whether a device is
>>> in the right state for power to be removed involves sending a TEST UNIT
>>> READY command, which is of course a SCSI command. This seems to be
>>> incidental to the overall scheme, however.
>>
>> I need to add that, there are 2 schemes to sense if the ODD is ready to
>> be powered off:
>> 1 the one I used here, by checking if the door is closed and no media
>> inside with test_unit_ready;
>> 2 some ZP capable ODDs can report zero power ready(ZPReady) event to
>> host when queried, eliminating the need of host checking the conditions.
>
> The way I read the standard is that ZP ODD is a hack to try and get to
Thanks for your time.
> off and ZPready is the same hack but integrated into the standardised
> power management states (and hence available to normal power saving).
> The standard even implies ZP ODD is a less desirable hack by
> recommending the use of ZPready.
There are ZPODDs not supporting ZPready and I want to support them so
the sense scheme 1 is used.
>
> The ZPready method, being an extension of the usual SCSI power
> management model, is pretty much what we support today (especially as
> the whole thing is timer driven from values in the mode page and happens
> pretty much invisibly to us).
>
> Since the object is to make this as painless as possible, why don't we
> just implement ZPODD the way the spec recommends? i.e. emulate the
> timers at an incredibly low level and intercept and emulate the non-disk
> commands listed in table 321. I bet, in Linux, since we moved basically
> to GET_EVENT_STATUS_NOTIFICATION, that's the only one that actually
> needs an emulation.
>
> The state model seems to work if you snoop the polled media event, so
> you wait for no media, then set your internal timer, stop it if we get a
> media change and power off the device after interval expiry. Thereafter
> you emulate media event with no change keeping the device powered off.
> If a disc gets inserted or the eject button is pressed, you see that via
> the SATA PHY events (so wake the drive) and if the Upper Layer sends an
> unexpected command, you also power on the drive.
>
> That way all of this should be nicely containable within SATA/ACPI.
Thanks for the suggestion, it is really something that I've never
thought of :-)
But I was hoping to use the runtime pm framework to support ZPODD.
With your suggestion, I don't know how to do this. Maybe I can set the
scsi device representing the ODD to runtime suspended once I decided to
power it off and resume it when I power it up. But there is a problem,
that I'm setting a scsi device's runtime status in ATA layer, this
doesn't feel right. And someday, someone may want to add runtime pm
support for sr and the runtime status of the scsi device will be messed.
The reason I want to use runtime PM is, when the scsi device is runtime
suspended, its ancestor devices will have a chance to enter runtime
suspend state, e.g. the sata controller.
Thanks,
Aaron
next prev parent reply other threads:[~2012-10-09 7:20 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-12 8:29 [PATCH v7 0/6] ZPODD patches Aaron Lu
2012-09-12 8:29 ` [PATCH v7 1/6] block: genhd: add an interface to set disk poll interval Aaron Lu
2012-09-20 20:35 ` Rafael J. Wysocki
2012-09-12 8:29 ` [PATCH v7 2/6] scsi: sr: support runtime pm Aaron Lu
2012-09-20 20:48 ` Rafael J. Wysocki
2012-09-20 20:54 ` Alan Stern
2012-09-21 1:02 ` Aaron Lu
2012-09-21 20:49 ` Rafael J. Wysocki
2012-09-24 1:20 ` Aaron Lu
2012-09-24 12:55 ` Rafael J. Wysocki
2012-09-24 14:52 ` Aaron Lu
2012-09-24 21:40 ` Rafael J. Wysocki
2012-09-25 8:01 ` Aaron Lu
2012-09-25 11:47 ` Rafael J. Wysocki
2012-09-25 14:20 ` Aaron Lu
2012-09-25 14:23 ` Oliver Neukum
2012-09-25 14:46 ` Aaron Lu
2012-09-25 21:45 ` Rafael J. Wysocki
2012-09-26 1:03 ` Aaron Lu
2012-09-26 11:18 ` Rafael J. Wysocki
2012-09-26 14:52 ` Aaron Lu
2012-09-26 7:20 ` Oliver Neukum
2012-09-27 10:46 ` Oliver Neukum
2012-09-28 8:20 ` Aaron Lu
2012-09-12 8:29 ` [PATCH v7 3/6] scsi: sr: support zero power ODD(ZPODD) Aaron Lu
2012-09-20 22:07 ` Rafael J. Wysocki
2012-09-21 1:39 ` Aaron Lu
2012-09-21 21:02 ` Rafael J. Wysocki
2012-09-27 9:26 ` Aaron Lu
2012-09-27 14:42 ` Alan Stern
2012-09-27 14:55 ` Aaron Lu
2012-09-27 23:29 ` Rafael J. Wysocki
2012-09-24 21:55 ` Jeff Garzik
2012-09-12 8:29 ` [PATCH v7 4/6] scsi: pm: add may_power_off flag Aaron Lu
2012-09-12 8:29 ` [PATCH v7 5/6] scsi: sr: use may_power_off Aaron Lu
2012-09-12 8:29 ` [PATCH v7 6/6] libata: acpi: respect may_power_off flag Aaron Lu
2012-09-24 21:55 ` Jeff Garzik
2012-09-19 8:03 ` [PATCH v7 0/6] ZPODD patches Aaron Lu
2012-09-19 12:27 ` James Bottomley
2012-09-19 12:50 ` Rafael J. Wysocki
2012-09-19 14:19 ` Aaron Lu
2012-09-20 20:00 ` Rafael J. Wysocki
2012-09-21 5:48 ` Aaron Lu
2012-09-21 21:18 ` Rafael J. Wysocki
2012-09-22 7:32 ` Oliver Neukum
2012-09-22 11:28 ` Rafael J. Wysocki
2012-09-22 15:38 ` Alan Stern
2012-09-22 19:46 ` Rafael J. Wysocki
2012-09-22 20:23 ` Alan Stern
2012-09-22 21:48 ` Rafael J. Wysocki
2012-09-24 2:55 ` Aaron Lu
2012-09-24 13:06 ` Rafael J. Wysocki
2012-09-24 15:04 ` Aaron Lu
2012-09-24 21:46 ` Rafael J. Wysocki
2012-09-25 8:18 ` Aaron Lu
2012-09-25 11:02 ` James Bottomley
2012-09-25 13:56 ` Aaron Lu
2012-09-27 9:43 ` Aaron Lu
2012-09-24 15:47 ` Alan Stern
2012-09-19 14:52 ` James Bottomley
2012-09-20 21:46 ` Rafael J. Wysocki
2012-09-19 13:05 ` Oliver Neukum
2012-09-19 15:19 ` David Woodhouse
2012-09-20 0:34 ` Jack Wang
[not found] ` <201209280115.06964.rjw@sisk.pl>
[not found] ` <5064FA08.6030005@intel.com>
[not found] ` <201209282346.15872.rjw@sisk.pl>
2012-09-29 2:10 ` [PATCH v7 2/6] scsi: sr: support runtime pm Aaron Lu
2012-09-29 14:29 ` Alan Stern
2012-09-29 15:03 ` Aaron Lu
2012-09-29 22:44 ` Rafael J. Wysocki
2012-09-30 12:32 ` Aaron Lu
2012-09-30 14:47 ` Alan Stern
2012-09-30 15:39 ` Aaron Lu
2012-09-30 19:15 ` Jeff Garzik
2012-09-30 19:08 ` Jeff Garzik
2012-09-29 22:31 ` Rafael J. Wysocki
2012-09-30 19:03 ` Jeff Garzik
2012-09-30 19:43 ` Alan Stern
2012-10-01 4:57 ` Jeff Garzik
2012-10-08 9:27 ` Aaron Lu
2012-10-08 10:21 ` James Bottomley
2012-10-09 7:20 ` Aaron Lu [this message]
2012-10-09 14:58 ` James Bottomley
2012-10-11 7:49 ` Aaron Lu
2012-10-09 23:26 ` Rafael J. Wysocki
2012-09-29 22:27 ` Rafael J. Wysocki
2012-09-30 12:38 ` Aaron Lu
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=5073D047.5060601@intel.com \
--to=aaron.lu@intel.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=oneukum@suse.de \
--cc=rjw@sisk.pl \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.