From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org,
Kyoungrul Kim <k831.kim@samsung.com>
Subject: Re: [PATCH 2/3] ufs: core: Add a quirk for handling broken SDBS field in controller capabilities register
Date: Thu, 15 Aug 2024 09:16:21 +0530 [thread overview]
Message-ID: <20240815034621.GB2562@thinkpad> (raw)
In-Reply-To: <f51533d5-46b9-4485-b71c-2fbd6a12071a@acm.org>
On Wed, Aug 14, 2024 at 10:29:11AM -0700, Bart Van Assche wrote:
> On 8/14/24 10:15 AM, Manivannan Sadhasivam via B4 Relay wrote:
> > From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> >
> > 'Legacy Queue & Single Doorbell Support (SDBS)' field in the controller
> > capabilities register is supposed to be reserved for UFSHCI 3.0 based
> > controllers and should read as 0. But some controllers may report bogus
> > value of 1 due to the hardware bug. So let's add a quirk to handle those
> > controllers.
> >
> > If the quirk is enabled by the controller driver and MCQ is not supported,
> > then 'hba->sdbs_sup' field will be ignored and the SCSI device will be
> > added in legacy/single doorbell mode.
> >
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > ---
> > drivers/ufs/core/ufshcd.c | 5 +++--
> > include/ufs/ufshcd.h | 7 +++++++
> > 2 files changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> > index 168b9dbc3ada..acb6f261ecc2 100644
> > --- a/drivers/ufs/core/ufshcd.c
> > +++ b/drivers/ufs/core/ufshcd.c
> > @@ -10512,8 +10512,9 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
> > }
> > if (!is_mcq_supported(hba)) {
> > - if (!hba->sdbs_sup) {
> > - dev_err(hba->dev, "%s: failed to initialize (legacy doorbell mode not supported)\n",
> > + if (!(hba->quirks & UFSHCD_QUIRK_BROKEN_SDBS_CAP) && !hba->sdbs_sup) {
> > + dev_err(hba->dev,
> > + "%s: failed to initialize (legacy doorbell mode not supported)\n",
> > __func__);
> > err = -EINVAL;
> > goto out_disable;
>
> Adding a check for the UFSHCD_QUIRK_BROKEN_SDBS_CAP quirk everywhere
> hba->sdbs_sup is tested is wrong. Please move this check to the code
> that assigns a value to hba->sdbs_sup.
>
I thought it wouldn't matter since it is used in just one place, but I agree it
is best to keep it in assignment itself.
- Mani
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2024-08-15 3:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-14 17:15 [PATCH 0/3] ufs: qcom: Fix probe failure on SM8550 SoC due to broken SDBS field Manivannan Sadhasivam
2024-08-14 17:15 ` Manivannan Sadhasivam via B4 Relay
2024-08-14 17:15 ` [PATCH 1/3] ufs: core: Rename LSDB to SDBS to reflect the UFSHCI 4.0 spec Manivannan Sadhasivam
2024-08-14 17:15 ` Manivannan Sadhasivam via B4 Relay
2024-08-14 17:27 ` Bart Van Assche
2024-08-15 3:36 ` Manivannan Sadhasivam
2024-08-14 17:15 ` [PATCH 2/3] ufs: core: Add a quirk for handling broken SDBS field in controller capabilities register Manivannan Sadhasivam
2024-08-14 17:15 ` Manivannan Sadhasivam via B4 Relay
2024-08-14 17:29 ` Bart Van Assche
2024-08-15 3:46 ` Manivannan Sadhasivam [this message]
2024-08-14 17:15 ` [PATCH 3/3] ufs: qcom: Add UFSHCD_QUIRK_BROKEN_SDBS_CAP for SM8550 SoC Manivannan Sadhasivam
2024-08-14 17:15 ` Manivannan Sadhasivam via B4 Relay
2024-08-14 17:22 ` [PATCH 0/3] ufs: qcom: Fix probe failure on SM8550 SoC due to broken SDBS field Amit Pundir
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=20240815034621.GB2562@thinkpad \
--to=manivannan.sadhasivam@linaro.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=bvanassche@acm.org \
--cc=k831.kim@samsung.com \
--cc=linux-arm-msm@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.