lkml.org 
[lkml]   [2013]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 2/4] block: add runtime pm helpers
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).

Alan Stern



\
 
 \ /
  Last update: 2013-01-30 17:44    [W:0.074 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site