]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Add timeout handle to commands with callback
authorMohamad Haj Yahia <mohamad@mellanox.com>
Thu, 30 Jun 2016 14:34:43 +0000 (17:34 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Jul 2016 10:12:03 +0000 (06:12 -0400)
commite4153b002098276b83a9fc808f4a00099d95752b
treecdb22bab9aa9a17e0728d0ff202be063607c9b59
parenteb8e1610713186ead09bf8108ec7dc71df9fba9f
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: 7c120481afcc ('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>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c
include/linux/mlx5/driver.h