Re: [PATCH] scsi: ufs: core: Fix a deadlock between clock scaling and device commands

From: Martin K. Petersen (Oracle)

Date: Wed Oct 28 2026 - 22:04:04 EST


On Fri, 16 Oct 2026 21:46:08 +0900, Joonhoe Kim wrote:

> 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.
>
> [...]

Applied to 7.4/scsi-queue, thanks!

[1/1] scsi: ufs: core: Fix a deadlock between clock scaling and device commands
https://git.kernel.org/mkp/scsi/c/2327df6d2a29

--
Martin K. Petersen