[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1207061019170.28821-100000@netrider.rowland.org>
Date: Fri, 6 Jul 2012 10:21:49 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Lin Ming <ming.m.lin@...el.com>
cc: Jens Axboe <axboe@...nel.dk>, "Rafael J. Wysocki" <rjw@...k.pl>,
Shaohua Li <shli@...nel.org>, <linux-kernel@...r.kernel.org>,
<linux-pm@...r.kernel.org>, <linux-scsi@...r.kernel.org>
Subject: Re: [PATCH v5 3/4] block: implement runtime pm strategy
On Fri, 6 Jul 2012, Lin Ming wrote:
> When a request is added:
> If device is suspended or is suspending and the request is not a
> PM request, resume the device.
>
> When a request finishes:
> Call pm_runtime_mark_last_busy().
>
> When pick a request:
> If device is resuming/suspending, then only PM request is allowed to go.
> Return NULL for other cases.
>
> Signed-off-by: Lin Ming <ming.m.lin@...el.com>
Generally okay, but...
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -908,6 +908,36 @@ extern int blk_pre_runtime_suspend(struct request_queue *q);
> extern void blk_post_runtime_suspend(struct request_queue *q, int err);
> extern void blk_pre_runtime_resume(struct request_queue *q);
> extern void blk_post_runtime_resume(struct request_queue *q, int err);
> +
> +static inline void blk_pm_put_request(struct request_queue *q)
> +{
> + if (!(--q->nr_pending) && q->dev)
> + pm_runtime_mark_last_busy(q->dev);
> +}
...
These new helper routines are private to the block layer, not intended
for use by clients. Consequently they don't belong in include/linux;
they should go in block/blk.h.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists