From: Peter Wang <peter.wang@mediatek.com>
To: Stanley Jhu <stanleyjhu@google.com>,
"Martin K . Petersen" <mkp@kernel.org>,
"James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
Alim Akhtar <alim.akhtar@samsung.com>,
Bart Van Assche <bvanassche@acm.org>,
Bean Huo <beanhuo@micron.com>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
Praveen Talari <praveen.talari@oss.qualcomm.com>,
Can Guo <can.guo@oss.qualcomm.com>,
"John Garry" <john.garry@linux.dev>, <linux-scsi@vger.kernel.org>,
<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<stable@vger.kernel.org>
Subject: Re: [PATCH] scsi: ufs: core: Keep clock-gating hold on failed W-LUN runtime resume
Date: Wed, 4 Nov 2026 11:57:00 +0800 [thread overview]
Message-ID: <95b5f05492597bc140256d87a7a3e0a29b057b59.camel@mediatek.com> (raw)
In-Reply-To: <20261029040002.2100002-1-stanleyjhu@google.com>
On Thu, 2026-10-29 at 15:08 +0800, Stanley Jhu wrote:
> 1. __ufshcd_wl_suspend() takes one ufshcd_hold() reference and sets
> hba->clk_gating.is_suspended while the UFS device W-LUN enters
> RPM_SUSPENDED.
> 2. Since commit eef1d74bf88f ("PM: runtime: Only set runtime_error on
> suspend callback failures"), a failed runtime resume (for example
> START STOP UNIT completing with an error) leaves the W-LUN in
> RPM_SUSPENDED with power.runtime_error == 0, while
> __ufshcd_wl_resume() already clears hba->clk_gating.is_suspended
> and
> calls ufshcd_release().
> 3. The next W-LUN runtime resume runs __ufshcd_wl_resume() again
> without
> an intervening suspend and calls ufshcd_release() a second time,
> dropping a reference it does not own and underflowing
> hba->clk_gating.active_reqs on UFSHCD_CAP_CLK_GATING hosts.
>
> Keep hba->clk_gating.is_suspended and the suspend hold across a
> failed
> W-LUN runtime resume, so the hold stays paired with the W-LUN
> RPM_SUSPENDED state and the next successful resume releases it.
>
> Fixes: eef1d74bf88f ("PM: runtime: Only set runtime_error on suspend
> callback failures")
> Cc: stable@vger.kernel.org # v7.3+
> Signed-off-by: Stanley Jhu <stanleyjhu@google.com>
> ---
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
next prev parent reply other threads:[~2026-11-04 3:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 7:08 Stanley Jhu
2026-11-03 19:43 ` Brian Norris
2026-11-04 3:57 ` Peter Wang [this message]
2026-11-04 4:01 ` Martin K. Petersen
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=95b5f05492597bc140256d87a7a3e0a29b057b59.camel@mediatek.com \
--to=peter.wang@mediatek.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=john.garry@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mkp@kernel.org \
--cc=praveen.talari@oss.qualcomm.com \
--cc=rafael@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®