Skip to content

Commit

Permalink
scsi: ufs: fail ufshcd_probe_hba() if power configuration fails
Browse files Browse the repository at this point in the history
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

Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Dov Levenglick authored and Martin K. Petersen committed Nov 8, 2016
1 parent a508253 commit 8643ae6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/scsi/ufs/ufshcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 8643ae6

Please sign in to comment.