diff mbox series

[v1,2/2] scsi: ufs: Cleanup device vendor and quirk definition

Message ID 20200610053645.19975-3-stanley.chu@mediatek.com (mailing list archive)
State New, archived
Headers show
Series scsi: ufs: Fix and cleanup device quirk | expand

Commit Message

Stanley Chu June 10, 2020, 5:36 a.m. UTC
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 <stanley.chu@mediatek.com>
---
 drivers/scsi/ufs/ufs_quirks.h | 2 +-
 drivers/scsi/ufs/ufshcd.c     | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

Comments

Alim Akhtar June 11, 2020, 3:34 p.m. UTC | #1
Hi Stanley

> -----Original Message-----
> From: Stanley Chu <stanley.chu@mediatek.com>
> Sent: 10 June 2020 11:07
> 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 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 <stanley.chu@mediatek.com>
> ---
>  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
Stanley Chu June 12, 2020, 1:27 a.m. UTC | #2
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
diff mbox series

Patch

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