]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Fix fatal error handling during device load
authorShay Drory <shayd@mellanox.com>
Thu, 7 May 2020 06:32:53 +0000 (09:32 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 11 Jun 2020 22:37:51 +0000 (15:37 -0700)
commita562d1a3d6715e428f59c92ebb5770093f1287cf
tree384313d7b2a6d341e52a5f933454c2118d79afe1
parent22ecead64eaaac920f93b2174a45e3b2100ef091
net/mlx5: Fix fatal error handling during device load

Currently, in case of fatal error during mlx5_load_one(), we cannot
enter error state until mlx5_load_one() is finished, what can take
several minutes until commands will get timeouts, because these commands
can't be processed due to the fatal error.
Fix it by setting dev->state as MLX5_DEVICE_STATE_INTERNAL_ERROR before
requesting the lock.

Fixes: 724ffa656f28 ("net/mlx5: Avoid calling sleeping function by the health poll thread")
Signed-off-by: Shay Drory <shayd@mellanox.com>
Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/health.c