From: Bart Van Assche <bvanassche@acm.org>
To: 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, cpgsproxy1@samsung.com,
h10.kim@samsung.com
Subject: Re: [PATCH v9 3/3] scsi: ufs: core: Limit early link recovery in the error handler to runtime PM
Date: Tue, 10 Nov 2026 09:54:08 -0800 [thread overview]
Message-ID: <d3e3ee33-0324-40fb-bca9-137cab1a818d@acm.org> (raw)
In-Reply-To: <2052256418.81794277203434.JavaMail.epsvc@epcpadp1new>
On 11/9/26 6:03 PM, HOYOUNG SEO wrote:
> +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 hba->pm_op_in_progress &&
> + (status == RPM_SUSPENDING || status == RPM_RESUMING);
hba->pm_op_in_progress is modified by __ufshcd_wl_suspend() and
__ufshcd_wl_resume() without holding any lock. Please use READ_ONCE()
here and WRITE_ONCE() in the functions that modify this member, or at
least make the patch description consistent with the code ("Both
values are read without locking" while only one of the two reads uses
READ_ONCE()).
Additionally, since this function has only one caller, please make it
a static function in ufshcd.c instead of adding it to ufshcd-priv.h. A
name that makes it clear that this function checks whether a runtime
PM callback of the WLUN is in progress, e.g.
ufshcd_in_wl_rpm_callback(), would be more accurate.
Otherwise this patch looks good to me. Please note that the
correctness of this patch depends on patch 2/3, which needs to be
revised.
Thanks,
Bart.
prev parent reply other threads:[~2026-11-10 17:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1794275305.git.hy50.seo@samsung.com>
[not found] ` <CGME20261110020746epcas2p2ed2c3b150d2ecbf810658264841e790e@epcas2p2.samsung.com>
2026-11-10 2:03 ` [PATCH v9 1/3] scsi: ufs: core: Clear saved errors in ufshcd_link_recovery() HOYOUNG SEO
[not found] ` <CGME20261110020747epcas2p20410190486c9b48b4b2a4e9d8a4c2292@epcas2p2.samsung.com>
2026-11-10 2:03 ` [PATCH v9 2/3] scsi: ufs: core: Hold host_sem in ufshcd_wl_poweroff() HOYOUNG SEO
2026-11-10 5:50 ` Peter Wang
2026-11-10 17:53 ` Bart Van Assche
[not found] ` <CGME20261110020748epcas2p25076a34f183116ca4d8714dacf214958@epcas2p2.samsung.com>
2026-11-10 2:03 ` [PATCH v9 3/3] scsi: ufs: core: Limit early link recovery in the error handler to runtime PM HOYOUNG SEO
2026-11-10 5:51 ` Peter Wang
2026-11-10 17:54 ` 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=d3e3ee33-0324-40fb-bca9-137cab1a818d@acm.org \
--to=bvanassche@acm.org \
--cc=alim.akhtar@samsung.com \
--cc=cpgsproxy1@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®