diff options
author | Mohamad Haj Yahia <mohamad@mellanox.com> | 2016-06-30 17:34:43 +0300 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2016-08-22 22:38:25 +0100 |
commit | a2666756c560e1a2b97c43345b23fbda55e62b85 (patch) | |
tree | cd62fccd6f84a0dd50a703d3f0b9061156f0d240 /include | |
parent | c92dd27038776388dbf2992e03842d89a463a627 (diff) | |
download | lwn-a2666756c560e1a2b97c43345b23fbda55e62b85.tar.gz lwn-a2666756c560e1a2b97c43345b23fbda55e62b85.zip |
net/mlx5: Add timeout handle to commands with callback
commit 65ee67084589c1783a74b4a4a5db38d7264ec8b5 upstream.
The current implementation does not handle timeout in case of command
with callback request, and this can lead to deadlock if the command
doesn't get fw response.
Add delayed callback timeout work before posting the command to fw.
In case of real fw command completion we will cancel the delayed work.
In case of fw command timeout the callback timeout handler will be
called and it will simulate fw completion with timeout error.
Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
Signed-off-by: Mohamad Haj Yahia <mohamad@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mlx5/driver.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index fd152032d779..8ab4eac0292b 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -594,6 +594,7 @@ struct mlx5_cmd_work_ent { void *uout; int uout_size; mlx5_cmd_cbk_t callback; + struct delayed_work cb_timeout_work; void *context; int idx; struct completion done; |