aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMohamad Haj Yahia <mohamad@mellanox.com>2016-06-30 10:34:43 -0400
committerDavid S. Miller <davem@davemloft.net>2016-07-01 06:12:03 -0400
commit65ee67084589c1783a74b4a4a5db38d7264ec8b5 (patch)
treecdb22bab9aa9a17e0728d0ff202be063607c9b59 /include/linux
parent9cba4ebcf374c3772f6eb61f2d065294b2451b49 (diff)
net/mlx5: Add timeout handle to commands with callback
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>
Diffstat (limited to 'include/linux')
-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 80776d0c52dc..fd72ecf0ce9f 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -629,6 +629,7 @@ struct mlx5_cmd_work_ent {
629 void *uout; 629 void *uout;
630 int uout_size; 630 int uout_size;
631 mlx5_cmd_cbk_t callback; 631 mlx5_cmd_cbk_t callback;
632 struct delayed_work cb_timeout_work;
632 void *context; 633 void *context;
633 int idx; 634 int idx;
634 struct completion done; 635 struct completion done;