Skip to content

Commit 2cd5653

Browse files
author
Benjamin Poirier
committed
net/mlx5: Start health poll after enable hca
JIRA: https://issues.redhat.com/browse/RHEL-72227 JIRA: https://issues.redhat.com/browse/RHEL-73520 Upstream-status: v6.15-rc1 commit 1726ad0 Author: Moshe Shemesh <moshe@nvidia.com> Date: Tue Mar 18 22:51:17 2025 +0200 net/mlx5: Start health poll after enable hca The health poll mechanism performs periodic checks to detect firmware errors. One of the checks verifies the function is still enabled on firmware side, but the function is enabled only after enable_hca command completed. Start health poll after enable_hca command to avoid a race between function enabled and first health polling. Fixes: 9b98d39 ("net/mlx5: Start health poll at earlier stage of driver load") Signed-off-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Shay Drori <shayd@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Link: https://patch.msgid.link/1742331077-102038-3-git-send-email-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Benjamin Poirier <bpoirier@redhat.com>
1 parent 43c6f7f commit 2cd5653

File tree

1 file changed

+7
-8
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+7
-8
lines changed

drivers/net/ethernet/mellanox/mlx5/core/main.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,24 +1210,24 @@ static int mlx5_function_enable(struct mlx5_core_dev *dev, bool boot, u64 timeou
12101210
dev->caps.embedded_cpu = mlx5_read_embedded_cpu(dev);
12111211
mlx5_cmd_set_state(dev, MLX5_CMDIF_STATE_UP);
12121212

1213-
mlx5_start_health_poll(dev);
1214-
12151213
err = mlx5_core_enable_hca(dev, 0);
12161214
if (err) {
12171215
mlx5_core_err(dev, "enable hca failed\n");
1218-
goto stop_health_poll;
1216+
goto err_cmd_cleanup;
12191217
}
12201218

1219+
mlx5_start_health_poll(dev);
1220+
12211221
err = mlx5_core_set_issi(dev);
12221222
if (err) {
12231223
mlx5_core_err(dev, "failed to set issi\n");
1224-
goto err_disable_hca;
1224+
goto stop_health_poll;
12251225
}
12261226

12271227
err = mlx5_satisfy_startup_pages(dev, 1);
12281228
if (err) {
12291229
mlx5_core_err(dev, "failed to allocate boot pages\n");
1230-
goto err_disable_hca;
1230+
goto stop_health_poll;
12311231
}
12321232

12331233
err = mlx5_tout_query_dtor(dev);
@@ -1240,10 +1240,9 @@ static int mlx5_function_enable(struct mlx5_core_dev *dev, bool boot, u64 timeou
12401240

12411241
reclaim_boot_pages:
12421242
mlx5_reclaim_startup_pages(dev);
1243-
err_disable_hca:
1244-
mlx5_core_disable_hca(dev, 0);
12451243
stop_health_poll:
12461244
mlx5_stop_health_poll(dev, boot);
1245+
mlx5_core_disable_hca(dev, 0);
12471246
err_cmd_cleanup:
12481247
mlx5_cmd_set_state(dev, MLX5_CMDIF_STATE_DOWN);
12491248
mlx5_cmd_disable(dev);
@@ -1254,8 +1253,8 @@ static int mlx5_function_enable(struct mlx5_core_dev *dev, bool boot, u64 timeou
12541253
static void mlx5_function_disable(struct mlx5_core_dev *dev, bool boot)
12551254
{
12561255
mlx5_reclaim_startup_pages(dev);
1257-
mlx5_core_disable_hca(dev, 0);
12581256
mlx5_stop_health_poll(dev, boot);
1257+
mlx5_core_disable_hca(dev, 0);
12591258
mlx5_cmd_set_state(dev, MLX5_CMDIF_STATE_DOWN);
12601259
mlx5_cmd_disable(dev);
12611260
}

0 commit comments

Comments
 (0)