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

Commit 1bd769d7 authored by Can Guo's avatar Can Guo Committed by Todd Kjos
Browse files

FROMLIST: scsi: ufs: Use ufshcd_config_pwr_mode() when scale gear

When scale gear, use ufshcd_config_pwr_mode() instead of
ufshcd_change_power_mode() so that vops_pwr_change_notify(PRE_CHANGE)
can be utilized to allow vendors use customized settings before change
the power mode.

Bug: 150731199
Link: https://lore.kernel.org/linux-scsi/1581485910-8307-2-git-send-email-cang@codeaurora.org/


Change-Id: I8c8602b8ce3fd9fa4644e126fbd84bf564bf11e7
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
parent ba4540b7
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1128,8 +1128,7 @@ static int ufshcd_scale_gear(struct ufs_hba *hba, bool scale_up)
	}

	/* check if the power mode needs to be changed or not? */
	ret = ufshcd_change_power_mode(hba, &new_pwr_info);

	ret = ufshcd_config_pwr_mode(hba, &new_pwr_info);
	if (ret)
		dev_err(hba->dev, "%s: failed err %d, old gear: (tx %d rx %d), new gear: (tx %d rx %d)",
			__func__, ret,
@@ -4263,8 +4262,6 @@ int ufshcd_config_pwr_mode(struct ufs_hba *hba,
		memcpy(&final_params, desired_pwr_mode, sizeof(final_params));

	ret = ufshcd_change_power_mode(hba, &final_params);
	if (!ret)
		ufshcd_print_pwr_info(hba);

	return ret;
}
@@ -7103,6 +7100,7 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
					__func__, ret);
			goto out;
		}
		ufshcd_print_pwr_info(hba);
	}

	/*