]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5: Check firmware sync reset requested is set before trying to abort it
authorMoshe Shemesh <moshe@nvidia.com>
Thu, 8 Apr 2021 04:30:57 +0000 (07:30 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 2 Jun 2021 01:30:20 +0000 (18:30 -0700)
In case driver sent NACK to firmware on sync reset request, it will get
sync reset abort event while it didn't set sync reset requested mode.
Thus, on abort sync reset event handler, driver should check reset
requested is set before trying to stop sync reset poll.

Fixes: 7dd6df329d4c ("net/mlx5: Handle sync reset abort event")
Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c

index d5d57630015ffb4c94fba3c74c9ec6a095b84c43..106b50e42b464d57d39e751595152bc2e2bf4ed1 100644 (file)
@@ -349,6 +349,9 @@ static void mlx5_sync_reset_abort_event(struct work_struct *work)
                                                      reset_abort_work);
        struct mlx5_core_dev *dev = fw_reset->dev;
 
+       if (!test_bit(MLX5_FW_RESET_FLAGS_RESET_REQUESTED, &fw_reset->reset_flags))
+               return;
+
        mlx5_sync_reset_clear_reset_requested(dev, true);
        mlx5_core_warn(dev, "PCI Sync FW Update Reset Aborted.\n");
 }