mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Peter Wang (王信友)" <peter.wang@mediatek.com>
To: "beanhuo@micron.com" <beanhuo@micron.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"hongjiefang@asrmicro.com" <hongjiefang@asrmicro.com>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"avri.altman@wdc.com" <avri.altman@wdc.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: Thu, 4 Jun 2026 05:39:48 +0000	[thread overview]
Message-ID: <9b00734a666a2b68a3a6dfb31ce78ffccc5c3686.camel@mediatek.com> (raw)
In-Reply-To: <27ad241130a34ece8d2645b687f6ffc7@exch02.asrmicro.com>

On Wed, 2026-06-03 at 11:08 +0000, Fang Hongjie(方洪杰) wrote:
> 
> 
> The !hba->mcq_enabled check is only for clearing outstanding_reqs,
> which is the legacy single-doorbell software bitmap.
> MCQ does not use outstanding_reqs for request tracking.
> 

Hi Hongjie,

I know, but what I mean is, if this check (!hba->mcq_enabled) 
always evaluates to true, then it is a redundant check, right?
I don't see any scenario where it would return false.

> 
> > 
> > > +                       unsigned long flags;
> > > +                       struct request *rq =
> > > scsi_cmd_to_rq(scmd);
> > > +
> > > +                       spin_lock_irqsave(&hba->outstanding_lock,
> > > flags);
> > > +                       __clear_bit(rq->tag, &hba-
> > > >outstanding_reqs);
> > > +                       spin_unlock_irqrestore(&hba-
> > > > outstanding_lock, flags);
> > > +               }
> > > +
> > > +               set_host_byte(scmd, DID_TIME_OUT);
> > > 
> > 
> > Why does MCQ mode set DID_REQUEUE, while legacy mode sets
> > DID_TIME_OUT?
> > 
> Normal SCSI PM commands use DID_REQUEUE, matching the existing
> MCQ force-completion behavior. Reserved internal device-management
> commands continue to use DID_TIME_OUT, right ?
> 

Sorry, I don't get it.
I mean, in MCQ mode, the ufshcd_mcq_force_compl_one function 
handles the same uncompleted condition, but why is the processing
logic different?

if (!test_bit(SCMD_STATE_COMPLETE, &cmd->state)) {
    set_host_byte(cmd, DID_REQUEUE);
    ufshcd_release_scsi_cmd(hba, cmd);
    scsi_done(cmd);
}

Thanks
Peter



  reply	other threads:[~2026-06-04  5:40 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(方洪杰)
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 (王信友) [this message]
     [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=9b00734a666a2b68a3a6dfb31ce78ffccc5c3686.camel@mediatek.com \
    --to=peter.wang@mediatek.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=hongjiefang@asrmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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®