summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMoshe Shemesh <moshe@mellanox.com>2019-12-27 08:01:53 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-03 09:17:32 +0300
commitf964569862c4ead5e2d2c5077809c5927e553b92 (patch)
tree074b0dab4b91cfc8304455f4e90955789f90df9e /include
parent5e2b8fc962d79f4d606ecbd0c19fa7b816d86354 (diff)
downloadlinux-f964569862c4ead5e2d2c5077809c5927e553b92.tar.xz
net/mlx5: Add command entry handling completion
[ Upstream commit 17d00e839d3b592da9659c1977d45f85b77f986a ] When FW response to commands is very slow and all command entries in use are waiting for completion we can have a race where commands can get timeout before they get out of the queue and handled. Timeout completion on uninitialized command will cause releasing command's buffers before accessing it for initialization and then we will get NULL pointer exception while trying access it. It may also cause releasing buffers of another command since we may have timeout completion before even allocating entry index for this command. Add entry handling completion to avoid this race. Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Signed-off-by: Moshe Shemesh <moshe@mellanox.com> Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mlx5/driver.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 32d445315128..983cd796cbb3 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -841,6 +841,7 @@ struct mlx5_cmd_work_ent {
struct delayed_work cb_timeout_work;
void *context;
int idx;
+ struct completion handling;
struct completion done;
struct mlx5_cmd *cmd;
struct work_struct work;