Skip to content

Commit 3661c05

Browse files
Michael ChanPaolo Abeni
authored andcommitted
bnxt_en: Unregister PTP during PCI shutdown and suspend
If we go through the PCI shutdown or suspend path, we shutdown the NIC but PTP remains registered. If the kernel continues to run for a little bit, the periodic PTP .do_aux_work() function may be called and it will read the PHC from the BAR register. Since the device has already been disabled, it will cause a PCIe completion timeout. Fix it by calling bnxt_ptp_clear() in the PCI shutdown/suspend handlers. bnxt_ptp_clear() will unregister from PTP and .do_aux_work() will be canceled. In bnxt_resume(), we need to re-initialize PTP. Fixes: a521c8a ("bnxt_en: Move bnxt_ptp_init() from bnxt_open() back to bnxt_init_one()") Cc: Richard Cochran <richardcochran@gmail.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 1e9614c commit 3661c05

File tree

1 file changed

+6
-0
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+6
-0
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16245,6 +16245,7 @@ static void bnxt_shutdown(struct pci_dev *pdev)
1624516245
if (netif_running(dev))
1624616246
dev_close(dev);
1624716247

16248+
bnxt_ptp_clear(bp);
1624816249
bnxt_clear_int_mode(bp);
1624916250
pci_disable_device(pdev);
1625016251

@@ -16272,6 +16273,7 @@ static int bnxt_suspend(struct device *device)
1627216273
rc = bnxt_close(dev);
1627316274
}
1627416275
bnxt_hwrm_func_drv_unrgtr(bp);
16276+
bnxt_ptp_clear(bp);
1627516277
pci_disable_device(bp->pdev);
1627616278
bnxt_free_ctx_mem(bp, false);
1627716279
rtnl_unlock();
@@ -16315,6 +16317,10 @@ static int bnxt_resume(struct device *device)
1631516317
if (bp->fw_crash_mem)
1631616318
bnxt_hwrm_crash_dump_mem_cfg(bp);
1631716319

16320+
if (bnxt_ptp_init(bp)) {
16321+
kfree(bp->ptp_cfg);
16322+
bp->ptp_cfg = NULL;
16323+
}
1631816324
bnxt_get_wol_settings(bp);
1631916325
if (netif_running(dev)) {
1632016326
rc = bnxt_open(dev);

0 commit comments

Comments
 (0)