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 v6 3/4] block: implement runtime pm strategy
Date: Mon, 14 Jan 2013 11:03:02 +0800 [thread overview]
Message-ID: <20130114030302.GA15280@aaronlu.sh.intel.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1301081016310.1535-100000@iolanthe.rowland.org>
On Tue, Jan 08, 2013 at 10:22:45AM -0500, Alan Stern wrote:
> Just as importantly, all of the public routines added in patch 2/4 to
> blk-core.c should have kerneldoc explaining how and where to use them.
> In particular, the kerneldoc for blk_pm_runtime_init() has to mention
> that the block runtime PM implementation works only for drivers that
> use request structures for their I/O; it doesn't work for drivers that
> use bio's directly.
How about the following description for them?
/**
* blk_pm_runtime_init - Block layer runtime PM initialization routine
* @q: the queue of the device
* @dev: the device the queue belongs to
*
* Description:
* Initialize runtime PM related fields for @q and start auto suspend
* for @dev. Drivers that want to take advantage of request based runtime
* PM should call this function after @dev has been initialized, and its
* request queue @q has been allocated, and runtime PM for it is not
* ready yet(either disabled/forbidden or its usage count >= 0).
*
* The block layer runtime PM is request based, so only works for drivers
* that use request as their IO unit instead of those directly use bio's.
*/
/**
* blk_pre_runtime_suspend - Pre runtime suspend check
* @q: the queue of the device
*
* Description:
* This function will check if runtime suspend is allowed for the device
* by examining if there are any requests pending in the queue. If there
* are requests pending, the device can not be runtime suspended; otherwise,
* the queue's status will be updated to SUSPENDING and the driver can
* proceed to suspend the device.
*
* For the not allowed case, we mark last busy for the device so that
* runtime PM core will try to autosuspend it some time later.
*
* This function should be called in the device's runtime suspend callback,
* before its runtime suspend function is called.
*
* Return:
* 0 - OK to runtime suspend the device
* -EBUSY - Device should not be runtime suspended
*/
/**
* blk_post_runtime_suspend - Post runtime suspend processing
* @q: the queue of the device
* @err: return value of the device's runtime suspend function
*
* Description:
* Update the queue's runtime status according to the return value of the
* device's runtime suspend function.
*
* This function should be called in the device's runtime suspend callback,
* after its runtime suspend function is called.
*/
/**
* blk_pre_runtime_resume - Pre runtime resume processing
* @q: the queue of the device
*
* Description:
* Update the queue's runtime status to RESUMING in preparation for the
* runtime resume of the device.
*
* This function should be called in the device's runtime resume callback,
* before its runtime resume function is called.
*/
/**
* blk_post_runtime_resume - Post runtime resume processing
* @q: the queue of the device
* @err: return value of the device's runtime resume function
*
* Description:
* Update the queue's runtime status according to the return value of the
* device's runtime resume function. If it is successfully resumed, process
* the requests that are queued into the device's queue when it is resuming
* and then mark last busy and initiate autosuspend for it.
*
* This function should be called in the device's runtime resume callback,
* after its runtime resume function is called.
*/
Please feel free to suggest, thanks.
-Aaron
next prev parent reply other threads:[~2013-01-14 3:03 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-06 8:41 [PATCH v6 0/4] block layer runtime pm Aaron Lu
2013-01-06 8:41 ` [PATCH v6 1/4] block: add a flag to identify PM request Aaron Lu
2013-01-06 8:41 ` [PATCH v6 2/4] block: add runtime pm helpers Aaron Lu
2013-01-07 17:15 ` Alan Stern
2013-01-07 17:15 ` Alan Stern
2013-01-06 8:41 ` [PATCH v6 3/4] block: implement runtime pm strategy Aaron Lu
2013-01-07 17:21 ` Alan Stern
2013-01-07 17:21 ` Alan Stern
2013-01-08 7:36 ` Aaron Lu
2013-01-08 15:22 ` Alan Stern
2013-01-08 15:22 ` Alan Stern
2013-01-14 3:03 ` Aaron Lu [this message]
2013-01-14 18:13 ` Alan Stern
2013-01-14 18:13 ` Alan Stern
2013-01-06 8:41 ` [PATCH v6 4/4] sd: change to auto suspend mode Aaron Lu
2013-01-07 9:19 ` Oliver Neukum
2013-01-07 9:31 ` Aaron Lu
2013-01-07 17:11 ` [PATCH v6 0/4] block layer runtime pm Alan Stern
2013-01-07 17:11 ` Alan Stern
2013-01-08 7:33 ` Aaron Lu
2013-01-08 15:27 ` Alan Stern
2013-01-08 15:27 ` Alan Stern
2013-01-14 3:14 ` Aaron Lu
2013-01-14 15:41 ` Alan Stern
2013-01-14 15:41 ` 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=20130114030302.GA15280@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 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.