Lines Matching refs:q
31 void blk_pm_runtime_init(struct request_queue *q, struct device *dev) in blk_pm_runtime_init() argument
33 q->dev = dev; in blk_pm_runtime_init()
34 q->rpm_status = RPM_ACTIVE; in blk_pm_runtime_init()
35 pm_runtime_set_autosuspend_delay(q->dev, -1); in blk_pm_runtime_init()
36 pm_runtime_use_autosuspend(q->dev); in blk_pm_runtime_init()
61 int blk_pre_runtime_suspend(struct request_queue *q) in blk_pre_runtime_suspend() argument
65 if (!q->dev) in blk_pre_runtime_suspend()
68 WARN_ON_ONCE(q->rpm_status != RPM_ACTIVE); in blk_pre_runtime_suspend()
70 spin_lock_irq(&q->queue_lock); in blk_pre_runtime_suspend()
71 q->rpm_status = RPM_SUSPENDING; in blk_pre_runtime_suspend()
72 spin_unlock_irq(&q->queue_lock); in blk_pre_runtime_suspend()
80 blk_set_pm_only(q); in blk_pre_runtime_suspend()
83 blk_freeze_queue_start(q); in blk_pre_runtime_suspend()
90 percpu_ref_switch_to_atomic_sync(&q->q_usage_counter); in blk_pre_runtime_suspend()
91 if (percpu_ref_is_zero(&q->q_usage_counter)) in blk_pre_runtime_suspend()
94 blk_mq_unfreeze_queue(q); in blk_pre_runtime_suspend()
97 spin_lock_irq(&q->queue_lock); in blk_pre_runtime_suspend()
98 q->rpm_status = RPM_ACTIVE; in blk_pre_runtime_suspend()
99 pm_runtime_mark_last_busy(q->dev); in blk_pre_runtime_suspend()
100 spin_unlock_irq(&q->queue_lock); in blk_pre_runtime_suspend()
102 blk_clear_pm_only(q); in blk_pre_runtime_suspend()
122 void blk_post_runtime_suspend(struct request_queue *q, int err) in blk_post_runtime_suspend() argument
124 if (!q->dev) in blk_post_runtime_suspend()
127 spin_lock_irq(&q->queue_lock); in blk_post_runtime_suspend()
129 q->rpm_status = RPM_SUSPENDED; in blk_post_runtime_suspend()
131 q->rpm_status = RPM_ACTIVE; in blk_post_runtime_suspend()
132 pm_runtime_mark_last_busy(q->dev); in blk_post_runtime_suspend()
134 spin_unlock_irq(&q->queue_lock); in blk_post_runtime_suspend()
137 blk_clear_pm_only(q); in blk_post_runtime_suspend()
152 void blk_pre_runtime_resume(struct request_queue *q) in blk_pre_runtime_resume() argument
154 if (!q->dev) in blk_pre_runtime_resume()
157 spin_lock_irq(&q->queue_lock); in blk_pre_runtime_resume()
158 q->rpm_status = RPM_RESUMING; in blk_pre_runtime_resume()
159 spin_unlock_irq(&q->queue_lock); in blk_pre_runtime_resume()
176 void blk_post_runtime_resume(struct request_queue *q, int err) in blk_post_runtime_resume() argument
178 if (!q->dev) in blk_post_runtime_resume()
181 blk_set_runtime_active(q); in blk_post_runtime_resume()
183 spin_lock_irq(&q->queue_lock); in blk_post_runtime_resume()
184 q->rpm_status = RPM_SUSPENDED; in blk_post_runtime_resume()
185 spin_unlock_irq(&q->queue_lock); in blk_post_runtime_resume()
207 void blk_set_runtime_active(struct request_queue *q) in blk_set_runtime_active() argument
211 if (!q->dev) in blk_set_runtime_active()
214 spin_lock_irq(&q->queue_lock); in blk_set_runtime_active()
215 old_status = q->rpm_status; in blk_set_runtime_active()
216 q->rpm_status = RPM_ACTIVE; in blk_set_runtime_active()
217 pm_runtime_mark_last_busy(q->dev); in blk_set_runtime_active()
218 pm_request_autosuspend(q->dev); in blk_set_runtime_active()
219 spin_unlock_irq(&q->queue_lock); in blk_set_runtime_active()
222 blk_clear_pm_only(q); in blk_set_runtime_active()