@@ -1092,7 +1092,7 @@ static void mlx5_cleanup_once(struct mlx5_core_dev *dev)
1092
1092
mlx5_devcom_unregister_device (dev -> priv .devcom );
1093
1093
}
1094
1094
1095
- static int mlx5_function_setup (struct mlx5_core_dev * dev , u64 timeout )
1095
+ static int mlx5_function_setup (struct mlx5_core_dev * dev , bool boot , u64 timeout )
1096
1096
{
1097
1097
int err ;
1098
1098
@@ -1130,10 +1130,12 @@ static int mlx5_function_setup(struct mlx5_core_dev *dev, u64 timeout)
1130
1130
1131
1131
mlx5_cmd_set_state (dev , MLX5_CMDIF_STATE_UP );
1132
1132
1133
+ mlx5_start_health_poll (dev );
1134
+
1133
1135
err = mlx5_core_enable_hca (dev , 0 );
1134
1136
if (err ) {
1135
1137
mlx5_core_err (dev , "enable hca failed\n" );
1136
- goto err_cmd_cleanup ;
1138
+ goto stop_health_poll ;
1137
1139
}
1138
1140
1139
1141
err = mlx5_core_set_issi (dev );
@@ -1185,15 +1187,16 @@ static int mlx5_function_setup(struct mlx5_core_dev *dev, u64 timeout)
1185
1187
mlx5_core_err (dev , "query hca failed\n" );
1186
1188
goto reclaim_boot_pages ;
1187
1189
}
1188
-
1189
- mlx5_start_health_poll (dev );
1190
+ mlx5_start_health_fw_log_up (dev );
1190
1191
1191
1192
return 0 ;
1192
1193
1193
1194
reclaim_boot_pages :
1194
1195
mlx5_reclaim_startup_pages (dev );
1195
1196
err_disable_hca :
1196
1197
mlx5_core_disable_hca (dev , 0 );
1198
+ stop_health_poll :
1199
+ mlx5_stop_health_poll (dev , boot );
1197
1200
err_cmd_cleanup :
1198
1201
mlx5_cmd_set_state (dev , MLX5_CMDIF_STATE_DOWN );
1199
1202
mlx5_cmd_cleanup (dev );
@@ -1205,14 +1208,14 @@ static int mlx5_function_teardown(struct mlx5_core_dev *dev, bool boot)
1205
1208
{
1206
1209
int err ;
1207
1210
1208
- mlx5_stop_health_poll (dev , boot );
1209
1211
err = mlx5_cmd_teardown_hca (dev );
1210
1212
if (err ) {
1211
1213
mlx5_core_err (dev , "tear_down_hca failed, skip cleanup\n" );
1212
1214
return err ;
1213
1215
}
1214
1216
mlx5_reclaim_startup_pages (dev );
1215
1217
mlx5_core_disable_hca (dev , 0 );
1218
+ mlx5_stop_health_poll (dev , boot );
1216
1219
mlx5_cmd_set_state (dev , MLX5_CMDIF_STATE_DOWN );
1217
1220
mlx5_cmd_cleanup (dev );
1218
1221
@@ -1362,7 +1365,7 @@ int mlx5_init_one(struct mlx5_core_dev *dev)
1362
1365
mutex_lock (& dev -> intf_state_mutex );
1363
1366
dev -> state = MLX5_DEVICE_STATE_UP ;
1364
1367
1365
- err = mlx5_function_setup (dev , mlx5_tout_ms (dev , FW_PRE_INIT_TIMEOUT ));
1368
+ err = mlx5_function_setup (dev , true, mlx5_tout_ms (dev , FW_PRE_INIT_TIMEOUT ));
1366
1369
if (err )
1367
1370
goto err_function ;
1368
1371
@@ -1450,7 +1453,7 @@ int mlx5_load_one_devl_locked(struct mlx5_core_dev *dev, bool recovery)
1450
1453
timeout = mlx5_tout_ms (dev , FW_PRE_INIT_ON_RECOVERY_TIMEOUT );
1451
1454
else
1452
1455
timeout = mlx5_tout_ms (dev , FW_PRE_INIT_TIMEOUT );
1453
- err = mlx5_function_setup (dev , timeout );
1456
+ err = mlx5_function_setup (dev , false, timeout );
1454
1457
if (err )
1455
1458
goto err_function ;
1456
1459
0 commit comments