Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, Roger Shimizu <rosh@debian.org>,
	Nitin Rawat <nitin.rawat@oss.qualcomm.com>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	Peter Wang <peter.wang@mediatek.com>,
	Avri Altman <avri.altman@sandisk.com>,
	Bean Huo <beanhuo@micron.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	"Bao D. Nguyen" <quic_nguyenb@quicinc.com>
Subject: Re: [PATCH] ufs: core: Fix a deadlock in the frequency scaling code
Date: Tue, 9 Dec 2025 09:51:13 -0800	[thread overview]
Message-ID: <d6eaf149-a3c8-44d2-bab0-4e7c965e3ebc@acm.org> (raw)
In-Reply-To: <cem2gv6cz6bxz3i7eogqnbruzbts5jn4ijlu43bt5g2rl5or5p@evrj4kyqovrk>

On 12/9/25 3:33 AM, Manivannan Sadhasivam wrote:
> Thanks for the quirk fix. While it seems to have fixed the boot hang, I'm
> quite skeptical about the fix. What is the guarantee that another device
> management command won't be submitted before blk_mq_unquiesce_tagset() in the
> future? IOW, the developer would have no idea that doing such will result in a
> deadlock as nothing in the UFS code makes it clear, like using the same lock and
> such.
I think that the recent changes can be considered as a bug fix. With 
previous kernel versions, only SCSI commands were paused during clock
frequency transitions but device management commands not. With the
approach that landed in Linus' master branch, device management commands
are also paused during clock frequency transitions. Device management
commands should also be paused because these also use the communication
link between host controller and UFS device.

Regarding debugging potential future deadlocks caused by submitting a
device management command while the tag set is quiesced, a call trace
is sufficient to discover the root cause (echo w > /proc/sysrq-trigger).

Regarding future changes in ufshcd_clock_scaling_unprepare(), I think
there are two cases: changes made by developers who have access to a
test setup that supports frequency scaling and changes made by
developers who don't have access to a test setup that supports frequency
scaling. Has it already been considered to insert calls to
ufshcd_clock_scaling_prepare() and ufshcd_clock_scaling_unprepare() near
the end of ufshcd_async_scan() to make sure that this code gets executed
on test setups that do not support frequency scaling?

Thanks,

Bart.

      reply	other threads:[~2025-12-09 17:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-04 18:15 [PATCH] ufs: core: Fix a deadlock in the frequency scaling code Bart Van Assche
2025-12-05  8:32 ` Peter Wang (王信友)
2025-12-06 15:07 ` Nitin Rawat
2025-12-07 21:48 ` Alexey Klimov
2025-12-09  2:59 ` Martin K. Petersen
2025-12-09 11:33 ` Manivannan Sadhasivam
2025-12-09 17:51   ` Bart Van Assche [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=d6eaf149-a3c8-44d2-bab0-4e7c965e3ebc@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=adrian.hunter@intel.com \
    --cc=avri.altman@sandisk.com \
    --cc=beanhuo@micron.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=nitin.rawat@oss.qualcomm.com \
    --cc=peter.wang@mediatek.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=rosh@debian.org \
    /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