Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 829a9e8a authored by Subhash Jadavani's avatar Subhash Jadavani
Browse files

scsi: ufshcd: keep device rails on if link is not in OFF state



If none of the Logical Units on UFS device is power on write protected
then all UFS device power rails (VCC, VCCQ & VCCQ2) can be turned off if
UFS device is in power-off state and UFS link is in OFF state. But current
implementation would disable all device power rails even if UFS link is
not in OFF state.

Change-Id: I039e2df16eedc5c30c4473b5529e808612e53788
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent 360013b1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5292,7 +5292,7 @@ static void ufshcd_vreg_set_lpm(struct ufs_hba *hba)
	 * Ignore the error returned by ufshcd_toggle_vreg() as device is anyway
	 * in low power state which would save some power.
	 */
	if (ufshcd_is_ufs_dev_poweroff(hba) &&
	if (ufshcd_is_ufs_dev_poweroff(hba) && ufshcd_is_link_off(hba) &&
	    !hba->dev_info.is_lu_power_on_wp) {
		ufshcd_setup_vreg(hba, false);
	} else if (!ufshcd_is_ufs_dev_active(hba)) {
@@ -5308,7 +5308,7 @@ static int ufshcd_vreg_set_hpm(struct ufs_hba *hba)
{
	int ret = 0;

	if (ufshcd_is_ufs_dev_poweroff(hba) &&
	if (ufshcd_is_ufs_dev_poweroff(hba) && ufshcd_is_link_off(hba) &&
	    !hba->dev_info.is_lu_power_on_wp) {
		ret = ufshcd_setup_vreg(hba, true);
	} else if (!ufshcd_is_ufs_dev_active(hba)) {