linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Jens Axboe <axboe@kernel.dk>, "Rafael J. Wysocki" <rjw@sisk.pl>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	linux-pm@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org, Aaron Lu <aaron.lwe@gmail.com>,
	Shane Huang <shane.huang@amd.com>
Subject: Re: [PATCH v8 2/4] block: add runtime pm helpers
Date: Thu, 31 Jan 2013 13:35:35 +0800	[thread overview]
Message-ID: <20130131053535.GA14627@aaronlu.sh.intel.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1301301053210.1709-100000@iolanthe.rowland.org>

On Wed, Jan 30, 2013 at 10:54:53AM -0500, Alan Stern wrote:
> On Wed, 30 Jan 2013, Aaron Lu wrote:
> 
> > From: Lin Ming <ming.m.lin@intel.com>
> > 
> > Add runtime pm helper functions:
> > 
> > void blk_pm_runtime_init(struct request_queue *q, struct device *dev)
> >   - Initialization function for drivers to call.
> > 
> > int blk_pre_runtime_suspend(struct request_queue *q)
> >   - If any requests are in the queue, mark last busy and return -EBUSY.
> >     Otherwise set q->rpm_status to RPM_SUSPENDING and return 0.
> > 
> > void blk_post_runtime_suspend(struct request_queue *q, int err)
> >   - If the suspend succeeded then set q->rpm_status to RPM_SUSPENDED.
> >     Otherwise set it to RPM_ACTIVE.
> > 
> > void blk_pre_runtime_resume(struct request_queue *q)
> >   - Set q->rpm_status to RPM_RESUMING.
> > 
> > void blk_post_runtime_resume(struct request_queue *q, int err)
> >   - If the resume succeeded then set q->rpm_status to RPM_ACTIVE
> >     and call __blk_run_queue, then mark last busy and autosuspend.
> >     Otherwise set q->rpm_status to RPM_SUSPENDED.
> > 
> > Signed-off-by: Lin Ming <ming.m.lin@intel.com>
> > Signed-off-by: Aaron Lu <aaron.lu@intel.com>
> 
> > +void blk_pm_runtime_init(struct request_queue *q, struct device *dev)
> > +{
> > +	q->dev = dev;
> > +	q->rpm_status = RPM_ACTIVE;
> > +	pm_runtime_set_autosuspend_delay(q->dev, -1);
> > +	pm_runtime_use_autosuspend(q->dev);
> > +	pm_runtime_mark_last_busy(q->dev);
> > +	pm_runtime_autosuspend(q->dev);
> 
> This last line is no longer needed.  It can't do anything useful, since 
> autosuspends are disabled (the delay is -1).

Right, thanks.
And the mark_last_busy can probably be removed too, it didn't make much
sense here and we can add "driver should call pm_runtime_mark_last_busy
and pm_runtime_autosuspend in its runtime idle callback" to the kernel
doc. What do you think?

Thanks,
Aaron


  reply	other threads:[~2013-01-31  5:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30  9:34 [PATCH v8 0/4] block layer runtime pm Aaron Lu
2013-01-30  9:34 ` [PATCH v8 1/4] block: add a flag to identify PM request Aaron Lu
2013-01-30  9:34 ` [PATCH v8 2/4] block: add runtime pm helpers Aaron Lu
2013-01-30 15:54   ` Alan Stern
2013-01-31  5:35     ` Aaron Lu [this message]
2013-01-31 15:09       ` Alan Stern
2013-01-30  9:34 ` [PATCH v8 3/4] block: implement runtime pm strategy Aaron Lu
2013-01-30  9:34 ` [PATCH v8 4/4] sd: change to auto suspend mode Aaron Lu
2013-01-30 15:38   ` Alan Stern
2013-01-31  5:43     ` Aaron Lu
2013-01-31 15:13       ` Alan Stern
2013-02-01  3:19         ` Aaron Lu
2013-02-01 15:11           ` 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=20130131053535.GA14627@aaronlu.sh.intel.com \
    --to=aaron.lu@intel.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=aaron.lwe@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=shane.huang@amd.com \
    --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).