]> git.itanic.dy.fi Git - linux-stable/commit
net/mlx5: Fix driver use of uninitialized timeout
authorShay Drory <shayd@nvidia.com>
Mon, 27 Jun 2022 13:05:31 +0000 (16:05 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 28 Jul 2022 20:44:41 +0000 (13:44 -0700)
commit42b4f7f66a43cdb9216e76e595c8a9af154806da
treed1d5f091a9864d6cc4b61240870cda454562c59f
parent62d2664351ef37da34f6f3a3fd8ab34257d6fe30
net/mlx5: Fix driver use of uninitialized timeout

Currently, driver is setting default values to all timeouts during
function setup. The offending commit is using a timeout before
function setup, meaning: the timeout is 0 (or garbage), since no
value have been set.
This may result in failure to probe the driver:
mlx5_function_setup:1034:(pid 69850): Firmware over 4294967296 MS in pre-initializing state, aborting
probe_one:1591:(pid 69850): mlx5_init_one failed with error code -16

Hence, set default values to timeouts during tout_init()

Fixes: 37ca95e62ee2 ("net/mlx5: Increase FW pre-init timeout for health recovery")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c
drivers/net/ethernet/mellanox/mlx5/core/lib/tout.h
drivers/net/ethernet/mellanox/mlx5/core/main.c