diff options
| author | Joonhoe Kim <26rote@gmail.com> | 2026-10-16 21:46:08 +0900 |
|---|---|---|
| committer | Martin K. Petersen (Oracle) <mkp@kernel.org> | 2026-10-23 22:41:56 -0400 |
| commit | 2327df6d2a290af62a6da21b2ad301848bb86002 (patch) | |
| tree | d5c16dabd1883bf2053acee879b8e8b0bd3792fb /tools/lib/python | |
| parent | 1b39bd7b8279c1c5d4f6c39fab260bd5fc31133e (diff) | |
scsi: ufs: core: Fix a deadlock between clock scaling and device commands
Since commit 08b12cda6c44 ("scsi: ufs: core: Switch to
scsi_get_internal_cmd()"), device management commands go through
blk_execute_rq() on the pseudo SCSI device, which shares the tagset with
the logical units, while ufshcd_dev_man_lock() holds clk_scaling_lock for
reading.
ufshcd_clock_scaling_prepare() and ufshcd_pause_command_processing()
quiesce the tagset before taking clk_scaling_lock for writing. A device
management command holding the lock for reading at that point is never
dispatched and never times out, so the writer waits forever with all
logical units quiesced. On a Lenovo Legion Tab Y700 Gen 5 this ended in a
hung task panic.
Take clk_scaling_lock before quiescing the tagset, and in
ufshcd_clock_scaling_prepare() also wb_mutex, which is always taken before
clk_scaling_lock. Release them in the reverse order. Commit b52d695d0620
("scsi: ufs: core: Keep internal commands dispatchable during error
handling") fixed the same problem in the error handler.
Fixes: 08b12cda6c44 ("scsi: ufs: core: Switch to scsi_get_internal_cmd()")
Fixes: dc5dcac53278 ("scsi: ufs: core: Add helpers to pause and resume command processing")
Cc: stable@vger.kernel.org
Signed-off-by: Joonhoe Kim <26rote@gmail.com>
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Link: https://patch.msgid.link/20261016124608.46-1-26rote@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
