]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5: Handle sync reset abort event
authorMoshe Shemesh <moshe@mellanox.com>
Wed, 7 Oct 2020 06:00:51 +0000 (09:00 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 9 Oct 2020 19:06:53 +0000 (12:06 -0700)
If firmware sends sync_reset_abort to driver the driver should clear the
reset requested mode as reset is not expected any more.

Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c

index 26caf65e9f5f65ba02009ef8895a2038befc5a78..56ae72e016f122d17bab891a68dccdabe1f6e4dc 100644 (file)
@@ -14,6 +14,7 @@ struct mlx5_fw_reset {
        struct work_struct reset_request_work;
        struct work_struct reset_reload_work;
        struct work_struct reset_now_work;
+       struct work_struct reset_abort_work;
        unsigned long reset_flags;
        struct timer_list timer;
 };
@@ -271,6 +272,16 @@ done:
        mlx5_load_one(dev, false);
 }
 
+static void mlx5_sync_reset_abort_event(struct work_struct *work)
+{
+       struct mlx5_fw_reset *fw_reset = container_of(work, struct mlx5_fw_reset,
+                                                     reset_abort_work);
+       struct mlx5_core_dev *dev = fw_reset->dev;
+
+       mlx5_sync_reset_clear_reset_requested(dev, true);
+       mlx5_core_warn(dev, "PCI Sync FW Update Reset Aborted.\n");
+}
+
 static void mlx5_sync_reset_events_handle(struct mlx5_fw_reset *fw_reset, struct mlx5_eqe *eqe)
 {
        struct mlx5_eqe_sync_fw_update *sync_fw_update_eqe;
@@ -285,6 +296,9 @@ static void mlx5_sync_reset_events_handle(struct mlx5_fw_reset *fw_reset, struct
        case MLX5_SYNC_RST_STATE_RESET_NOW:
                queue_work(fw_reset->wq, &fw_reset->reset_now_work);
                break;
+       case MLX5_SYNC_RST_STATE_RESET_ABORT:
+               queue_work(fw_reset->wq, &fw_reset->reset_abort_work);
+               break;
        }
 }
 
@@ -335,6 +349,7 @@ int mlx5_fw_reset_init(struct mlx5_core_dev *dev)
        INIT_WORK(&fw_reset->reset_request_work, mlx5_sync_reset_request_event);
        INIT_WORK(&fw_reset->reset_reload_work, mlx5_sync_reset_reload_work);
        INIT_WORK(&fw_reset->reset_now_work, mlx5_sync_reset_now_event);
+       INIT_WORK(&fw_reset->reset_abort_work, mlx5_sync_reset_abort_event);
 
        return 0;
 }