OSDN Git Service

mlxsw: core: Increase timeout during firmware flash process
authorShalom Toledo <shalomt@mellanox.com>
Tue, 18 Dec 2018 15:59:20 +0000 (15:59 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Dec 2018 17:17:38 +0000 (09:17 -0800)
commitcf0b70e71b32137ccf9c1f3dd9fb30cbf89b4322
tree94a248f5c936fa2193788034cebf713e3820baeb
parenta5f3932646a74e690ed532a1f421f75c3b8cf1ec
mlxsw: core: Increase timeout during firmware flash process

During the firmware flash process, some of the EMADs get timed out, which
causes the driver to send them again with a limit of 5 retries. There are
some situations in which 5 retries is not enough and the EMAD access fails.
If the failed EMAD was related to the flashing process, the driver fails
the flashing.

The reason for these timeouts during firmware flashing is cache misses in
the CPU running the firmware. In case the CPU needs to fetch instructions
from the flash when a firmware is flashed, it needs to wait for the
flashing to complete. Since flashing takes time, it is possible for pending
EMADs to timeout.

Fix by increasing EMADs' timeout while flashing firmware.

Fixes: ce6ef68f433f ("mlxsw: spectrum: Implement the ethtool flash_device callback")
Signed-off-by: Shalom Toledo <shalomt@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core.c
drivers/net/ethernet/mellanox/mlxsw/core.h
drivers/net/ethernet/mellanox/mlxsw/spectrum.c