]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
ionic: Don't send reset commands if FW isn't running
authorBrett Creeley <brett@pensando.io>
Mon, 24 Jan 2022 18:53:00 +0000 (10:53 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:57:29 +0000 (11:57 +0200)
commit37412a56037e047380031a371c6d1e1c96f42d42
tree38c27b1f19fa07d4ee0d717a5f27aadc3d820607
parent77e189cec3d051fbadc11b7593f7210bde02fe52
ionic: Don't send reset commands if FW isn't running

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit b8fd0271dad00b953caaabe73474788d3d19e252 ]

It's possible the FW is already shutting down while the driver is being
removed and/or when the driver is going through reset. This can cause
unexpected/unnecessary errors to be printed:

eth0: DEV_CMD IONIC_CMD_PORT_RESET (12) error, IONIC_RC_ERROR (29) failed
eth1: DEV_CMD IONIC_CMD_RESET (3) error, IONIC_RC_ERROR (29) failed

Fix this by checking the FW status register before issuing the reset
commands.

Also, since err may not be assigned in ionic_port_reset(), assign it a
default value of 0, and remove an unnecessary log message.

Fixes: fbfb8031533c ("ionic: Add hardware init and device commands")
Signed-off-by: Brett Creeley <brett@pensando.io>
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 2e05de23052dd65670022a688fe6a9506cf2fa64)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/net/ethernet/pensando/ionic/ionic_dev.c
drivers/net/ethernet/pensando/ionic/ionic_dev.h
drivers/net/ethernet/pensando/ionic/ionic_main.c