From 06efe84d5f5ef4f4eec6759b9e35139efc3c8395 Mon Sep 17 00:00:00 2001 From: Ziqi Chen Date: Mon, 4 Jan 2021 16:58:21 +0800 Subject: [PATCH] scsi: ufs: Increase the PA_HIBERN8TIME on the host The device advertises PA_HIBERN8TIME may not be enough for some UFS devices. To workaround this issue, host should add more 100 us. The commit 8941234ea130 ("scsi: ufs: Add UFS_DEVICE_QUIRK_PA_HIBER8TIME quirk") just increase PA_HIBERN8TIME base on TX_HIBERN8TIME_CAPABILITY, we should increase PA_HIBERN8TIME directly because the RX_HIBERN8TIME_CAPABILITY may be more than TX_HIBERN8TIME_CAPABILITY. Change-Id: If5e28e11a656df999fc50014e65bc89498b28499 Signed-off-by: Ziqi Chen --- drivers/scsi/ufs/ufs-qcom.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 6706036a032b..b40416d3f5c3 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -1808,19 +1808,18 @@ static void ufshcd_parse_pm_levels(struct ufs_hba *hba) static void ufs_qcom_override_pa_h8time(struct ufs_hba *hba) { int ret; - u32 loc_tx_h8time_cap = 0; + u32 pa_h8time = 0; - ret = ufshcd_dme_get(hba, UIC_ARG_MIB_SEL(TX_HIBERN8TIME_CAPABILITY, - UIC_ARG_MPHY_TX_GEN_SEL_INDEX(0)), - &loc_tx_h8time_cap); + ret = ufshcd_dme_get(hba, UIC_ARG_MIB(PA_HIBERN8TIME), + &pa_h8time); if (ret) { - dev_err(hba->dev, "Failed getting max h8 time: %d\n", ret); + dev_err(hba->dev, "Failed getting PA_HIBERN8TIME time: %d\n", ret); return; } /* 1 implies 100 us */ ret = ufshcd_dme_set(hba, UIC_ARG_MIB(PA_HIBERN8TIME), - loc_tx_h8time_cap + 1); + pa_h8time + 1); if (ret) dev_err(hba->dev, "Failed updating PA_HIBERN8TIME: %d\n", ret);