All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: core: Fix return value to determine power mode restore
       [not found] <CGME20220907090416epcas1p12f1b98b307ffe88034a359041bd33bff@epcas1p1.samsung.com>
@ 2022-09-07  9:39 ` Seunghui Lee
  0 siblings, 0 replies; only message in thread
From: Seunghui Lee @ 2022-09-07  9:39 UTC (permalink / raw)
  To: linux-scsi, martin.petersen; +Cc: Seunghui Lee

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-07  9:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20220907090416epcas1p12f1b98b307ffe88034a359041bd33bff@epcas1p1.samsung.com>
2022-09-07  9:39 ` [PATCH] scsi: ufs: core: Fix return value to determine power mode restore Seunghui Lee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.