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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 drivers/ufs/core/ufshcd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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;
-- 
2.29.0




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux