Skip to content

Commit 6a9df81

Browse files
Can Guomartinkpetersen
authored andcommitted
scsi: ufs: Use ufshcd_config_pwr_mode() when scaling gear
When scaling 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 changing power mode. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Avri Altman <[email protected]> Reviewed-by: Stanley Chu <[email protected]> Signed-off-by: Can Guo <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 60f537d commit 6a9df81

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/scsi/ufs/ufshcd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,8 +1078,7 @@ static int ufshcd_scale_gear(struct ufs_hba *hba, bool scale_up)
10781078
}
10791079

10801080
/* check if the power mode needs to be changed or not? */
1081-
ret = ufshcd_change_power_mode(hba, &new_pwr_info);
1082-
1081+
ret = ufshcd_config_pwr_mode(hba, &new_pwr_info);
10831082
if (ret)
10841083
dev_err(hba->dev, "%s: failed err %d, old gear: (tx %d rx %d), new gear: (tx %d rx %d)",
10851084
__func__, ret,
@@ -4116,8 +4115,6 @@ int ufshcd_config_pwr_mode(struct ufs_hba *hba,
41164115
memcpy(&final_params, desired_pwr_mode, sizeof(final_params));
41174116

41184117
ret = ufshcd_change_power_mode(hba, &final_params);
4119-
if (!ret)
4120-
ufshcd_print_pwr_info(hba);
41214118

41224119
return ret;
41234120
}
@@ -7131,6 +7128,7 @@ static int ufshcd_probe_hba(struct ufs_hba *hba, bool async)
71317128
__func__, ret);
71327129
goto out;
71337130
}
7131+
ufshcd_print_pwr_info(hba);
71347132
}
71357133

71367134
/*

0 commit comments

Comments
 (0)