Enable HOST_PA_TACTIVATE quirk for WDC UFS devices
Subsystems (2)
v2 cover Enable HOST_PA_TACTIVATE quirk for WDC UFS devices
Changes since v1:
- Instead of using this quirk for all Soc vendors, enable this quirk only for QCOM's platforms.
Western Digital UFS devices require host PA_TACTIVATE to be lower than device PA_TACTIVATE, otherwise it may get stuck during hibern8 sequence.
Can Guo (2):
scsi: ufs: Allow vendor apply device quirks in advance
scsi: ufs-qcom: Apply QUIRK_HOST_TACTIVATE for WDC UFS devices
drivers/scsi/ufs/ufs-qcom.c | 3 +++ drivers/scsi/ufs/ufs_quirks.h | 1 + drivers/scsi/ufs/ufshcd.c | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH v2 1/2 scsi: ufs: Allow vendor apply device quirks in advance
Currently ufshcd_vops_apply_dev_quirks() comes after all UniPro parameters have been tuned. Move it up so that vendors have a chance to apply device quirks in advance.
--- drivers/scsi/ufs/ufshcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/ufs/ufshcd.c +2 -2
@@ -6804,14 +6804,14 @@ static void ufshcd_tune_unipro_params(struct ufs_hba *hba)ufshcd_tune_pa_hibern8time (hba); } +ufshcd_vops_apply_dev_quirks (hba); +if (hba->dev_quirks &UFS_DEVICE_QUIRK_PA_TACTIVATE )/* set 1ms timeout for PA_TACTIVATE */ ufshcd_dme_set (hba,UIC_ARG_MIB (PA_TACTIVATE ),10 );if (hba->dev_quirks &UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE )ufshcd_quirk_tune_host_pa_tactivate (hba); - -ufshcd_vops_apply_dev_quirks (hba); }static void ufshcd_clear_dbg_ufs_stats (struct ufs_hba *hba)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v2 1/2] scsi: ufs: Allow vendor apply device quirks in advance
Hi Can,
Quoted 5 lines · Can Guo
Currently
ufshcd_vops_apply_dev_quirks()comes after all UniPro parameters have been tuned. Move it up so that vendors have a chance to apply device quirks in advance.Signed-off-by Can Guo <[email protected]>
As discussed, ufs-mediatek needs to do corresponding patch and I will submit it once this commit is merged.
Re: [PATCH v2 1/2] scsi: ufs: Allow vendor apply device quirks in advance
Hi Stanley,
Quoted 7 lines · Stanley Chu
Hi Can,
Quoted 4 lines · Can Guo
Currently
ufshcd_vops_apply_dev_quirks()comes after all UniPro parameters have been tuned. Move it up so that vendors have a chance to apply device quirks in advance.
Quoted 6 lines
Quoted 1 line
Signed-off-by Can Guo <[email protected]>As discussed, ufs-mediatek needs to do corresponding patch and I will submit it once this commit is merged.
Reviewed-by Stanley Chu <[email protected]>
Yes, sure, thanks for your cooperation. :)
Best Regards,
Can Guo.
PATCH v2 2/2 scsi: ufs-qcom: Apply QUIRK_HOST_TACTIVATE for WDC UFS devices
In reply to Can GuoWestern Digital UFS devices require host's PA_TACTIVATE to be lower than device's PA_TACTIVATE, otherwise it may get stuck during hibern8 sequence.
--- drivers/scsi/ufs/ufs-qcom.c | 3 +++ drivers/scsi/ufs/ufs_quirks.h | 1 + 2 files changed, 4 insertions(+)
drivers/scsi/ufs/ufs-qcom.c +3 -0
@@ -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; }
drivers/scsi/ufs/ufs_quirks.h +1 -0
@@ -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
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
RE: [PATCH v2 2/2] scsi: ufs-qcom: Apply QUIRK_HOST_TACTIVATE for WDC UFS devices
Quoted 6 lines
Western Digital UFS devices require host's
PA_TACTIVATEto be lower than device'sPA_TACTIVATE, otherwise it may get stuck during hibern8 sequence.Signed-off-by Can Guo <[email protected]>
Re: [PATCH v2 2/2] scsi: ufs-qcom: Apply QUIRK_HOST_TACTIVATE for WDC UFS devices
In reply to Can GuoQuoted 5 lines · Can Guo
Western Digital UFS devices require host's
PA_TACTIVATEto be lower than device'sPA_TACTIVATE, otherwise it may get stuck during hibern8 sequence.Signed-off-by Can Guo <[email protected]>---
Quoted 31 lines
drivers/scsi/ufs/ufs-qcom.c | 3 +++ drivers/scsi/ufs/ufs_quirks.h | 1 + 2 files changed, 4 insertions(+)drivers/scsi/ufs/ufs-qcom.c +3
-0@@ -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; }drivers/scsi/ufs/ufs_quirks.h +1
-0@@ -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
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, Linux Foundation Collaborative Project
Martin K. Petersen
AppliedCan,
Quoted 2 lines
Western Digital UFS devices require host
PA_TACTIVATEto be lower than devicePA_TACTIVATE, otherwise it may get stuck during hibern8 sequence.
Applied to 5.7/scsi-queue, thank you!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering