diff mbox series

[v2,2/2] scsi: ufs-qcom: Apply QUIRK_HOST_TACTIVATE for WDC UFS devices

Message ID 1582517363-11536-3-git-send-email-cang@codeaurora.org (mailing list archive)
State Mainlined
Commit 27ff2c60e095fb541251d0f90f9ea41f2b5f0f4f
Headers show
Series Enable HOST_PA_TACTIVATE quirk for WDC UFS devices | expand

Commit Message

Can Guo Feb. 24, 2020, 4:09 a.m. UTC
Western Digital UFS devices require host's PA_TACTIVATE to be lower than
device's PA_TACTIVATE, otherwise it may get stuck during hibern8 sequence.

Signed-off-by: Can Guo <cang@codeaurora.org>
---
 drivers/scsi/ufs/ufs-qcom.c   | 3 +++
 drivers/scsi/ufs/ufs_quirks.h | 1 +
 2 files changed, 4 insertions(+)

Comments

Avri Altman Feb. 24, 2020, 6:02 a.m. UTC | #1
> 
> Western Digital UFS devices require host's PA_TACTIVATE to be lower than
> device's PA_TACTIVATE, otherwise it may get stuck during hibern8 sequence.
> 
> Signed-off-by: Can Guo <cang@codeaurora.org>
Acked-by: Avri Altman <avri.altman@wdc.com>
Asutosh Das (asd) Feb. 25, 2020, 4:58 p.m. UTC | #2
On 2/23/2020 8:09 PM, Can Guo wrote:
> Western Digital UFS devices require host's PA_TACTIVATE to be lower than
> device's PA_TACTIVATE, otherwise it may get stuck during hibern8 sequence.
> 
> Signed-off-by: Can Guo <cang@codeaurora.org>
> ---

Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>

>   drivers/scsi/ufs/ufs-qcom.c   | 3 +++
>   drivers/scsi/ufs/ufs_quirks.h | 1 +
>   2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
> index c69c29a1c..4caa57f 100644
> --- a/drivers/scsi/ufs/ufs-qcom.c
> +++ b/drivers/scsi/ufs/ufs-qcom.c
> @@ -956,6 +956,9 @@ static int ufs_qcom_apply_dev_quirks(struct ufs_hba *hba)
>   	if (hba->dev_quirks & UFS_DEVICE_QUIRK_HOST_PA_SAVECONFIGTIME)
>   		err = ufs_qcom_quirk_host_pa_saveconfigtime(hba);
>   
> +	if (hba->dev_info.wmanufacturerid == UFS_VENDOR_WDC)
> +		hba->dev_quirks |= UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE;
> +
>   	return err;
>   }
>   
> diff --git a/drivers/scsi/ufs/ufs_quirks.h b/drivers/scsi/ufs/ufs_quirks.h
> index d0ab147..df7a1e6 100644
> --- a/drivers/scsi/ufs/ufs_quirks.h
> +++ b/drivers/scsi/ufs/ufs_quirks.h
> @@ -15,6 +15,7 @@
>   #define UFS_VENDOR_TOSHIBA     0x198
>   #define UFS_VENDOR_SAMSUNG     0x1CE
>   #define UFS_VENDOR_SKHYNIX     0x1AD
> +#define UFS_VENDOR_WDC         0x145
>   
>   /**
>    * ufs_dev_fix - ufs device quirk info
>
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index c69c29a1c..4caa57f 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -956,6 +956,9 @@  static int ufs_qcom_apply_dev_quirks(struct ufs_hba *hba)
 	if (hba->dev_quirks & UFS_DEVICE_QUIRK_HOST_PA_SAVECONFIGTIME)
 		err = ufs_qcom_quirk_host_pa_saveconfigtime(hba);
 
+	if (hba->dev_info.wmanufacturerid == UFS_VENDOR_WDC)
+		hba->dev_quirks |= UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE;
+
 	return err;
 }
 
diff --git a/drivers/scsi/ufs/ufs_quirks.h b/drivers/scsi/ufs/ufs_quirks.h
index d0ab147..df7a1e6 100644
--- a/drivers/scsi/ufs/ufs_quirks.h
+++ b/drivers/scsi/ufs/ufs_quirks.h
@@ -15,6 +15,7 @@ 
 #define UFS_VENDOR_TOSHIBA     0x198
 #define UFS_VENDOR_SAMSUNG     0x1CE
 #define UFS_VENDOR_SKHYNIX     0x1AD
+#define UFS_VENDOR_WDC         0x145
 
 /**
  * ufs_dev_fix - ufs device quirk info