[PATCH 1/3] ufs: core: Rename LSDB to SDBS to reflect the UFSHCI 4.0 spec

Manivannan Sadhasivam via B4 Relay posted 3 patches 1 year, 5 months ago
[PATCH 1/3] ufs: core: Rename LSDB to SDBS to reflect the UFSHCI 4.0 spec
Posted by Manivannan Sadhasivam via B4 Relay 1 year, 5 months ago
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

UFSHCI 4.0 spec names the 'Legacy Queue & Single Doorbell Support' field in
Controller Capabilities register as 'SDBS'. So let's use the same
terminology in the driver to align with the spec.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/ufs/core/ufshcd.c | 6 +++---
 include/ufs/ufshcd.h      | 2 +-
 include/ufs/ufshci.h      | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 0b3d0c8e0dda..168b9dbc3ada 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -2418,7 +2418,7 @@ static inline int ufshcd_hba_capabilities(struct ufs_hba *hba)
 
 	/*
 	 * The UFSHCI 3.0 specification does not define MCQ_SUPPORT and
-	 * LSDB_SUPPORT, but [31:29] as reserved bits with reset value 0s, which
+	 * SDBS_SUPPORT, but [31:29] as reserved bits with reset value 0s, which
 	 * means we can simply read values regardless of version.
 	 */
 	hba->mcq_sup = FIELD_GET(MASK_MCQ_SUPPORT, hba->capabilities);
@@ -2426,7 +2426,7 @@ static inline int ufshcd_hba_capabilities(struct ufs_hba *hba)
 	 * 0h: legacy single doorbell support is available
 	 * 1h: indicate that legacy single doorbell support has been removed
 	 */
-	hba->lsdb_sup = !FIELD_GET(MASK_LSDB_SUPPORT, hba->capabilities);
+	hba->sdbs_sup = !FIELD_GET(MASK_SDBS_SUPPORT, hba->capabilities);
 	if (!hba->mcq_sup)
 		return 0;
 
@@ -10512,7 +10512,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
 	}
 
 	if (!is_mcq_supported(hba)) {
-		if (!hba->lsdb_sup) {
+		if (!hba->sdbs_sup) {
 			dev_err(hba->dev, "%s: failed to initialize (legacy doorbell mode not supported)\n",
 				__func__);
 			err = -EINVAL;
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index cac0cdb9a916..d44b19cf9f82 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -1109,7 +1109,7 @@ struct ufs_hba {
 	bool ext_iid_sup;
 	bool scsi_host_added;
 	bool mcq_sup;
-	bool lsdb_sup;
+	bool sdbs_sup;
 	bool mcq_enabled;
 	struct ufshcd_res_info res[RES_MAX];
 	void __iomem *mcq_base;
diff --git a/include/ufs/ufshci.h b/include/ufs/ufshci.h
index 9917c7743d80..b60212865e90 100644
--- a/include/ufs/ufshci.h
+++ b/include/ufs/ufshci.h
@@ -77,7 +77,7 @@ enum {
 	MASK_OUT_OF_ORDER_DATA_DELIVERY_SUPPORT	= 0x02000000,
 	MASK_UIC_DME_TEST_MODE_SUPPORT		= 0x04000000,
 	MASK_CRYPTO_SUPPORT			= 0x10000000,
-	MASK_LSDB_SUPPORT			= 0x20000000,
+	MASK_SDBS_SUPPORT			= 0x20000000,
 	MASK_MCQ_SUPPORT			= 0x40000000,
 };
 

-- 
2.25.1
Re: [PATCH 1/3] ufs: core: Rename LSDB to SDBS to reflect the UFSHCI 4.0 spec
Posted by Bart Van Assche 1 year, 5 months ago
On 8/14/24 10:15 AM, Manivannan Sadhasivam via B4 Relay wrote:
> UFSHCI 4.0 spec names the 'Legacy Queue & Single Doorbell Support' field in
> Controller Capabilities register as 'SDBS'. So let's use the same
> terminology in the driver to align with the spec.

If a rename happens, we should use the name from the spec. I found the
following in the UFSHCI 4.0 specification: "Legacy Single DoorBell 
Support (LSDBS)". So please either rename SDBS into LSDBS or drop this
patch.

Thanks,

Bart.
Re: [PATCH 1/3] ufs: core: Rename LSDB to SDBS to reflect the UFSHCI 4.0 spec
Posted by Manivannan Sadhasivam 1 year, 5 months ago
On Wed, Aug 14, 2024 at 10:27:48AM -0700, Bart Van Assche wrote:
> On 8/14/24 10:15 AM, Manivannan Sadhasivam via B4 Relay wrote:
> > UFSHCI 4.0 spec names the 'Legacy Queue & Single Doorbell Support' field in
> > Controller Capabilities register as 'SDBS'. So let's use the same
> > terminology in the driver to align with the spec.
> 
> If a rename happens, we should use the name from the spec. I found the
> following in the UFSHCI 4.0 specification: "Legacy Single DoorBell Support
> (LSDBS)". So please either rename SDBS into LSDBS or drop this
> patch.
> 

Hmm. I looked into the editorial version of the 4.0 spec that I got access to
and that used SDBS. Maybe that got changed in the final version. Will change it
to LSDBS.

- Mani

-- 
மணிவண்ணன் சதாசிவம்