From: "hoyoung seo" <hy50.seo@samsung.com>
To: "'Bart Van Assche'" <bvanassche@acm.org>,
<linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<mkp@kernel.org>, <martin.petersen@oracle.com>,
<stanleyjhu@google.com>, <alim.akhtar@samsung.com>,
<kwangwon.min@samsung.com>, <kwmad.kim@samsung.com>,
<cpgs@samsung.com>, <h10.kim@samsung.com>
Subject: RE: [PATCH v3 0/2] scsi: ufs: core: Avoid redundant link recovery during system resume
Date: Thu, 5 Nov 2026 13:15:52 +0900 [thread overview]
Message-ID: <000001dd6cdc$58d12790$0a7376b0$@samsung.com> (raw)
In-Reply-To: <a291e852-9ca8-48ad-8c4b-bf5de057203d@acm.org>
Hi Bart,
Thank you for the review and for the report. I checked the points in the
report against the code and agree with them. I will send a v4 that
follows the suggested direction as far as I could verify it:
- Patch 1/2 is unchanged apart from a Fixes: tag.
- Patch 2/2 replaces the is_sys_suspended check. The early link
recovery in ufshcd_err_handler() is only taken while a runtime PM
operation is in progress. For system PM the error handler waits for
host_sem, and during shutdown it stops, so it no longer runs
concurrently with __ufshcd_wl_resume(), ufs_mtk_resume(), system
suspend or shutdown. This needs a new field,
hba->runtime_pm_in_progress, because pm_op_in_progress does not tell
which PM operation is running.
I kept the early link recovery for runtime resume as well, not only for
runtime suspend. The comment added by commit e23ef4f22db3 and commit
35dabf4503b9 describe a deadlock when the error handler runs during
runtime resume, and I could not confirm that the regular path, which
waits in ufshcd_err_handling_prepare(), is safe there. As a result the
race with __ufshcd_wl_resume() during runtime resume is not removed.
Do you think the early path can be dropped for runtime resume as well,
e.g. after commit 01d5e237b339?
For the remaining early path in runtime PM I did not add a check of
ufshcd_err_handling_should_stop() before the link recovery. I can send
it as a separate patch if you think it is needed.
I also did not add a mutex around ufshcd_link_recovery(). It calls
ufshcd_probe_hba(), and if a device command times out there,
ufshcd_eh_timed_out() calls ufshcd_link_recovery() again from the
timeout context while the first call waits for that command. A mutex
would turn this into a deadlock, so I would like to avoid it unless you
see a way around that.
Thanks,
Hoyoung
> -----Original Message-----
> From: Bart Van Assche <bvanassche@acm.org>
> Sent: Wednesday, November 4, 2026 3:25 AM
> 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; alim.akhtar@samsung.com; kwangwon.min@samsung.com;
> kwmad.kim@samsung.com; cpgs@samsung.com; h10.kim@samsung.com
> Subject: Re: [PATCH v3 0/2] scsi: ufs: core: Avoid redundant link recovery
> during system resume
>
> On 11/3/26 1:33 AM, HOYOUNG SEO wrote:
> > Any review or comment would be appreciated, especially on 2/2 and the
> > system PM vs. runtime PM difference.
>
> Please take a look at the attached review report from an LLM. According to
> that review this series isn't ready yet for integration in the upstream
> kernel.
>
> Thanks,
>
> Bart.
prev parent reply other threads:[~2026-11-05 4:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20261026044138epcas2p19feb1c8130a1c07b67b1f27eefb1c300@epcas2p1.samsung.com>
2026-10-26 4:37 ` HOYOUNG SEO
[not found] ` <CGME20261026044139epcas2p3a5b55ec93b313eeb9a38bbf0c93cf889@epcas2p3.samsung.com>
2026-10-26 4:37 ` [PATCH v3 1/2] scsi: ufs: core: Clear saved errors in ufshcd_link_recovery HOYOUNG SEO
[not found] ` <CGME20261026044140epcas2p3e83872a5701a30853937a40e16511e49@epcas2p3.samsung.com>
2026-10-26 4:37 ` [PATCH v3 2/2] scsi: ufs: core: add is_sys_suspended state before recovery HOYOUNG SEO
[not found] ` <CGME20261103093825epcas2p3d741e7c61c82ea89cbd63299b853732d@epcas2p3.samsung.com>
2026-11-03 9:33 ` [PATCH v3 0/2] scsi: ufs: core: Avoid redundant link recovery during system resume HOYOUNG SEO
2026-11-03 18:25 ` Bart Van Assche
2026-11-05 4:15 ` hoyoung seo [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='000001dd6cdc$58d12790$0a7376b0$@samsung.com' \
--to=hy50.seo@samsung.com \
--cc=alim.akhtar@samsung.com \
--cc=bvanassche@acm.org \
--cc=cpgs@samsung.com \
--cc=h10.kim@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=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®