ionic: start watchdog after all is setup
authorShannon Nelson <snelson@pensando.io>
Mon, 24 Jan 2022 18:52:58 +0000 (10:52 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:25 +0000 (14:23 +0200)
[ Upstream commit 9ad2939a1525962a79a2fd974ec7e3a71455b964 ]

The watchdog expects the lif to fully exist when it goes off,
so lets not start the watchdog until all is ready in case there
is some quirky time dialation that makes probe take multiple
seconds.

Fixes: 089406bc5ad6 ("ionic: add a watchdog timer to monitor heartbeat")
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>
drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
drivers/net/ethernet/pensando/ionic/ionic_dev.c

index 7e296fa71b36811c10e4d85b65c0fc74bc04a886..40fa5bce2ac2cb0fdaa1454f47230959f9b12d91 100644 (file)
@@ -331,6 +331,9 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                goto err_out_deregister_lifs;
        }
 
+       mod_timer(&ionic->watchdog_timer,
+                 round_jiffies(jiffies + ionic->watchdog_period));
+
        return 0;
 
 err_out_deregister_lifs:
@@ -348,7 +351,6 @@ err_out_port_reset:
 err_out_reset:
        ionic_reset(ionic);
 err_out_teardown:
-       del_timer_sync(&ionic->watchdog_timer);
        pci_clear_master(pdev);
        /* Don't fail the probe for these errors, keep
         * the hw interface around for inspection
index 0d6858ab511c6ecb46f58e5e2bb138a64e5d7538..1b7730308d6a155e469388a9a6d3ce463fccebe1 100644 (file)
@@ -122,9 +122,6 @@ int ionic_dev_setup(struct ionic *ionic)
        idev->fw_generation = IONIC_FW_STS_F_GENERATION &
                              ioread8(&idev->dev_info_regs->fw_status);
 
-       mod_timer(&ionic->watchdog_timer,
-                 round_jiffies(jiffies + ionic->watchdog_period));
-
        idev->db_pages = bar->vaddr;
        idev->phy_db_pages = bar->bus_addr;