diff mbox series

scsi: ufs: core: Fix return value to determine power mode restore

Message ID 20220907093935.27957-1-sh043.lee@samsung.com
State New
Headers show
Series scsi: ufs: core: Fix return value to determine power mode restore | expand

Commit Message

이승희 Sept. 7, 2022, 9:39 a.m. UTC
If LINERESET was caught, UFS might have been put to PWM mode,
check if power mode restore is needed.
Once failed to get phy adapter power mode's value,
host can't compare proper mode value.

Signed-off-by: Seunghui Lee <sh043.lee@samsung.com>
---
 drivers/ufs/core/ufshcd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 7256e6c43ca6..6f20f4655d53 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -6188,7 +6188,8 @@  static bool ufshcd_is_pwr_mode_restore_needed(struct ufs_hba *hba)
 	struct ufs_pa_layer_attr *pwr_info = &hba->pwr_info;
 	u32 mode;
 
-	ufshcd_dme_get(hba, UIC_ARG_MIB(PA_PWRMODE), &mode);
+	if (ufshcd_dme_get(hba, UIC_ARG_MIB(PA_PWRMODE), &mode))
+		return true;
 
 	if (pwr_info->pwr_rx != ((mode >> PWRMODE_RX_OFFSET) & PWRMODE_MASK))
 		return true;