]> 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)
commit18bd0b67c81cacae36150ef6228fdd1212364096
treec015177b037e0871fa2d032fe1b6925481a299e4
parent856363c75dd096d5aff49f4ab86df73529b723be
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: a9735b16eb4c ("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