summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/pensando
diff options
context:
space:
mode:
authorShannon Nelson <snelson@pensando.io>2022-02-25 20:16:18 +0300
committerDavid S. Miller <davem@davemloft.net>2022-02-28 14:42:45 +0300
commit688a5efe0ced8e2d33624b475ecc96d31020a313 (patch)
treec7a4db04cedcca7ceafb6f7c2598b9784573517f /drivers/net/ethernet/pensando
parentb3483bc7a1f2673b35331e60668104ba2be46510 (diff)
downloadlinux-688a5efe0ced8e2d33624b475ecc96d31020a313.tar.xz
ionic: no transition while stopping
Make sure we don't try to transition the fw_status_ready while we're still in the FW_STOPPING state, else we can get stuck in limbo waiting on a transition that already happened. While we're here we can remove a superfluous check on the lif pointer. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/pensando')
-rw-r--r--drivers/net/ethernet/pensando/ionic/ionic_dev.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.c b/drivers/net/ethernet/pensando/ionic/ionic_dev.c
index faeedc8db6f4..9d0514cfeb5c 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_dev.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.c
@@ -202,21 +202,25 @@ do_check_time:
}
}
+ dev_dbg(ionic->dev, "fw_status 0x%02x ready %d idev->ready %d last_hb 0x%x state 0x%02lx\n",
+ fw_status, fw_status_ready, idev->fw_status_ready,
+ idev->last_fw_hb, lif->state[0]);
+
/* is this a transition? */
- if (fw_status_ready != idev->fw_status_ready) {
+ if (fw_status_ready != idev->fw_status_ready &&
+ !test_bit(IONIC_LIF_F_FW_STOPPING, lif->state)) {
bool trigger = false;
idev->fw_status_ready = fw_status_ready;
- if (!fw_status_ready && lif &&
+ if (!fw_status_ready &&
!test_bit(IONIC_LIF_F_FW_RESET, lif->state) &&
!test_and_set_bit(IONIC_LIF_F_FW_STOPPING, lif->state)) {
dev_info(ionic->dev, "FW stopped 0x%02x\n", fw_status);
trigger = true;
- } else if (fw_status_ready && lif &&
- test_bit(IONIC_LIF_F_FW_RESET, lif->state) &&
- !test_bit(IONIC_LIF_F_FW_STOPPING, lif->state)) {
+ } else if (fw_status_ready &&
+ test_bit(IONIC_LIF_F_FW_RESET, lif->state)) {
dev_info(ionic->dev, "FW running 0x%02x\n", fw_status);
trigger = true;
}