net/mlx5: Avoid processing commands before cmdif is ready
authorEran Ben Elisha <eranbe@mellanox.com>
Thu, 19 Mar 2020 19:43:13 +0000 (21:43 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Sat, 23 May 2020 00:28:38 +0000 (17:28 -0700)
commitf7936ddd35d8b849daf0372770c7c9dbe7910fca
tree2d4d4858da7dcca9d47fef398364747526d39d3c
parentd43b7007dbd1195a5b6b83213e49b1516aaf6f5e
net/mlx5: Avoid processing commands before cmdif is ready

When driver is reloading during recovery flow, it can't get new commands
till command interface is up again. Otherwise we may get to null pointer
trying to access non initialized command structures.

Add cmdif state to avoid processing commands while cmdif is not ready.

Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c
drivers/net/ethernet/mellanox/mlx5/core/main.c
include/linux/mlx5/driver.h