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()
76 blk_set_pm_only(q); in blk_pre_runtime_suspend()
79 blk_freeze_queue_start(q); in blk_pre_runtime_suspend()
86 percpu_ref_switch_to_atomic_sync(&q->q_usage_counter); in blk_pre_runtime_suspend()
87 if (percpu_ref_is_zero(&q->q_usage_counter)) in blk_pre_runtime_suspend()
90 blk_mq_unfreeze_queue(q); in blk_pre_runtime_suspend()
92 spin_lock_irq(&q->queue_lock); in blk_pre_runtime_suspend()
94 pm_runtime_mark_last_busy(q->dev); in blk_pre_runtime_suspend()
96 q->rpm_status = RPM_SUSPENDING; in blk_pre_runtime_suspend()
97 spin_unlock_irq(&q->queue_lock); in blk_pre_runtime_suspend()
100 blk_clear_pm_only(q); in blk_pre_runtime_suspend()
119 void blk_post_runtime_suspend(struct request_queue *q, int err) in blk_post_runtime_suspend() argument
121 if (!q->dev) in blk_post_runtime_suspend()
124 spin_lock_irq(&q->queue_lock); in blk_post_runtime_suspend()
126 q->rpm_status = RPM_SUSPENDED; in blk_post_runtime_suspend()
128 q->rpm_status = RPM_ACTIVE; in blk_post_runtime_suspend()
129 pm_runtime_mark_last_busy(q->dev); in blk_post_runtime_suspend()
131 spin_unlock_irq(&q->queue_lock); in blk_post_runtime_suspend()
134 blk_clear_pm_only(q); in blk_post_runtime_suspend()
149 void blk_pre_runtime_resume(struct request_queue *q) in blk_pre_runtime_resume() argument
151 if (!q->dev) in blk_pre_runtime_resume()
154 spin_lock_irq(&q->queue_lock); in blk_pre_runtime_resume()
155 q->rpm_status = RPM_RESUMING; in blk_pre_runtime_resume()
156 spin_unlock_irq(&q->queue_lock); in blk_pre_runtime_resume()
174 void blk_post_runtime_resume(struct request_queue *q, int err) in blk_post_runtime_resume() argument
176 if (!q->dev) in blk_post_runtime_resume()
179 spin_lock_irq(&q->queue_lock); in blk_post_runtime_resume()
181 q->rpm_status = RPM_ACTIVE; in blk_post_runtime_resume()
182 pm_runtime_mark_last_busy(q->dev); in blk_post_runtime_resume()
183 pm_request_autosuspend(q->dev); in blk_post_runtime_resume()
185 q->rpm_status = RPM_SUSPENDED; in blk_post_runtime_resume()
187 spin_unlock_irq(&q->queue_lock); in blk_post_runtime_resume()
190 blk_clear_pm_only(q); in blk_post_runtime_resume()
208 void blk_set_runtime_active(struct request_queue *q) in blk_set_runtime_active() argument
210 if (q->dev) { in blk_set_runtime_active()
211 spin_lock_irq(&q->queue_lock); in blk_set_runtime_active()
212 q->rpm_status = RPM_ACTIVE; in blk_set_runtime_active()
213 pm_runtime_mark_last_busy(q->dev); in blk_set_runtime_active()
214 pm_request_autosuspend(q->dev); in blk_set_runtime_active()
215 spin_unlock_irq(&q->queue_lock); in blk_set_runtime_active()