Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Can Guo <can.guo@oss.qualcomm.com>
To: "Peter Wang (王信友)" <peter.wang@mediatek.com>,
	"beanhuo@micron.com" <beanhuo@micron.com>,
	"mani@kernel.org" <mani@kernel.org>,
	"avri.altman@wdc.com" <avri.altman@wdc.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] scsi: ufs: core: Add a quirk for extended TX EQTR Adapt L0L1L2L3 length
Date: Mon, 4 May 2026 20:55:25 +0800	[thread overview]
Message-ID: <8a1cf09d-7293-464e-b581-5337f4087593@oss.qualcomm.com> (raw)
In-Reply-To: <a173bb1733968d41690f8472d13b95028c8975c5.camel@mediatek.com>


On 5/4/2026 5:19 PM, Peter Wang (王信友) wrote:
>
> On Fri, 2026-05-01 at 06:16 -0700, Can Guo wrote:
> > 
> > diff --git a/drivers/ufs/core/ufs-txeq.c b/drivers/ufs/core/ufs-
> > txeq.c
> > index b2dc89124353..fe647450a7a1 100644
> > --- a/drivers/ufs/core/ufs-txeq.c
> > +++ b/drivers/ufs/core/ufs-txeq.c
> > @@ -740,7 +740,9 @@ static int
> > ufshcd_setup_tx_eqtr_adapt_length(struct ufs_hba *hba,
> >                 if (adapt_l0l1l2l3_cap_local >
> > ADAPT_L0L1L2L3_LENGTH_MAX) {
> >                         dev_err(hba->dev, "local
> > RX_HS_G%u_ADAPT_INITIAL_L0L1L2L3_CAP (0x%x) exceeds MAX\n",
> >                                 gear, adapt_l0l1l2l3_cap_local);
> > -                       return -EINVAL;
> > +
> > +                       if (!(hba->quirks &
> > UFSHCD_QUIRK_EXTENDED_TX_EQTR_ADAPT_LENGTH_L0L1L2L3))
> > +                               return -EINVAL;
> >                 }
> > 
> >                 ret = ufshcd_dme_get(hba,
> > UIC_ARG_MIB(PA_PEERRXHSG6ADAPTINITIALL0L1L2L3),
> > @@ -751,7 +753,9 @@ static int
> > ufshcd_setup_tx_eqtr_adapt_length(struct ufs_hba *hba,
> >                 if (adapt_l0l1l2l3_cap_peer >
> > ADAPT_L0L1L2L3_LENGTH_MAX) {
> >                         dev_err(hba->dev, "peer
> > RX_HS_G%u_ADAPT_INITIAL_L0L1L2L3_CAP (0x%x) exceeds MAX\n",
> >                                 gear, adapt_l0l1l2l3_cap_peer);
> > -                       return -EINVAL;
> > +
> > +                       if (!(hba->quirks &
> > UFSHCD_QUIRK_EXTENDED_TX_EQTR_ADAPT_LENGTH_L0L1L2L3))
> > +                               return -EINVAL;
> > 
>
> Hi Can,
>
> The quirk UFSHCD_QUIRK_EXTENDED_TX_EQTR_ADAPT_LENGTH_L0L1L2L3
> is defined as a host quirk, but it appears to be used for the
> device (peer) in this context. Is this usage wrong or intended?
Hi Peter,

Thanks for raising this; it is a good question. And I had spent quite 
some time
on this one trying to make it as simple as possible...

Firstly, it is intended. In TX EQTR flow, the host software programs a Adapt
Length value to PA_TXADAPTLENGTH_EQTR and initiates TX EQTR procedure.
With this quirk enabled, the host software is allowed (by Host HW) to 
continue
TX EQTR even with a value which is above the spec max, so the Host software
can attempt an extended (out-of-spec) value.

Then the outcome is naturally determined by the peer device:
1. If the device tolerates the extended value, TX EQTR succeeds.
2. If the device does not, TX EQTR fails as part of normal EQTR behavior.

So the quirk is intentionally host-only.

A separate device quirk could be added, but for this path it would be 
redundant
and would increase maintenance burden (for tracking a list of such 
devices) without
changing the outcome.

I hope I have answered your question and you can understand my 
considerations.

Thanks,
Can Guo.
>
> Thanks
> Peter
>
>
> ************* MEDIATEK Confidentiality Notice ********************
> The information contained in this e-mail message (including any
> attachments) may be confidential, proprietary, privileged, or otherwise
> exempt from disclosure under applicable laws. It is intended to be
> conveyed only to the designated recipient(s). Any use, dissemination,
> distribution, printing, retaining or copying of this e-mail (including its
> attachments) by unintended recipient(s) is strictly prohibited and may
> be unlawful. If you are not an intended recipient of this e-mail, or believe
> that you have received this e-mail in error, please notify the sender
> immediately (by replying to this e-mail), delete any and all copies of
> this e-mail (including any attachments) from your system, and do not
> disclose the content of this e-mail to any other person. Thank you!


  reply	other threads:[~2026-05-04 12:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01 13:16 [PATCH 0/2] scsi: ufs: Add quirk EXTENDED_TX_EQTR_ADAPT_LENGTH_L0L1L2L3 Can Guo
2026-05-01 13:16 ` [PATCH 1/2] scsi: ufs: core: Add a quirk for extended TX EQTR Adapt L0L1L2L3 length Can Guo
2026-05-04  3:06   ` Bart Van Assche
2026-05-04  9:19   ` Peter Wang (王信友)
2026-05-04 12:55     ` Can Guo [this message]
2026-05-05  5:48       ` Peter Wang (王信友)
2026-05-01 13:16 ` [PATCH 2/2] scsi: ufs: ufs-qcom: Use quirk EXTENDED_TX_EQTR_ADAPT_LENGTH_L0L1L2L3 Can Guo
2026-05-04  3:06   ` Bart Van Assche
2026-05-04  3:11     ` Can Guo

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=8a1cf09d-7293-464e-b581-5337f4087593@oss.qualcomm.com \
    --to=can.guo@oss.qualcomm.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=mani@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