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

From: Lin Ming
Date: Fri Jul 06 2012 - 10:51:18 EST


On Fri, Jul 6, 2012 at 10:21 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> 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.

OK, will move it.

>
> 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/