linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] scsi: ufs: Fix and cleanup device quirks
@ 2020-06-12  1:26 ` Stanley Chu
  2020-06-12  1:26   ` [PATCH v2 1/2] scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices Stanley Chu
                     ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Stanley Chu @ 2020-06-12  1:26 UTC (permalink / raw)
  To: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb, asutoshd
  Cc: beanhuo, cang, matthias.bgg, bvanassche, linux-mediatek,
	linux-arm-kernel, linux-kernel, kuohong.wang, peter.wang,
	chun-hung.wu, andy.teng, chaotian.jing, cc.chou, Stanley Chu

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(-)

-- 
2.18.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices
  2020-06-12  1:26 ` [PATCH v2 0/2] scsi: ufs: Fix and cleanup device quirks Stanley Chu
@ 2020-06-12  1:26   ` Stanley Chu
  2020-06-12  1:26   ` [PATCH v2 2/2] scsi: ufs: Cleanup device vendor name and device quirk table Stanley Chu
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Stanley Chu @ 2020-06-12  1:26 UTC (permalink / raw)
  To: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb, asutoshd
  Cc: beanhuo, cang, matthias.bgg, bvanassche, linux-mediatek,
	linux-arm-kernel, linux-kernel, kuohong.wang, peter.wang,
	chun-hung.wu, andy.teng, chaotian.jing, cc.chou, Stanley Chu

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.

Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
---
 drivers/scsi/ufs/ufs_quirks.h | 1 +
 drivers/scsi/ufs/ufshcd.c     | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/drivers/scsi/ufs/ufs_quirks.h b/drivers/scsi/ufs/ufs_quirks.h
index e3175a63c676..e80d5f26a442 100644
--- a/drivers/scsi/ufs/ufs_quirks.h
+++ b/drivers/scsi/ufs/ufs_quirks.h
@@ -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
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index ad4fc829cbb2..1da1df6ea47e 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -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,
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] scsi: ufs: Cleanup device vendor name and device quirk table
  2020-06-12  1:26 ` [PATCH v2 0/2] scsi: ufs: Fix and cleanup device quirks Stanley Chu
  2020-06-12  1:26   ` [PATCH v2 1/2] scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices Stanley Chu
@ 2020-06-12  1:26   ` Stanley Chu
  2020-06-12  2:13   ` [PATCH v2 0/2] scsi: ufs: Fix and cleanup device quirks Alim Akhtar
  2020-06-16  3:59   ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Stanley Chu @ 2020-06-12  1:26 UTC (permalink / raw)
  To: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb, asutoshd
  Cc: beanhuo, cang, matthias.bgg, bvanassche, linux-mediatek,
	linux-arm-kernel, linux-kernel, kuohong.wang, peter.wang,
	chun-hung.wu, andy.teng, chaotian.jing, cc.chou, 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

Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
---
 drivers/scsi/ufs/ufs_quirks.h |  2 +-
 drivers/scsi/ufs/ufshcd.c     | 15 ++++++---------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/ufs/ufs_quirks.h b/drivers/scsi/ufs/ufs_quirks.h
index e80d5f26a442..2a0041493e30 100644
--- a/drivers/scsi/ufs/ufs_quirks.h
+++ b/drivers/scsi/ufs/ufs_quirks.h
@@ -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
 
 /**
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 1da1df6ea47e..c197a3315d21 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -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
 };
 
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH v2 0/2] scsi: ufs: Fix and cleanup device quirks
  2020-06-12  1:26 ` [PATCH v2 0/2] scsi: ufs: Fix and cleanup device quirks Stanley Chu
  2020-06-12  1:26   ` [PATCH v2 1/2] scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices Stanley Chu
  2020-06-12  1:26   ` [PATCH v2 2/2] scsi: ufs: Cleanup device vendor name and device quirk table Stanley Chu
@ 2020-06-12  2:13   ` Alim Akhtar
  2020-06-16  3:59   ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Alim Akhtar @ 2020-06-12  2:13 UTC (permalink / raw)
  To: 'Stanley Chu',
	linux-scsi, martin.petersen, avri.altman, jejb, asutoshd
  Cc: beanhuo, cang, matthias.bgg, bvanassche, linux-mediatek,
	linux-arm-kernel, linux-kernel, kuohong.wang, peter.wang,
	chun-hung.wu, andy.teng, chaotian.jing, cc.chou

Hi Stanley,

> -----Original Message-----
> From: Stanley Chu <stanley.chu@mediatek.com>
> Sent: 12 June 2020 06:56
> To: linux-scsi@vger.kernel.org; martin.petersen@oracle.com;
> avri.altman@wdc.com; alim.akhtar@samsung.com; jejb@linux.ibm.com;
> asutoshd@codeaurora.org
> Cc: beanhuo@micron.com; cang@codeaurora.org; matthias.bgg@gmail.com;
> bvanassche@acm.org; linux-mediatek@lists.infradead.org; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
> kuohong.wang@mediatek.com; peter.wang@mediatek.com; chun-
> hung.wu@mediatek.com; andy.teng@mediatek.com;
> chaotian.jing@mediatek.com; cc.chou@mediatek.com; Stanley Chu
> <stanley.chu@mediatek.com>
> 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)
> 
> 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
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Thanks! 

> --
> 2.18.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/2] scsi: ufs: Fix and cleanup device quirks
  2020-06-12  1:26 ` [PATCH v2 0/2] scsi: ufs: Fix and cleanup device quirks Stanley Chu
                     ` (2 preceding siblings ...)
  2020-06-12  2:13   ` [PATCH v2 0/2] scsi: ufs: Fix and cleanup device quirks Alim Akhtar
@ 2020-06-16  3:59   ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2020-06-16  3:59 UTC (permalink / raw)
  To: linux-scsi, jejb, avri.altman, Stanley Chu, asutoshd, alim.akhtar
  Cc: Martin K . Petersen, peter.wang, beanhuo, matthias.bgg,
	chaotian.jing, bvanassche, linux-arm-kernel, kuohong.wang,
	linux-kernel, andy.teng, cang, cc.chou, chun-hung.wu,
	linux-mediatek

On Fri, 12 Jun 2020 09:26:23 +0800, Stanley Chu wrote:

> 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

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-06-16  4:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200612012633epcas5p30882af0f4cd7f7dd4a820f3fdbb9b1be@epcas5p3.samsung.com>
2020-06-12  1:26 ` [PATCH v2 0/2] scsi: ufs: Fix and cleanup device quirks Stanley Chu
2020-06-12  1:26   ` [PATCH v2 1/2] scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices Stanley Chu
2020-06-12  1:26   ` [PATCH v2 2/2] scsi: ufs: Cleanup device vendor name and device quirk table Stanley Chu
2020-06-12  2:13   ` [PATCH v2 0/2] scsi: ufs: Fix and cleanup device quirks Alim Akhtar
2020-06-16  3:59   ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).