public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Peter Wang (王信友)" <peter.wang@mediatek.com>
To: "bvanassche@acm.org" <bvanassche@acm.org>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "avri.altman@wdc.com" <avri.altman@wdc.com>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	Sanjeev Y <Sanjeev.Y@mediatek.com>,
	"santoshsy@gmail.com" <santoshsy@gmail.com>,
	"quic_nguyenb@quicinc.com" <quic_nguyenb@quicinc.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	"manivannan.sadhasivam@linaro.org"
	<manivannan.sadhasivam@linaro.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>
Subject: Re: [PATCH] scsi: core: ufs: Fix a hang in the error handler
Date: Wed, 28 May 2025 08:32:32 +0000	[thread overview]
Message-ID: <32f45a00d5c1cdf26f91bde4821fe73d5b06dadc.camel@mediatek.com> (raw)
In-Reply-To: <ecfd1748-d257-48ae-808e-c672ac2f1536@acm.org>

On Tue, 2025-05-27 at 15:01 -0700, Bart Van Assche wrote:
> 
> 
> Hi Peter,
> 
> I have not yet tried to perform a full root-cause analysis. I decided
> to share this patch since this issue has been observed not only by
> the
> author of the above patch but also by my colleagues.
> 
> Regarding your question, are you referring to the
> ufshcd_link_recovery()
> call in ufshcd_eh_host_reset_handler()?
> ufshcd_eh_host_reset_handler()
> is not the only function that can trigger the UFS error handler.
> There
> are several ufshcd_schedule_eh_work() calls outside the
> ufshcd_eh_host_reset_handler() function.
> 
> Bart.


Hi Bart,


Yes, in my opinion, if an error occurs during runtime suspend,
it can trigger ufshcd_err_handler and then directly return busy 
to break this suspend attempt.
But for a runtime resume error, can only use ufshcd_link_recovery; 
otherwise, ufshcd_err_handler will still get stuck waiting 
for runtime PM to become active.
The previous patch was specifically for this resume case.
https://patchwork.kernel.org/project/linux-scsi/patch/20230927033557.13801-1-peter.wang@mediatek.com/

And for this patch, I feel that it's like what you mentioned, other 
functions triggered the UFS error handler, such as a UIC error. 
Since the SSU can be sent normally, it means it's an error that 
the hardware can recover from automatically. After the hardware 
automatically recovers, there's no issue during the runtime 
suspend process, and the suspend isn't break.
Or, if there's no issue during the runtime resume process, 
ufshcd_link_recovery isn't used directly either.

But this kind of patch assumes that the hardware can recover 
automatically. If the hardware can't recover, ufshcd_err_handler 
might still get stuck waiting for PM resume.
In other words, this patch solves part of the problem, but it may 
not be able to address all issues that occur during suspend/resume.
However, before we can identify the root cause, it seems there 
isn't a better solution for now. What do you think?

Thanks.
Peter


  reply	other threads:[~2025-05-28  8:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-23 20:14 [PATCH] scsi: core: ufs: Fix a hang in the error handler Bart Van Assche
2025-05-26 13:21 ` Peter Wang (王信友)
2025-05-27 22:01   ` Bart Van Assche
2025-05-28  8:32     ` Peter Wang (王信友) [this message]
2025-05-28 15:43       ` Bart Van Assche
2025-05-29  9:43         ` Peter Wang (王信友)
2025-06-04  2:00 ` 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=32f45a00d5c1cdf26f91bde4821fe73d5b06dadc.camel@mediatek.com \
    --to=peter.wang@mediatek.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=Sanjeev.Y@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=avri.altman@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=martin.petersen@oracle.com \
    --cc=matthias.bgg@gmail.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=santoshsy@gmail.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