From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Aaron Lu <aaron.lu@intel.com>
Cc: Oliver Neukum <oneukum@suse.de>,
Alan Stern <stern@rowland.harvard.edu>,
James Bottomley <James.Bottomley@hansenpartnership.com>,
Jeff Garzik <jgarzik@pobox.com>,
linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org,
linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org,
Aaron Lu <aaron.lwe@gmail.com>
Subject: Re: [PATCH v7 2/6] scsi: sr: support runtime pm
Date: Tue, 25 Sep 2012 23:45:34 +0200 [thread overview]
Message-ID: <201209252345.35233.rjw@sisk.pl> (raw)
In-Reply-To: <5061C3AE.6030103@intel.com>
On Tuesday, September 25, 2012, Aaron Lu wrote:
> On 09/25/2012 10:23 PM, Oliver Neukum wrote:
> > On Tuesday 25 September 2012 22:20:21 Aaron Lu wrote:
> >> On Tue, Sep 25, 2012 at 01:47:52PM +0200, Rafael J. Wysocki wrote:
> >>> On Tuesday, September 25, 2012, Aaron Lu wrote:
> >>>> I'm thinking of enabling this GPE in sr_suspend once we decided that it
> >>>> is ready to be powered off, so the time frame between sr_suspend and
> >>>> when the power is actually removed in libata should be taken care of by
> >>>> the GPE. If GPE fires, the notification function will request a runtime
> >>>> resume of the device. Does this sound OK?
> >>>
> >>> Well, depending on the implementation. sr_suspend() should be rather
> >>> generic, but the ACPI association (including the GPE thing) is specific to ATA.
> >>
> >> Sorry, but don't quite understand this.
> >>
> >> We have ACPI bindings for scsi devices, isn't that for us to use ACPI
> >> when needed in scsi?
> >
> > We don't have ACPI bindings for generic SCSI devices. We have such
> > bindings for SATA drives. You can put such things only in sr if it applies
> > to all (maybe most) types of drives.
>
> OK. Then these scsi bindings for sata drives will be pretty much of
> no use I think.
>
> >
> >> BTW, if sr_suspend should be generic, that would suggest I shouldn't
> >> write any ZPODD related code there, right? Any suggestion where these
> >> code should go then?
> >
> > libata. Maybe some generic hooks can be called in sr_suspend().
>
> Thanks for the suggestion.
> The problem is, I need to know whether the door is closed and if there
> is a medium inside. I've no way of getting such information in libata.
How does sr get to know it in the libata case?
> > PS: Are you sure sr_suspend() handles DVD-RAMs correctly?
>
> No. Is there a spec for it?
> Considering there are many different drives sr handle, is it possible to
> write a generic sr_suspend?
> Maybe your suggestion of callback is the way to go.
> What about this idea, if we find this is a ZPODD capable drive, we
> enable runtime suspend for it and write a suspend callback according to
> ZPODD spec. For other drives that does not have a suspend callback, we
> do not enable runtime suspend.
You can enable runtime PM for all kinds of drives, but make the suspend
and resume callbacks only do something for ZPODD ones. This may allow their
parents to use runtime PM (as Alan said earlier in this thread), even if the
drives themseleves are not really physically suspended.
> Does this sound reasonable?
First, we need to know when the drive is not in use. That information
we can get from the sr's runtime PM and it looks like we need to notify
libata about that somehow. I'm not sure what mechanism is the best for
that at the moment.
Second, when the device is resumed by remote wakeup, we need to notify
sr about that. A "resume" alone is not sufficient, though, because it may
be necessary to open the tray. Perhaps in that case we can use the same
mechanism by which user events are processed by libata and delivered to sr?
Rafael
next prev parent reply other threads:[~2012-09-25 21:39 UTC|newest]
Thread overview: 63+ 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 [this message]
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-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
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=201209252345.35233.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=James.Bottomley@hansenpartnership.com \
--cc=aaron.lu@intel.com \
--cc=aaron.lwe@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=oneukum@suse.de \
--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;
as well as URLs for NNTP newsgroup(s).