]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.11.9/net-mlx5-wait-for-fw-readiness-before-initializing-command-interface.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.11.9 / net-mlx5-wait-for-fw-readiness-before-initializing-command-interface.patch
1 From foo@baz Thu Jun 29 18:58:00 CEST 2017
2 From: Eli Cohen <eli@mellanox.com>
3 Date: Thu, 8 Jun 2017 11:33:16 -0500
4 Subject: net/mlx5: Wait for FW readiness before initializing command interface
5
6 From: Eli Cohen <eli@mellanox.com>
7
8
9 [ Upstream commit 6c780a0267b8a1075f40b39851132eeaefefcff5 ]
10
11 Before attempting to initialize the command interface we must wait till
12 the fw_initializing bit is clear.
13
14 If we fail to meet this condition the hardware will drop our
15 configuration, specifically the descriptors page address. This scenario
16 can happen when the firmware is still executing an FLR flow and did not
17 finish yet so the driver needs to wait for that to finish.
18
19 Fixes: e3297246c2c8 ('net/mlx5_core: Wait for FW readiness on startup')
20 Signed-off-by: Eli Cohen <eli@mellanox.com>
21 Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23 ---
24 drivers/net/ethernet/mellanox/mlx5/core/main.c | 14 ++++++++++++--
25 1 file changed, 12 insertions(+), 2 deletions(-)
26
27 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
28 +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
29 @@ -175,8 +175,9 @@ static struct mlx5_profile profile[] = {
30 },
31 };
32
33 -#define FW_INIT_TIMEOUT_MILI 2000
34 -#define FW_INIT_WAIT_MS 2
35 +#define FW_INIT_TIMEOUT_MILI 2000
36 +#define FW_INIT_WAIT_MS 2
37 +#define FW_PRE_INIT_TIMEOUT_MILI 10000
38
39 static int wait_fw_init(struct mlx5_core_dev *dev, u32 max_wait_mili)
40 {
41 @@ -1021,6 +1022,15 @@ static int mlx5_load_one(struct mlx5_cor
42 */
43 dev->state = MLX5_DEVICE_STATE_UP;
44
45 + /* wait for firmware to accept initialization segments configurations
46 + */
47 + err = wait_fw_init(dev, FW_PRE_INIT_TIMEOUT_MILI);
48 + if (err) {
49 + dev_err(&dev->pdev->dev, "Firmware over %d MS in pre-initializing state, aborting\n",
50 + FW_PRE_INIT_TIMEOUT_MILI);
51 + goto out;
52 + }
53 +
54 err = mlx5_cmd_init(dev);
55 if (err) {
56 dev_err(&pdev->dev, "Failed initializing command interface, aborting\n");