@@ -898,7 +898,7 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
898
898
struct ufs_pa_layer_attr * dev_req_params )
899
899
{
900
900
struct ufs_qcom_host * host = ufshcd_get_variant (hba );
901
- struct ufs_host_params host_params ;
901
+ struct ufs_host_params * host_params = & host -> host_params ;
902
902
int ret = 0 ;
903
903
904
904
if (!dev_req_params ) {
@@ -908,12 +908,7 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
908
908
909
909
switch (status ) {
910
910
case PRE_CHANGE :
911
- ufshcd_init_host_params (& host_params );
912
-
913
- /* This driver only supports symmetic gear setting i.e., hs_tx_gear == hs_rx_gear */
914
- host_params .hs_tx_gear = host_params .hs_rx_gear = ufs_qcom_get_hs_gear (hba );
915
-
916
- ret = ufshcd_negotiate_pwr_params (& host_params , dev_max_params , dev_req_params );
911
+ ret = ufshcd_negotiate_pwr_params (host_params , dev_max_params , dev_req_params );
917
912
if (ret ) {
918
913
dev_err (hba -> dev , "%s: failed to determine capabilities\n" ,
919
914
__func__ );
@@ -1048,6 +1043,17 @@ static void ufs_qcom_advertise_quirks(struct ufs_hba *hba)
1048
1043
hba -> quirks |= UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH ;
1049
1044
}
1050
1045
1046
+ static void ufs_qcom_set_host_params (struct ufs_hba * hba )
1047
+ {
1048
+ struct ufs_qcom_host * host = ufshcd_get_variant (hba );
1049
+ struct ufs_host_params * host_params = & host -> host_params ;
1050
+
1051
+ ufshcd_init_host_params (host_params );
1052
+
1053
+ /* This driver only supports symmetic gear setting i.e., hs_tx_gear == hs_rx_gear */
1054
+ host_params -> hs_tx_gear = host_params -> hs_rx_gear = ufs_qcom_get_hs_gear (hba );
1055
+ }
1056
+
1051
1057
static void ufs_qcom_set_caps (struct ufs_hba * hba )
1052
1058
{
1053
1059
struct ufs_qcom_host * host = ufshcd_get_variant (hba );
@@ -1272,6 +1278,7 @@ static int ufs_qcom_init(struct ufs_hba *hba)
1272
1278
1273
1279
ufs_qcom_set_caps (hba );
1274
1280
ufs_qcom_advertise_quirks (hba );
1281
+ ufs_qcom_set_host_params (hba );
1275
1282
1276
1283
err = ufs_qcom_ice_init (host );
1277
1284
if (err )
0 commit comments