mirror of https://lore.kernel.org/lkml/
 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>,
	"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>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.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>
Subject: Re: [PATCH 2/3] scsi: ufs: core: Tolerate RX_FOM read failures in TX EQTR
Date: Tue, 23 Jun 2026 21:08:31 +0800	[thread overview]
Message-ID: <96c0d9d2-d902-4e07-9854-2ca5ddcc5eaa@oss.qualcomm.com> (raw)
In-Reply-To: <bd4c01727a6a3f0b4d1cb716caa35662fae7d41a.camel@mediatek.com>



On 6/23/2026 5:05 PM, Peter Wang (王信友) wrote:
>
> On Sat, 2026-06-20 at 01:03 -0700, Can Guo wrote:
> > @@ -494,22 +496,30 @@ static int ufshcd_get_rx_fom(struct ufs_hba
> > *hba,
> > 
> >         /* Get FOM of host's TX lanes from device's RX_FOM. */
> >         for (lane = 0; lane < pwr_mode->lane_tx; lane++) {
> > +               h_iter->fom[lane] = 0;
> >                 ret = ufshcd_dme_peer_get(hba,
> > UIC_ARG_MIB_SEL(RX_FOM,
> >                                          
> > UIC_ARG_MPHY_RX_GEN_SEL_INDEX(lane)),
> >                                           &fom);
> > -               if (ret)
> > -                       return ret;
> > +               if (ret) {
> > +                       dev_dbg(hba->dev, "Failed to get FOM for Host
> > TX Lane %d: %d\n",
> > +                               lane, ret);
> > +                       continue;
> > +               }
> > 
>
> Hi Can,
>
> I suggest setting h_iter->fom[lane] = 0 when an error occurs,
> as this approach is clearer and improves code efficiency,
> for example:
> if (ret) {
>      h_iter->fom[lane] = 0;
>      ...
>      continue;
> }
Thanks for suggestion, and I like it, let me adopt in next version.

Thanks,
Can Guo.
>
>
> >                 h_iter->fom[lane] = (u8)fom;
> >         }
> > 
> >         /* Get FOM of device's TX lanes from host's RX_FOM. */
> >         for (lane = 0; lane < pwr_mode->lane_rx; lane++) {
> > +               d_iter->fom[lane] = 0;
> >                 ret = ufshcd_dme_get(hba, UIC_ARG_MIB_SEL(RX_FOM,
> >                                     
> > UIC_ARG_MPHY_RX_GEN_SEL_INDEX(lane)),
> >                                      &fom);
> > -               if (ret)
> > -                       return ret;
> > +               if (ret) {
> > +                       dev_dbg(hba->dev, "Failed to get FOM for
> > Device TX Lane %d: %d\n",
> > +                               lane, ret);
> > +                       continue;
> > +               }
> > 
>
> The same applies as above.
>
> 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-06-23 13:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260620080322.3765210-1-can.guo@oss.qualcomm.com>
2026-06-20  8:03 ` [PATCH 1/3] scsi: ufs: ufs-qcom: Restore TX Equalization settings on FOM failure Can Guo
2026-06-23  6:33   ` Manivannan Sadhasivam
2026-06-23 13:23     ` Can Guo
2026-06-20  8:03 ` [PATCH 2/3] scsi: ufs: core: Tolerate RX_FOM read failures in TX EQTR Can Guo
2026-06-23  6:37   ` Manivannan Sadhasivam
2026-06-23  9:05   ` Peter Wang (王信友)
2026-06-23 13:08     ` Can Guo [this message]
2026-06-20  8:03 ` [PATCH 3/3] scsi: ufs: core: Always run tx_eqtr POST_CHANGE notify Can Guo
2026-06-23  6:45   ` Manivannan Sadhasivam
2026-06-23  9:06   ` Peter Wang (王信友)
2026-07-06 14:34   ` 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=96c0d9d2-d902-4e07-9854-2ca5ddcc5eaa@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

Powered by JetHome