net/mlx5: Avoid recovery in probe flows
[platform/kernel/linux-starfive.git] / drivers / net / ethernet / mellanox / mlx5 / core / health.c
index 86ed87d..96417c5 100644 (file)
@@ -674,6 +674,12 @@ static void mlx5_fw_fatal_reporter_err_work(struct work_struct *work)
        dev = container_of(priv, struct mlx5_core_dev, priv);
        devlink = priv_to_devlink(dev);
 
+       mutex_lock(&dev->intf_state_mutex);
+       if (test_bit(MLX5_DROP_NEW_HEALTH_WORK, &health->flags)) {
+               mlx5_core_err(dev, "health works are not permitted at this stage\n");
+               return;
+       }
+       mutex_unlock(&dev->intf_state_mutex);
        enter_error_state(dev, false);
        if (IS_ERR_OR_NULL(health->fw_fatal_reporter)) {
                devl_lock(devlink);