Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: "Fang Hongjie(方洪杰)" <hongjiefang@asrmicro.com>
To: Bart Van Assche <bvanassche@acm.org>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"avri.altman@wdc.com" <avri.altman@wdc.com>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"peter.wang@mediatek.com" <peter.wang@mediatek.com>,
	"beanhuo@micron.com" <beanhuo@micron.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v3] scsi: ufs: core: handle PM SSU timeout before SCSI EH
Date: Tue, 2 Jun 2026 05:25:56 +0000	[thread overview]
Message-ID: <09e266caba584fc488029a6bcd951777@exch02.asrmicro.com> (raw)
In-Reply-To: <27613670-be13-4923-ae6a-f9a32f1a053b@acm.org>


> From: Bart Van Assche [mailto:bvanassche@acm.org]
> Sent: Tuesday, June 2, 2026 1:42 AM
> To: Fang Hongjie(方洪杰) <hongjiefang@asrmicro.com>;
> alim.akhtar@samsung.com; avri.altman@wdc.com;
> James.Bottomley@HansenPartnership.com; martin.petersen@oracle.com;
> peter.wang@mediatek.com; beanhuo@micron.com
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v3] scsi: ufs: core: handle PM SSU timeout before SCSI
> EH
> 
> On 5/31/26 9:56 PM, Hongjie Fang wrote:
> > @@ -9466,7 +9499,7 @@ static enum scsi_timeout_action
> ufshcd_eh_timed_out(struct scsi_cmnd *scmd)
> >   {
> >   	struct ufs_hba *hba = shost_priv(scmd->device->host);
> >
> > -	if (!hba->system_suspending) {
> > +	if (!hba->pm_op_in_progress || !ufshcd_is_scsi_cmd(scmd)) {
> >   		/* Activate the error handler in the SCSI core. */
> >   		return SCSI_EH_NOT_HANDLED;
> >   	}
> 
> I think we want to avoid SCSI error handler activation for all commands
> that time out while a power management operation is in progress,
> including device management commands.
> 
> Please consider completing commands from inside the timeout handler
> instead of adding force_compl support for the legacy single doorbell
> mode. The very lightly tested patch below should realize this.
> 

Thanks, this makes sense.
I will rework the patch in that direction for v4. It will use
hba->pm_op_in_progress for all PM timeout commands and no longer
relay on the extra legacy single-doorbell force-completion path.

For regular SCSI commands it releases the SCSI command resources before
scsi_done(). For internal device-management commands it only
completes the request, since those commands do not use the
ufshcd_release_scsi_cmd() lifetime rules.



Best.


      reply	other threads:[~2026-06-02  5:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-01  4:56 [PATCH v3] scsi: ufs: core: handle PM SSU timeout before SCSI EH Hongjie Fang
2026-06-01 10:06 ` Peter Wang (王信友)
     [not found]   ` <a8867cc460c44391bd942f0708cc2037@exch02.asrmicro.com>
2026-06-02  4:42     ` Fang Hongjie(方洪杰)
2026-06-01 17:42 ` Bart Van Assche
2026-06-02  5:25   ` Fang Hongjie(方洪杰) [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=09e266caba584fc488029a6bcd951777@exch02.asrmicro.com \
    --to=hongjiefang@asrmicro.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=peter.wang@mediatek.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