Re: [PATCH v5 3/4] block: implement runtime pm strategy

From: Alan Stern
Date: Fri Jul 06 2012 - 10:21:47 EST


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@xxxxxxxxx>

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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/