Skip to contentSkip to conversation

scsi: ufs: Fix and cleanup device quirks

PATCH Applied Stanley Chu 3 participants 5 messages Jun 12, 2020 – Jun 16, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover scsi: ufs: Fix and cleanup device quirks

Hi,
this series provides some device quirk fixes and cleanups.

v1 -> v2:
- Sort device quirks in alphabetical order (Alim Akhtar)

Stanley Chu (2):
scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices
scsi: ufs: Cleanup device vendor name and device quirk table

 drivers/scsi/ufs/ufs_quirks.h |  3 ++-
 drivers/scsi/ufs/ufshcd.c     | 15 +++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)
Signature · 1 line
2.18.0
#1 lore raw

PATCH v2 1/2 scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices

It is confirmed that Micron device needs DELAY_BEFORE_LPM quirk to have a delay before VCC is powered off. So add Micron vendor ID and this quirk for Micron devices.

---
 drivers/scsi/ufs/ufs_quirks.h | 1 +
 drivers/scsi/ufs/ufshcd.c     | 2 ++
 2 files changed, 3 insertions(+)
drivers/scsi/ufs/ufs_quirks.h +1 -0
index e3175a63c676..e80d5f26a442 100644
@@ -12,6 +12,7 @@
 #define UFS_ANY_VENDOR 0xFFFF
 #define UFS_ANY_MODEL  "ANY_MODEL"
 
+#define UFS_VENDOR_MICRON      0x12C
 #define UFS_VENDOR_TOSHIBA     0x198
 #define UFS_VENDOR_SAMSUNG     0x1CE
 #define UFS_VENDOR_SKHYNIX     0x1AD
drivers/scsi/ufs/ufshcd.c +2 -0
index ad4fc829cbb2..1da1df6ea47e 100644
@@ -216,6 +216,8 @@ ufs_get_desired_pm_lvl_for_dev_link_state(enum ufs_dev_pwr_mode dev_state,
 
 static struct ufs_dev_fix ufs_fixups[] = {
 	/* UFS cards deviations table */
+	UFS_FIX(UFS_VENDOR_MICRON, UFS_ANY_MODEL,
+		UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM),
 	UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
 		UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM),
 	UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
Signature · 1 line
2.18.0
#2 lore raw

PATCH v2 2/2 scsi: ufs: Cleanup device vendor name and device quirk table

In reply to Stanley Chu

Cleanup below items,
- Sort vendor name in alphabetical order
- Squash device quirks as compact as possible in device quirk table to enhance performance of the lookup
- Sort device quirks in alphabetical order

---
 drivers/scsi/ufs/ufs_quirks.h |  2 +-
 drivers/scsi/ufs/ufshcd.c     | 15 ++++++---------
 2 files changed, 7 insertions(+), 10 deletions(-)
drivers/scsi/ufs/ufs_quirks.h +1 -1
index e80d5f26a442..2a0041493e30 100644
@@ -13,9 +13,9 @@
 #define UFS_ANY_MODEL  "ANY_MODEL"
 
 #define UFS_VENDOR_MICRON      0x12C
-#define UFS_VENDOR_TOSHIBA     0x198
 #define UFS_VENDOR_SAMSUNG     0x1CE
 #define UFS_VENDOR_SKHYNIX     0x1AD
+#define UFS_VENDOR_TOSHIBA     0x198
 #define UFS_VENDOR_WDC         0x145
 
 /**
drivers/scsi/ufs/ufshcd.c +6 -9
index 1da1df6ea47e..c197a3315d21 100644
@@ -219,22 +219,19 @@ static struct ufs_dev_fix ufs_fixups[] = {
 	UFS_FIX(UFS_VENDOR_MICRON, UFS_ANY_MODEL,
 		UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM),
 	UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
-		UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM),
-	UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
+		UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM |
+		UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE |
 		UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS),
-	UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
-		UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE),
+	UFS_FIX(UFS_VENDOR_SKHYNIX, UFS_ANY_MODEL,
+		UFS_DEVICE_QUIRK_HOST_PA_SAVECONFIGTIME),
+	UFS_FIX(UFS_VENDOR_SKHYNIX, "hB8aL1" /*H28U62301AMR*/,
+		UFS_DEVICE_QUIRK_HOST_VS_DEBUGSAVECONFIGTIME),
 	UFS_FIX(UFS_VENDOR_TOSHIBA, UFS_ANY_MODEL,
 		UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM),
 	UFS_FIX(UFS_VENDOR_TOSHIBA, "THGLF2G9C8KBADG",
 		UFS_DEVICE_QUIRK_PA_TACTIVATE),
 	UFS_FIX(UFS_VENDOR_TOSHIBA, "THGLF2G9D8KBADG",
 		UFS_DEVICE_QUIRK_PA_TACTIVATE),
-	UFS_FIX(UFS_VENDOR_SKHYNIX, UFS_ANY_MODEL,
-		UFS_DEVICE_QUIRK_HOST_PA_SAVECONFIGTIME),
-	UFS_FIX(UFS_VENDOR_SKHYNIX, "hB8aL1" /*H28U62301AMR*/,
-		UFS_DEVICE_QUIRK_HOST_VS_DEBUGSAVECONFIGTIME),
-
 	END_FIX
 };
 
Signature · 1 line
2.18.0
Reviewed-by on the v2 series
#3 lore raw
In reply to Stanley Chu

Hi Stanley,

Quoted 21 lines

-----Original Message-----
From: Stanley Chu <[email protected]>
Sent: 12 June 2020 06:56
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux-arm- [email protected]; [email protected]; [email protected]; [email protected]; chun- [email protected]; [email protected]; [email protected]; [email protected]; Stanley Chu <[email protected]>
Subject: [PATCH v2 0/2] scsi: ufs: Fix and cleanup device quirks

Hi,
this series provides some device quirk fixes and cleanups.

v1 -> v2:
- Sort device quirks in alphabetical order (Alim Akhtar)

Quoted 8 lines

Stanley Chu (2):
scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices
scsi: ufs: Cleanup device vendor name and device quirk table

 drivers/scsi/ufs/ufs_quirks.h |  3 ++-
 drivers/scsi/ufs/ufshcd.c     | 15 +++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

For this series

Thanks!

Quoted 2 lines

--
2.18.0

#4 lore raw
In reply to Stanley Chu
Quoted 10 lines · Stanley Chu

this series provides some device quirk fixes and cleanups.

v1 -> v2:
- Sort device quirks in alphabetical order (Alim Akhtar)

Stanley Chu (2):
scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices
scsi: ufs: Cleanup device vendor name and device quirk table

[...]

Applied to 5.9/scsi-queue, thanks!

[1/2] scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices

      https://git.kernel.org/mkp/scsi/c/c0a18ee0ce78
[2/2] scsi: ufs: Clean up device vendor name and device quirk table
      https://git.kernel.org/mkp/scsi/c/ed0b40ffa364
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering