From: Bean Huo <huobean@gmail.com>
To: Seunghui Lee <sh043.lee@samsung.com>,
alim.akhtar@samsung.com, avri.altman@wdc.com,
bvanassche@acm.org, James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
sdriver.sec@samsung.com
Subject: Re: [PATCH] ufs: core: Use link recovery when the h8 exit failure during runtime resume
Date: Wed, 16 Jul 2025 15:35:27 +0200 [thread overview]
Message-ID: <ff93d49524dd1b79968b690753a3727e695f852d.camel@gmail.com> (raw)
In-Reply-To: <00f301dbf626$2b2a1550$817e3ff0$@samsung.com>
On Wed, 2025-07-16 at 16:49 +0900, Seunghui Lee wrote:
> > -----Original Message-----
> > From: Seunghui Lee <sh043.lee@samsung.com>
> > Sent: Wednesday, July 16, 2025 4:01 PM
> > To: 'Bean Huo' <huobean@gmail.com>; alim.akhtar@samsung.com;
> > avri.altman@wdc.com; bvanassche@acm.org;
> > James.Bottomley@HansenPartnership.com; martin.petersen@oracle.com; linux-
> > scsi@vger.kernel.org; sdriver.sec@samsung.com
> > Subject: RE: [PATCH] ufs: core: Use link recovery when the h8 exit failure
> > during runtime resume
> >
> > > -----Original Message-----
> > > From: Bean Huo <huobean@gmail.com>
> > > Sent: Wednesday, July 16, 2025 12:22 AM
> > > To: 이승희 <sh043.lee@samsung.com>; alim.akhtar@samsung.com;
> > > avri.altman@wdc.com; bvanassche@acm.org;
> > > James.Bottomley@HansenPartnership.com; martin.petersen@oracle.com;
> > > linux- scsi@vger.kernel.org; sdriver.sec@samsung.com
> > > Subject: Re: [PATCH] ufs: core: Use link recovery when the h8 exit
> > > failure during runtime resume
> > >
> > >
> > > You patched ufshcd_runtime_suspend() to return -EBUSY if
> > > eh_in_progress is true — meant to avoid suspend during error handling.
> > > I don't understand why here parent is not active?
> >
> > After checking the RPM devices, I found that the parent device is
> > suspended due to the failure of ufshcd_wl_runtime_resume.
> > Even if we guarantee both the completion of ufshcd_runtime_suspend and the
> > error handling completion to avoid races, ufshcd_recover_pm_error can't
> > fully recover from a runtime pm failure scenario.
> >
> > >
> > > would like to try return -EAGAIN?
> > >
> > >
> > > Kind regards,
> > > Bean
> > >
> >
> > I've tried that as well, but it doesn't work either.
> > [ 328.915154] [0: kworker/u32:7: 941] ufs_device_wlun 0:0:0:49488:
> > runtime PM trying to activate child device 0:0:0:49488 but parent
> > (target0:0:0) is not active [ 328.915156] [0: kworker/u32:7: 941]
> > ufs_device_wlun 0:0:0:49488: ufshcd_recover_pm_error: rpm set_active ret(-
> > 16) [ 328.915157] [0: kworker/u32:7: 941] ufshcd-qcom 1d84000.ufshc:
> > ufshcd_recover_pm_error: rpm set_active ret(-11) Due to this error,
> > pm_request_resume(q->dev) for each scsi device can't execute.
> > This causes the I/O stack to become stuck.
> >
> > This issue arises from the race condition between the runtime pm worker
> > and the error handler worker.
> > I believe it would be safer to handle recovery within the runtime pm
> > worker itself.
> >
> > For reference, ufshcd_link_recovery is useful for the similar issue.
> > (resolving the race condition between the runtime pm worker and the SCSI
> > error handler worker) https://patchwork.kernel.org/project/linux-
> > scsi/patch/20230927033557.13801-1-peter.wang@mediatek.com/
> >
> > I'll add Fixes tags and modify v2 as requested.
> >
> > Thank you,
> > Seunghui Lee.
> >
>
> I would love to find the previous tag, but it's old code.
> And plus, it's hard to pick one commit for Fixes.
> Please understand this.
>
> If this commit is okay, please review this commit.
>
> Thank you,
> Seunghui Lee.
Based on my analysis, the tag might be:
commit 4db7a2360597 ("scsi: ufs: Fix concurrency of error handler and other error recovery paths"),
This commit added the error handling logic that calls ufshcd_set_link_broken() and ufshcd_schedule_eh_work()
when ret is non-zero in the ufshcd_uic_pwr_ctrl() function.
your patch adds a check for pm_op_in_progress to skip the error handler and use link recovery instead during PM operations.
Therefore, the appropriate Fixes tag for your patch would be:
Fixes: 4db7a2360597 ("scsi: ufs: Fix concurrency of error handler and other error recovery paths")
But, the problem is dd11376b9f1b ("scsi: ufs: Split the drivers/scsi/ufs directory") reorganzied the UFS code layout,
it is true that not easy to add a proper tag,
Or we can use both fix tags, or just the last one.
Let Bart comment on this,
Kind regards,
Bean
next prev parent reply other threads:[~2025-07-16 13:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250714090630epcas1p28ab8afec11bbab4d256dfe6649d3b00b@epcas1p2.samsung.com>
2025-07-14 9:06 ` [PATCH] ufs: core: Use link recovery when the h8 exit failure during runtime resume Seunghui Lee
2025-07-14 11:21 ` Bean Huo
2025-07-15 2:23 ` 이승희
2025-07-15 12:47 ` Bean Huo
2025-07-15 15:21 ` Bean Huo
2025-07-16 7:01 ` Seunghui Lee
2025-07-16 7:49 ` Seunghui Lee
2025-07-16 13:35 ` Bean Huo [this message]
2025-07-16 15:02 ` Bart Van Assche
2025-07-17 6:12 ` Seunghui Lee
2025-07-16 15:14 ` Bart Van Assche
2025-07-17 6:01 ` Seunghui Lee
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=ff93d49524dd1b79968b690753a3727e695f852d.camel@gmail.com \
--to=huobean@gmail.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=bvanassche@acm.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sdriver.sec@samsung.com \
--cc=sh043.lee@samsung.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;
as well as URLs for NNTP newsgroup(s).