]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Avoid using pending command interface slots
authorMohamad Haj Yahia <mohamad@mellanox.com>
Thu, 23 Feb 2017 09:19:36 +0000 (11:19 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 23 May 2017 13:23:31 +0000 (16:23 +0300)
commitb030b9ffaff236392b9c33df8ad748bd0d7bd24c
tree95b44e558e85cb07532eca3ae3f0644d9ae30f59
parent532d72ee08972b3b643bdd583c3680905c1841b8
net/mlx5: Avoid using pending command interface slots

Currently when firmware command gets stuck or it takes long time to
complete, the driver command will get timeout and the command slot is
freed and can be used for new commands, and if the firmware receive new
command on the old busy slot its behavior is unexpected and this could
be harmful.
To fix this when the driver command gets timeout we return failure,
but we don't free the command slot and we wait for the firmware to
explicitly respond to that command.
Once all the entries are busy we will stop processing new firmware
commands.

Fixes: eb8e16107131 ('net/mlx5: Fix potential deadlock in command mode change')
Signed-off-by: Mohamad Haj Yahia <mohamad@mellanox.com>
Cc: kernel-team@fb.com
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c
drivers/net/ethernet/mellanox/mlx5/core/eq.c
drivers/net/ethernet/mellanox/mlx5/core/health.c
include/linux/mlx5/driver.h