mirror of https://lore.kernel.org/lkml/
 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 v4] scsi: ufs: core: handle PM commands timeout before SCSI EH
Date: Wed, 3 Jun 2026 05:16:52 +0000	[thread overview]
Message-ID: <3007575a0de64bdf8577cf3b1abafbea@exch02.asrmicro.com> (raw)
In-Reply-To: <3f210420-ccfe-4cc4-87aa-8d810d580aa0@acm.org>


> From: Bart Van Assche [mailto:bvanassche@acm.org]
> Sent: Wednesday, June 3, 2026 1:32 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 v4] scsi: ufs: core: handle PM commands timeout before
> SCSI EH
> 
> On 6/2/26 5:41 AM, Hongjie Fang wrote:
> > -	return scsi_host_busy(hba->host) ? SCSI_EH_RESET_TIMER :
> SCSI_EH_DONE;
> > +	/*
> > +	 * ufshcd_link_recovery() may already have completed @scmd, e.g.
> via
> > +	 * the existing MCQ force-completion path.
> > +	 */
> > +	if (!test_bit(SCMD_STATE_COMPLETE, &scmd->state)) {
> 
> The above test can be left out if scsi_done() would be called before
> ufshcd_link_recovery(), isn't it? Otherwise this patch looks good to me.

I think scsi_done() has to stay after ufshcd_link_recovery().
The reason is that scsi_done() wakes the blk_execute_rq()/scsi_execute_cmd()
waiter. If that happens before link recovery finishes, scsi_check_passthrough()
may retry the PM command while the host is still in recovery / reset state,
which would bring back the original retry-vs-recovery race this patch is
trying to avoid.



Best.

  reply	other threads:[~2026-06-03  5:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02 12:41 Hongjie Fang
2026-06-02 17:31 ` Bart Van Assche
2026-06-03  5:16   ` Fang Hongjie(方洪杰) [this message]
2026-06-03  6:55 ` Peter Wang (王信友)
     [not found]   ` <5c2f95f00b484bca9c5df97219230acc@exch02.asrmicro.com>
2026-06-03 11:08     ` Fang Hongjie(方洪杰)
2026-06-04  5:39       ` Peter Wang (王信友)
     [not found]         ` <f2a49399526f44a2a3f94c90229330ea@exch02.asrmicro.com>
2026-06-04 15:24           ` Fang Hongjie(方洪杰)
2026-06-03 16:21 ` Bart Van Assche

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=3007575a0de64bdf8577cf3b1abafbea@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

all inboxes | Powered by JetHome®