Lines Matching refs:q
29 void blk_pm_runtime_init(struct request_queue *q, struct device *dev) in blk_pm_runtime_init() argument
31 q->dev = dev; in blk_pm_runtime_init()
32 q->rpm_status = RPM_ACTIVE; in blk_pm_runtime_init()
33 pm_runtime_set_autosuspend_delay(q->dev, -1); in blk_pm_runtime_init()
34 pm_runtime_use_autosuspend(q->dev); in blk_pm_runtime_init()
59 int blk_pre_runtime_suspend(struct request_queue *q) in blk_pre_runtime_suspend() argument
63 if (!q->dev) in blk_pre_runtime_suspend()
66 WARN_ON_ONCE(q->rpm_status != RPM_ACTIVE); in blk_pre_runtime_suspend()
68 spin_lock_irq(&q->queue_lock); in blk_pre_runtime_suspend()
69 q->rpm_status = RPM_SUSPENDING; in blk_pre_runtime_suspend()
70 spin_unlock_irq(&q->queue_lock); in blk_pre_runtime_suspend()
78 blk_set_pm_only(q); in blk_pre_runtime_suspend()
81 blk_freeze_queue_start(q); in blk_pre_runtime_suspend()
88 percpu_ref_switch_to_atomic_sync(&q->q_usage_counter); in blk_pre_runtime_suspend()
89 if (percpu_ref_is_zero(&q->q_usage_counter)) in blk_pre_runtime_suspend()
92 blk_mq_unfreeze_queue(q); in blk_pre_runtime_suspend()
95 spin_lock_irq(&q->queue_lock); in blk_pre_runtime_suspend()
96 q->rpm_status = RPM_ACTIVE; in blk_pre_runtime_suspend()
97 pm_runtime_mark_last_busy(q->dev); in blk_pre_runtime_suspend()
98 spin_unlock_irq(&q->queue_lock); in blk_pre_runtime_suspend()
100 blk_clear_pm_only(q); in blk_pre_runtime_suspend()
120 void blk_post_runtime_suspend(struct request_queue *q, int err) in blk_post_runtime_suspend() argument
122 if (!q->dev) in blk_post_runtime_suspend()
125 spin_lock_irq(&q->queue_lock); in blk_post_runtime_suspend()
127 q->rpm_status = RPM_SUSPENDED; in blk_post_runtime_suspend()
129 q->rpm_status = RPM_ACTIVE; in blk_post_runtime_suspend()
130 pm_runtime_mark_last_busy(q->dev); in blk_post_runtime_suspend()
132 spin_unlock_irq(&q->queue_lock); in blk_post_runtime_suspend()
135 blk_clear_pm_only(q); in blk_post_runtime_suspend()
150 void blk_pre_runtime_resume(struct request_queue *q) in blk_pre_runtime_resume() argument
152 if (!q->dev) in blk_pre_runtime_resume()
155 spin_lock_irq(&q->queue_lock); in blk_pre_runtime_resume()
156 q->rpm_status = RPM_RESUMING; in blk_pre_runtime_resume()
157 spin_unlock_irq(&q->queue_lock); in blk_pre_runtime_resume()
174 void blk_post_runtime_resume(struct request_queue *q) in blk_post_runtime_resume() argument
176 blk_set_runtime_active(q); in blk_post_runtime_resume()
197 void blk_set_runtime_active(struct request_queue *q) in blk_set_runtime_active() argument
201 if (!q->dev) in blk_set_runtime_active()
204 spin_lock_irq(&q->queue_lock); in blk_set_runtime_active()
205 old_status = q->rpm_status; in blk_set_runtime_active()
206 q->rpm_status = RPM_ACTIVE; in blk_set_runtime_active()
207 pm_runtime_mark_last_busy(q->dev); in blk_set_runtime_active()
208 pm_request_autosuspend(q->dev); in blk_set_runtime_active()
209 spin_unlock_irq(&q->queue_lock); in blk_set_runtime_active()
212 blk_clear_pm_only(q); in blk_set_runtime_active()