diff options
author | Bart Van Assche <[email protected]> | 2020-12-08 21:29:44 -0800 |
---|---|---|
committer | Martin K. Petersen <[email protected]> | 2020-12-09 11:41:41 -0500 |
commit | fa4d0f1992a96f6d7c988ef423e3127e613f6ac9 (patch) | |
tree | b784a47d8ba80c48b4fbe1e463e0eab14248b077 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | dd78bdb6f810bdcb173b42379af558c676c8e0aa (diff) |
scsi: block: Fix a race in the runtime power management code
With the current implementation the following race can happen:
* blk_pre_runtime_suspend() calls blk_freeze_queue_start() and
blk_mq_unfreeze_queue().
* blk_queue_enter() calls blk_queue_pm_only() and that function returns
true.
* blk_queue_enter() calls blk_pm_request_resume() and that function does
not call pm_request_resume() because the queue runtime status is
RPM_ACTIVE.
* blk_pre_runtime_suspend() changes the queue status into RPM_SUSPENDING.
Fix this race by changing the queue runtime status into RPM_SUSPENDING
before switching q_usage_counter to atomic mode.
Link: https://lore.kernel.org/r/[email protected]
Fixes: 986d413b7c15 ("blk-mq: Enable support for runtime power management")
Cc: Ming Lei <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
Cc: stable <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Jens Axboe <[email protected]>
Acked-by: Alan Stern <[email protected]>
Acked-by: Stanley Chu <[email protected]>
Co-developed-by: Can Guo <[email protected]>
Signed-off-by: Can Guo <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions