]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
mlxsw: pci: Only issue reset when system is ready
authorIdo Schimmel <idosch@mellanox.com>
Thu, 19 Mar 2020 11:25:39 +0000 (13:25 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 3 Apr 2020 13:17:23 +0000 (15:17 +0200)
commitfe9b06cf7f76095504797bcedf51dce1f714728a
treec1c3eccbf4e66b2a2ce4cc93f9ad16d091a72c3b
parent0eec2870cd9397c66f4849ecff20f27fc740226e
mlxsw: pci: Only issue reset when system is ready

BugLink: https://bugs.launchpad.net/bugs/1870142
[ Upstream commit 6002059d7882c3512e6ac52fa82424272ddfcd5c ]

During initialization the driver issues a software reset command and
then waits for the system status to change back to "ready" state.

However, before issuing the reset command the driver does not check that
the system is actually in "ready" state. On Spectrum-{1,2} systems this
was always the case as the hardware initialization time is very short.
On Spectrum-3 systems this is no longer the case. This results in the
software reset command timing-out and the driver failing to load:

[ 6.347591] mlxsw_spectrum3 0000:06:00.0: Cmd exec timed-out (opcode=40(ACCESS_REG),opcode_mod=0,in_mod=0)
[ 6.358382] mlxsw_spectrum3 0000:06:00.0: Reg cmd access failed (reg_id=9023(mrsr),type=write)
[ 6.368028] mlxsw_spectrum3 0000:06:00.0: cannot register bus device
[ 6.375274] mlxsw_spectrum3: probe of 0000:06:00.0 failed with error -110

Fix this by waiting for the system to become ready both before issuing
the reset command and afterwards. In case of failure, print the last
system status to aid in debugging.

Fixes: da382875c616 ("mlxsw: spectrum: Extend to support Spectrum-3 ASIC")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
drivers/net/ethernet/mellanox/mlxsw/pci.c