aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Cohen <eli@mellanox.com>2017-06-08 12:33:16 -0400
committerSaeed Mahameed <saeedm@mellanox.com>2017-06-15 16:27:46 -0400
commit6c780a0267b8a1075f40b39851132eeaefefcff5 (patch)
tree88faa0a4921d3c504f267ae29007e64336fc6923
parent3b1bbafbfd14474fee61487552c9916ec1b25c58 (diff)
net/mlx5: Wait for FW readiness before initializing command interface
Before attempting to initialize the command interface we must wait till the fw_initializing bit is clear. If we fail to meet this condition the hardware will drop our configuration, specifically the descriptors page address. This scenario can happen when the firmware is still executing an FLR flow and did not finish yet so the driver needs to wait for that to finish. Fixes: e3297246c2c8 ('net/mlx5_core: Wait for FW readiness on startup') Signed-off-by: Eli Cohen <eli@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 4f577a5abf88..13be264587f1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -175,8 +175,9 @@ static struct mlx5_profile profile[] = {
175 }, 175 },
176}; 176};
177 177
178#define FW_INIT_TIMEOUT_MILI 2000 178#define FW_INIT_TIMEOUT_MILI 2000
179#define FW_INIT_WAIT_MS 2 179#define FW_INIT_WAIT_MS 2
180#define FW_PRE_INIT_TIMEOUT_MILI 10000
180 181
181static int wait_fw_init(struct mlx5_core_dev *dev, u32 max_wait_mili) 182static int wait_fw_init(struct mlx5_core_dev *dev, u32 max_wait_mili)
182{ 183{
@@ -1013,6 +1014,15 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv,
1013 */ 1014 */
1014 dev->state = MLX5_DEVICE_STATE_UP; 1015 dev->state = MLX5_DEVICE_STATE_UP;
1015 1016
1017 /* wait for firmware to accept initialization segments configurations
1018 */
1019 err = wait_fw_init(dev, FW_PRE_INIT_TIMEOUT_MILI);
1020 if (err) {
1021 dev_err(&dev->pdev->dev, "Firmware over %d MS in pre-initializing state, aborting\n",
1022 FW_PRE_INIT_TIMEOUT_MILI);
1023 goto out;
1024 }
1025
1016 err = mlx5_cmd_init(dev); 1026 err = mlx5_cmd_init(dev);
1017 if (err) { 1027 if (err) {
1018 dev_err(&pdev->dev, "Failed initializing command interface, aborting\n"); 1028 dev_err(&pdev->dev, "Failed initializing command interface, aborting\n");