]> git.ipfire.org Git - thirdparty/kernel/stable.git/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:41:14 +0000 (14:41 +0200)
commitc0f279a2f0520cda4d2d61c19d30b8ae8e79107b
tree0d9a6aa3e12c0a675d4f98afcb2732bb392ab927
parent587d7826e2d3f37dc5a133e05921316a50626f40
net/mlx5: Fix driver use of uninitialized timeout

[ Upstream commit 42b4f7f66a43cdb9216e76e595c8a9af154806da ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
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