mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Wang <peter.wang@mediatek.com>
To: Joonhoe Kim <26rote@gmail.com>,
	<James.Bottomley@HansenPartnership.com>, <mkp@kernel.org>
Cc: <alim.akhtar@samsung.com>, <bvanassche@acm.org>,
	<beanhuo@micron.com>, <stanleyjhu@google.com>,
	<can.guo@oss.qualcomm.com>, <mani@kernel.org>,
	<linux-scsi@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH] scsi: ufs: core: Fix a deadlock between clock scaling and device commands
Date: Mon, 19 Oct 2026 18:46:23 +0800	[thread overview]
Message-ID: <6d48b76c0df0db18e43ae637ab1fd79b48dc643d.camel@mediatek.com> (raw)
In-Reply-To: <20261016124608.46-1-26rote@gmail.com>

On Fri, 2026-10-16 at 21:46 +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.
> 
> 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>


      reply	other threads:[~2026-10-19 10:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 12:46 Joonhoe Kim
2026-10-19 10:46 ` Peter Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6d48b76c0df0db18e43ae637ab1fd79b48dc643d.camel@mediatek.com \
    --to=peter.wang@mediatek.com \
    --cc=26rote@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=can.guo@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=mkp@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stanleyjhu@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®