Skip to contentSkip to conversation

scsi: ufs: fail ufshcd_probe_hba() if power configuration fails

PATCH New Subhash Jadavani 1 participant 1 message Oct 18, 2016 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 7/11 scsi: ufs: fail ufshcd_probe_hba() if power configuration fails

From: Dov Levenglick <[email protected]>

In case the power configuration fails, skip further processing of the probing function and return immediately. This has 2 reasons:
1. Don't allow the UFS to continue running in PWM
2. Avoid multiple calls to pm_runtime_put_sync() when not in error handling or power management contexts

---
 drivers/scsi/ufs/ufshcd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/ufs/ufshcd.c +3 -1
index c6fa3c0..fced52f 100644
@@ -5051,9 +5051,11 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
 			__func__);
 	} else {
 		ret = ufshcd_config_pwr_mode(hba, &hba->max_pwr_info.info);
-		if (ret)
+		if (ret) {
 			dev_err(hba->dev, "%s: Failed setting power mode, err = %d\n",
 					__func__, ret);
+			goto out;
+		}
 	}
 
 	/* set the state as operational after switching to desired gear */
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project