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

Commit a74f79b3 authored by Bean Huo's avatar Bean Huo Committed by Stanley Chu
Browse files

UPSTREAM: scsi: ufs: Move ufshcd_get_max_pwr_mode() to ufshcd_device_params_init()

ufshcd_get_max_pwr_mode() only need to be called once while booting, take
it out from ufshcd_probe_hba() and inline into ufshcd_device_params_init().

Bug: 151050916
(cherry picked from commit 2b35b2adfecd456c98b9828e03900e7be9f1b33d)
Link: https://lore.kernel.org/r/20200120130820.1737-5-huobean@gmail.com


Reviewed-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Reviewed-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
Signed-off-by: default avatarBean Huo <beanhuo@micron.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Change-Id: I45bcece2be78cb76fe5e48179db43a65fec6f58c
parent da4217b8
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -7119,6 +7119,11 @@ static int ufshcd_device_params_init(struct ufs_hba *hba)
			QUERY_FLAG_IDN_PWR_ON_WPE, &flag))
		hba->dev_info.f_power_on_wp_en = flag;

	/* Probe maximum power mode co-supported by both UFS host and device */
	if (ufshcd_get_max_pwr_mode(hba))
		dev_err(hba->dev,
			"%s: Failed getting max supported power mode\n",
			__func__);
out:
	return ret;
}
@@ -7212,11 +7217,8 @@ static int ufshcd_probe_hba(struct ufs_hba *hba, bool async)
	ufshcd_force_reset_auto_bkops(hba);
	hba->wlun_dev_clr_ua = true;

	if (ufshcd_get_max_pwr_mode(hba)) {
		dev_err(hba->dev,
			"%s: Failed getting max supported power mode\n",
			__func__);
	} else {
	/* Gear up to HS gear if supported */
	if (hba->max_pwr_info.is_valid) {
		/*
		 * Set the right value to bRefClkFreq before attempting to
		 * switch to HS gears.