Skip to contentSkip to conversation

scsi: ufs: Add UFS3.0 in ufs HCI version check

PATCH In review Nitin Rawat 4 participants 5 messages Jan 19, 2021 – Feb 1, 2021 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 scsi: ufs: Add UFS3.0 in ufs HCI version check

As per JESD223D UFS HCI v3.0 spec, HCI version 3.0 is also supported. Hence Adding UFS3.0 in UFS HCI version check to avoid logging of the error message.

---
 drivers/scsi/ufs/ufshcd.c | 5 +++--
 drivers/scsi/ufs/ufshci.h | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/scsi/ufs/ufshcd.c +3 -2
index 82ad317..54ca765 100644
@@ -9255,8 +9255,9 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
 	if ((hba->ufs_version != UFSHCI_VERSION_10) &&
 	    (hba->ufs_version != UFSHCI_VERSION_11) &&
 	    (hba->ufs_version != UFSHCI_VERSION_20) &&
-	    (hba->ufs_version != UFSHCI_VERSION_21))
-		dev_err(hba->dev, "invalid UFS version 0x%x\n",
+	    (hba->ufs_version != UFSHCI_VERSION_21) &&
+	    (hba->ufs_version != UFSHCI_VERSION_30))
+		dev_err(hba->dev, "invalid UFS HCI version 0x%x\n",
 			hba->ufs_version);
 
 	/* Get Interrupt bit mask per version */
drivers/scsi/ufs/ufshci.h +1 -0
index 6795e1f..48f6c19 100644
@@ -80,6 +80,7 @@ enum {
 	UFSHCI_VERSION_11 = 0x00010100, /* 1.1 */
 	UFSHCI_VERSION_20 = 0x00000200, /* 2.0 */
 	UFSHCI_VERSION_21 = 0x00000210, /* 2.1 */
+	UFSHCI_VERSION_30 = 0x00000300, /* 3.0 */
 };
 
 /*

--
2.7.4

Reviewed-by on v2 1/1
#1 lore raw
Quoted 4 lines · Nitin Rawat

As per JESD223D UFS HCI v3.0 spec, HCI version 3.0 is also supported. Hence Adding UFS3.0 in UFS HCI version check to avoid logging of the error message.

Quoted 37 lines
---
 drivers/scsi/ufs/ufshcd.c | 5 +++--
 drivers/scsi/ufs/ufshci.h | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/scsi/ufs/ufshcd.c +3 -2
index 82ad317..54ca765 100644
@@ -9255,8 +9255,9 @@ int ufshcd_init(struct ufs_hba *hba, void
 __iomem *mmio_base, unsigned int irq)
 	if ((hba->ufs_version != UFSHCI_VERSION_10) &&
 	    (hba->ufs_version != UFSHCI_VERSION_11) &&
 	    (hba->ufs_version != UFSHCI_VERSION_20) &&
-	    (hba->ufs_version != UFSHCI_VERSION_21))
-		dev_err(hba->dev, "invalid UFS version 0x%x\n",
+	    (hba->ufs_version != UFSHCI_VERSION_21) &&
+	    (hba->ufs_version != UFSHCI_VERSION_30))
+		dev_err(hba->dev, "invalid UFS HCI version 0x%x\n",
 			hba->ufs_version);
 
drivers/scsi/ufs/ufshcd.c +0 -0
 	/* Get Interrupt bit mask per version */
drivers/scsi/ufs/ufshci.h +1 -1
index 6795e1f..48f6c19 100644
@@ -80,6 +80,7 @@ enum {
 	UFSHCI_VERSION_11 = 0x00010100, /* 1.1 */
 	UFSHCI_VERSION_20 = 0x00000200, /* 2.0 */
 	UFSHCI_VERSION_21 = 0x00000210, /* 2.1 */
+	UFSHCI_VERSION_30 = 0x00000300, /* 3.0 */
 };
 
 /*
--

2.7.4

#3 lore raw
In reply to Nitin Rawat
Quoted 15 lines · Nitin Rawat

As per JESD223D UFS HCI v3.0 spec, HCI version 3.0 is also supported. Hence Adding UFS3.0 in UFS HCI version check to avoid logging of the error message.

---
 drivers/scsi/ufs/ufshcd.c | 5 +++--
 drivers/scsi/ufs/ufshci.h | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/scsi/ufs/ufshcd.c +0 -0
index 82ad317..54ca765 100644

drivers/scsi/ufs/ufshcd.c int ufshcd_init(struct ufs_hba *hba, void · line 9262

Quoted 10 lines
drivers/scsi/ufs/ufshcd.c +3 -2
@@ -9255,8 +9255,9 @@ int ufshcd_init(struct ufs_hba *hba, void
 __iomem *mmio_base, unsigned int irq)
        if ((hba->ufs_version != UFSHCI_VERSION_10) &&
            (hba->ufs_version != UFSHCI_VERSION_11) &&
            (hba->ufs_version != UFSHCI_VERSION_20) &&
-           (hba->ufs_version != UFSHCI_VERSION_21))
-               dev_err(hba->dev, "invalid UFS version 0x%x\n",
+           (hba->ufs_version != UFSHCI_VERSION_21) &&
+           (hba->ufs_version != UFSHCI_VERSION_30))
+               dev_err(hba->dev, "invalid UFS HCI version 0x%x\n",
                        hba->ufs_version);

Hi Nitin
Except HCI 1.0 / 1.1 / 2.0 / 2.1 / 3.0, do you have the other UFS HCI version? if no, current driver supports all of them, instead of scaling these check, and avoid logging of the error message, I suggest you can directly delete these redundant checkup.

If there is a weird HCI version that not supported by the current driver, you can only add an unsupported checkup list. thus, you don't need to scale this useless checkup.

Bean

#4 lore raw
Quoted 33 lines · Bean Huo
Quoted 15 lines · Nitin Rawat

As per JESD223D UFS HCI v3.0 spec, HCI version 3.0 is also supported. Hence Adding UFS3.0 in UFS HCI version check to avoid logging of the error message.

---
 drivers/scsi/ufs/ufshcd.c | 5 +++--
 drivers/scsi/ufs/ufshci.h | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/scsi/ufs/ufshcd.c +0 -0
index 82ad317..54ca765 100644

drivers/scsi/ufs/ufshcd.c int ufshcd_init(struct ufs_hba *hba, void · line 9262

Quoted 10 lines
drivers/scsi/ufs/ufshcd.c +3 -2
@@ -9255,8 +9255,9 @@ int ufshcd_init(struct ufs_hba *hba, void
 __iomem *mmio_base, unsigned int irq)
        if ((hba->ufs_version != UFSHCI_VERSION_10) &&
            (hba->ufs_version != UFSHCI_VERSION_11) &&
            (hba->ufs_version != UFSHCI_VERSION_20) &&
-           (hba->ufs_version != UFSHCI_VERSION_21))
-               dev_err(hba->dev, "invalid UFS version 0x%x\n",
+           (hba->ufs_version != UFSHCI_VERSION_21) &&
+           (hba->ufs_version != UFSHCI_VERSION_30))
+               dev_err(hba->dev, "invalid UFS HCI version 0x%x\n",
                        hba->ufs_version);

Hi Nitin
Except HCI 1.0 / 1.1 / 2.0 / 2.1 / 3.0, do you have the other UFS HCI version? if no, current driver supports all of them, instead of scaling these check, and avoid logging of the error message, I suggest you can directly delete these redundant checkup.

Quoted 5 lines

If there is a weird HCI version that not supported by the current driver, you can only add an unsupported checkup list. thus, you don't need to scale this useless checkup.

Bean

Hi Bean,
That's a good suggestion. If nobody has any concern, i will post new patchset by removing these redundant check.

Regards,
Nitin