]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net/mlx5: Use recovery timeout on sync reset flow
authorMoshe Shemesh <moshe@nvidia.com>
Sun, 2 Apr 2023 03:49:53 +0000 (06:49 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:25 +0000 (23:03 +0900)
[ Upstream commit dfad99750c0f83b0242572a573afa2c055f85b36 ]

Use the same timeout for sync reset flow and health recovery flow, since
the former involves driver's recovery from firmware reset, which is
similar to health recovery. Otherwise, in some cases, such as a firmware
upgrade on the DPU, the firmware pre-init bit may not be ready within
current timeout and the driver will abort loading back after reset.

Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Fixes: 37ca95e62ee2 ("net/mlx5: Increase FW pre-init timeout for health recovery")
Reviewed-by: Maher Sanalla <msanalla@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/devlink.c
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c

index 7f1f813b2f2d98eb7b8cc7153f339b2a920d3ff8..3749eb83d9e53e2ee6bddebcc6d17471ab17e316 100644 (file)
@@ -200,7 +200,7 @@ static int mlx5_devlink_reload_up(struct devlink *devlink, enum devlink_reload_a
                        break;
                /* On fw_activate action, also driver is reloaded and reinit performed */
                *actions_performed |= BIT(DEVLINK_RELOAD_ACTION_DRIVER_REINIT);
-               ret = mlx5_load_one_devl_locked(dev, false);
+               ret = mlx5_load_one_devl_locked(dev, true);
                break;
        default:
                /* Unsupported action should not get to this function */
index 2b747291803945ba424095e55d298dd168c445d3..d219f8417d93a7ac383e1b028ec25d77fd02e385 100644 (file)
@@ -154,7 +154,7 @@ static void mlx5_fw_reset_complete_reload(struct mlx5_core_dev *dev)
                if (mlx5_health_wait_pci_up(dev))
                        mlx5_core_err(dev, "reset reload flow aborted, PCI reads still not working\n");
                else
-                       mlx5_load_one(dev, false);
+                       mlx5_load_one(dev, true);
                devlink_remote_reload_actions_performed(priv_to_devlink(dev), 0,
                                                        BIT(DEVLINK_RELOAD_ACTION_DRIVER_REINIT) |
                                                        BIT(DEVLINK_RELOAD_ACTION_FW_ACTIVATE));
@@ -485,7 +485,7 @@ int mlx5_fw_reset_wait_reset_done(struct mlx5_core_dev *dev)
        err = fw_reset->ret;
        if (test_and_clear_bit(MLX5_FW_RESET_FLAGS_RELOAD_REQUIRED, &fw_reset->reset_flags)) {
                mlx5_unload_one_devl_locked(dev, false);
-               mlx5_load_one_devl_locked(dev, false);
+               mlx5_load_one_devl_locked(dev, true);
        }
 out:
        clear_bit(MLX5_FW_RESET_FLAGS_PENDING_COMP, &fw_reset->reset_flags);