From: Bart Van Assche <bvanassche@acm.org>
To: Bean Huo <beanhuo@iokpp.de>, HOYOUNG SEO <hy50.seo@samsung.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
mkp@kernel.org, martin.petersen@oracle.com,
stanleyjhu@google.com, peter.wang@mediatek.com,
alim.akhtar@samsung.com, kwangwon.min@samsung.com,
kwmad.kim@samsung.com, cpgs@samsung.com, h10.kim@samsung.com
Subject: Re: [PATCH v8 3/3] scsi: ufs: core: Limit early link recovery in the error handler to runtime PM
Date: Mon, 9 Nov 2026 10:20:45 -0800 [thread overview]
Message-ID: <3f0a4464-842f-4ceb-8f57-d88f8898ecc4@acm.org> (raw)
In-Reply-To: <26fb0dedfe5348270bf38c8f7ced1d49f1103d0a.camel@iokpp.de>
On 11/9/26 9:08 AM, Bean Huo wrote:
> On Mon, 2026-11-09 at 13:09 +0900, HOYOUNG SEO wrote:
>> diff --git a/drivers/ufs/core/ufshcd-priv.h
b/drivers/ufs/core/ufshcd-priv.h
>> index e55c2a02c1f5..ae3eaf5ab017 100644
>> --- a/drivers/ufs/core/ufshcd-priv.h
>> +++ b/drivers/ufs/core/ufshcd-priv.h
>> @@ -413,6 +413,19 @@ static inline void ufshcd_rpm_put(struct
ufs_hba *hba)
>> pm_runtime_put(&hba->ufs_device_wlun->sdev_gendev);
>> }
>>
>> +/* Whether a runtime suspend or resume of the WLUN is in progress. */
>> +static inline bool ufshcd_rpm_transition_in_progress(struct ufs_hba
*hba)
>> +{
>> +#ifdef CONFIG_PM
>> + enum rpm_status status =
>> + READ_ONCE(hba->ufs_device_wlun->sdev_gendev.power.runtime_status);
>> +
>> + return status == RPM_SUSPENDING || status == RPM_RESUMING;
>
> should the helper also check pm_op_in_progress?
>
> return hba->pm_op_in_progress && (status == RPM_SUSPENDING || status ==
> RPM_RESUMING);
>
> checking (status == RPM_SUSPENDING || status == RPM_RESUMING) fixes
for system
> PM;
>
> Checking pm_op_in_progress limits the early path to
__ufshcd_wl_suspend() and
> __ufshcd_wl_resume() during runtime PM, it was before this patch.
>
> Or what else I missed?
Good catch. The runtime PM core sets runtime_status to RPM_SUSPENDING
before calling the device's runtime suspend callback (and before
ufshcd_hold() is called), and keeps it set until after
blk_post_runtime_suspend() (after ufshcd_release() has been called).
Checking both hba->pm_op_in_progress and the WLUN runtime_status ensures
the early recovery path only runs while __ufshcd_wl_suspend() or
__ufshcd_wl_resume() is actively running and clocks are held.
Hoyoung, please include the pm_op_in_progress check in the helper or at
the call site in v9.
Thanks,
Bart.
prev parent reply other threads:[~2026-11-09 18:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1794196863.git.hy50.seo@samsung.com>
[not found] ` <CGME20261109041346epcas2p403d660b62bc9f227fef868e8b19816af@epcas2p4.samsung.com>
2026-11-09 4:09 ` [PATCH v8 1/3] scsi: ufs: core: Clear saved errors in ufshcd_link_recovery() HOYOUNG SEO
2026-11-09 15:28 ` Bean Huo
[not found] ` <CGME20261109041347epcas2p17b5c0fd7b693f92eb2af35b12a24de31@epcas2p1.samsung.com>
2026-11-09 4:09 ` [PATCH v8 2/3] scsi: ufs: core: Hold host_sem in ufshcd_wl_poweroff() HOYOUNG SEO
2026-11-09 9:34 ` Peter Wang
2026-11-09 18:19 ` Bart Van Assche
[not found] ` <CGME20261109041348epcas2p1a8518c19bea8a58c57e8538809d2a947@epcas2p1.samsung.com>
2026-11-09 4:09 ` [PATCH v8 3/3] scsi: ufs: core: Limit early link recovery in the error handler to runtime PM HOYOUNG SEO
2026-11-09 9:32 ` Peter Wang
2026-11-09 17:08 ` Bean Huo
2026-11-09 18:20 ` 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=3f0a4464-842f-4ceb-8f57-d88f8898ecc4@acm.org \
--to=bvanassche@acm.org \
--cc=alim.akhtar@samsung.com \
--cc=beanhuo@iokpp.de \
--cc=cpgs@samsung.com \
--cc=h10.kim@samsung.com \
--cc=hy50.seo@samsung.com \
--cc=kwangwon.min@samsung.com \
--cc=kwmad.kim@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mkp@kernel.org \
--cc=peter.wang@mediatek.com \
--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®