]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: No command allowed when command interface is not ready
authorHuy Nguyen <huyn@mellanox.com>
Thu, 7 Feb 2019 15:22:56 +0000 (09:22 -0600)
committerSaeed Mahameed <saeedm@mellanox.com>
Wed, 13 Feb 2019 23:40:50 +0000 (15:40 -0800)
commit325c901b3f140d94d4aefd800baaf00cacf19f4b
treec015177b037e0871fa2d032fe1b6925481a299e4
parent80c53f12ef3567b33cbac402ab4edee077f8ddf1
net/mlx5: No command allowed when command interface is not ready

When EEH is injected and PCI bus stalls, mlx5's pci error detect
function is called to deactivate the command interface and tear down
the device. The issue is that there can be a thread that already
passed MLX5_DEVICE_STATE_INTERNAL_ERROR check, it will send the command
and stuck in the wait_func.

Solution:
Add function mlx5_cmd_flush to disable command interface and clear all
the pending commands. When device state is set to
MLX5_DEVICE_STATE_INTERNAL_ERROR, call mlx5_cmd_flush to ensure all
pending threads waiting for firmware commands completion are terminated.

Fixes: 724ffa656f28 ("net/mlx5: Avoid calling sleeping function by the health poll thread")
Signed-off-by: Huy Nguyen <huyn@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c
drivers/net/ethernet/mellanox/mlx5/core/health.c
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h