Hi,
this series provides some device quirk fixes and cleanups.
Stanley Chu (2):
scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices
scsi: ufs: Cleanup device vendor and quirk definition
drivers/scsi/ufs/ufs_quirks.h | 3 ++-
drivers/scsi/ufs/ufshcd.c | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)
--
2.18.0
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 <[email protected]>
---
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 04b79ca66fdf..dea4fddf9332 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
Cleanup below items,
- Arrange vendor name in alphabetical order
- Squash device quirks as compact as possible in device quirk table
to enhance performance of the lookup.
Signed-off-by: Stanley Chu <[email protected]>
---
drivers/scsi/ufs/ufs_quirks.h | 2 +-
drivers/scsi/ufs/ufshcd.c | 6 ++----
2 files changed, 3 insertions(+), 5 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 dea4fddf9332..7c93cb446f51 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -219,10 +219,8 @@ 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_RECOVERY_FROM_DL_NAC_ERRORS),
- UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
+ UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM |
+ UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS |
UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE),
UFS_FIX(UFS_VENDOR_TOSHIBA, UFS_ANY_MODEL,
UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM),
--
2.18.0
On Wed, 2020-06-10 at 13:36 +0800, Stanley Chu wrote:
> 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 <[email protected]>
Reviewed-by: Bean Huo <[email protected]>
Thanks,
Bean
> ---
> 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 04b79ca66fdf..dea4fddf9332 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
Hi Stanley
> -----Original Message-----
> From: Stanley Chu <[email protected]>
> Sent: 10 June 2020 11:07
> 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 v1 2/2] scsi: ufs: Cleanup device vendor and quirk
definition
>
> Cleanup below items,
> - Arrange vendor name in alphabetical order
> - Squash device quirks as compact as possible in device quirk table
> to enhance performance of the lookup.
>
> Signed-off-by: Stanley Chu <[email protected]>
> ---
> drivers/scsi/ufs/ufs_quirks.h | 2 +-
> drivers/scsi/ufs/ufshcd.c | 6 ++----
> 2 files changed, 3 insertions(+), 5 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
> dea4fddf9332..7c93cb446f51 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -219,10 +219,8 @@ 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_RECOVERY_FROM_DL_NAC_ERRORS),
> - UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
> + UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM |
> + UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS |
> UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE),
> UFS_FIX(UFS_VENDOR_TOSHIBA, UFS_ANY_MODEL,
> UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM),
> --
While at this, may be arrange the table in alphabetical order.
> 2.18.0
Hi Alim,
On Thu, 2020-06-11 at 21:04 +0530, Alim Akhtar wrote:
> Hi Stanley
>
> > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index
> > dea4fddf9332..7c93cb446f51 100644
> > --- a/drivers/scsi/ufs/ufshcd.c
> > +++ b/drivers/scsi/ufs/ufshcd.c
> > @@ -219,10 +219,8 @@ 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_RECOVERY_FROM_DL_NAC_ERRORS),
> > - UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
> > + UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM |
> > + UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS |
> > UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE),
> > UFS_FIX(UFS_VENDOR_TOSHIBA, UFS_ANY_MODEL,
> > UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM),
> > --
> While at this, may be arrange the table in alphabetical order.
Sure, fixed in v2.
Thanks for the review.
Stanley Chu