From: Yevgeny Kliteynik Date: Sun, 24 Jul 2022 21:59:44 +0000 (+0300) Subject: net/mlx5: DR, Fix the SMFS sync_steering for fast teardown X-Git-Tag: v6.6.17~5932^2~338^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4193a1281ac6c209e1586b8ff07297b5a9cd8ad;p=platform%2Fkernel%2Flinux-rpi.git net/mlx5: DR, Fix the SMFS sync_steering for fast teardown If sync happens when the device is in fast teardown, just bail and don't do anything, because the PCI device is not there any more. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c index 16d65fe..b4739ea 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c @@ -271,6 +271,13 @@ int mlx5dr_cmd_sync_steering(struct mlx5_core_dev *mdev) { u32 in[MLX5_ST_SZ_DW(sync_steering_in)] = {}; + /* Skip SYNC in case the device is internal error state. + * Besides a device error, this also happens when we're + * in fast teardown + */ + if (mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) + return 0; + MLX5_SET(sync_steering_in, in, opcode, MLX5_CMD_OP_SYNC_STEERING); return mlx5_cmd_exec_in(mdev, sync_steering, in);