All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lwe@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Aaron Lu <aaron.lu@intel.com>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Jeff Garzik <jgarzik@pobox.com>,
	linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH v5 0/7] ZPODD patches
Date: Fri, 31 Aug 2012 23:43:09 +0800	[thread overview]
Message-ID: <20120831154306.GA1427@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1208311017001.1328-100000@iolanthe.rowland.org>

On Fri, Aug 31, 2012 at 10:33:40AM -0400, Alan Stern wrote:
> On Fri, 31 Aug 2012, Aaron Lu wrote:
> 
> > v5:
> > Add may_power_off flag to scsi device.
> > Alan Stern suggested that I should not mess runtime suspend with
> > runtime power off, but the current zpodd implementation made it not
> > easy to seperate. So I re-wrote the zpodd implementation, the end
> > result is, normal ODD can also enter runtime suspended state, but
> > their power won't be removed.
> 
> This looks good.  I noticed only a few things:
> 
> In patch 5/7, your implementation of may_power_off is written in such a
> way that if the drive is already powered off when userspace clears the
> flag, the drive is not automatically powered back on.  Maybe this is
> what you want?

No, actually I didn't consider this.

What about I do this when may_power_off is set to 0:
In its store function, if the device is runtime suspended(which means it
is in powered off state since may_power_off was 1 before this store call)
I'll set the flag to 0 and then runtime resume this device.

> 
> In patch 1/7 you call both scsi_autopm_get_device() and 
> scsi_autopm_put_device() twice in sr_check_events().  With a little 
> rewriting it should be possible to call them only once.  Just replace
> the "return events" lines with gotos.

Thanks, will change this.

> 
> What happens if you have an idle ZPODD with may_power_off clear?  A
> regular ODD would get runtime-suspended.  In the same way, a ZPODD
> should also be runtime-suspended but left at full power.  Does patch
> 7/7 work this way?  It seems to, but I can't tell for sure.

Yes, if may_power_off is cleared, d3 cold state will not be allowed,
which means it won't be powered off.

Thanks,
Aaron

  reply	other threads:[~2012-08-31 15:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-31  9:42 [PATCH v5 0/7] ZPODD patches Aaron Lu
2012-08-31  9:42 ` [PATCH v5 1/7] scsi: sr: support runtime pm for ODD Aaron Lu
2012-08-31  9:42 ` [PATCH v5 2/7] block: genhd: export disk_(un)block_events Aaron Lu
2012-08-31  9:42 ` [PATCH v5 3/7] scsi: sr: block events checking when suspended for zpodd Aaron Lu
2012-08-31  9:42 ` [PATCH v5 4/7] libata: acpi: set can_power_off for both ODD and HD Aaron Lu
2012-08-31  9:42 ` [PATCH v5 5/7] scsi: pm: add may_power_off flag Aaron Lu
2012-08-31  9:42 ` [PATCH v5 6/7] scsi: sr: use may_power_off Aaron Lu
2012-08-31  9:42 ` [PATCH v5 7/7] libata: acpi: respect may_power_off flag Aaron Lu
2012-08-31 14:33 ` [PATCH v5 0/7] ZPODD patches Alan Stern
2012-08-31 15:43   ` Aaron Lu [this message]
2012-08-31 17:10     ` Alan Stern

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=20120831154306.GA1427@localhost.localdomain \
    --to=aaron.lwe@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=aaron.lu@intel.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=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.