Skip to content

Commit d0d43c8

Browse files
committed
bnxt_en: Unregister PTP during PCI shutdown and suspend
JIRA: https://issues.redhat.com/browse/RHEL-54644 JIRA: https://issues.redhat.com/browse/RHEL-69499 commit 3661c05 Author: Michael Chan <michael.chan@broadcom.com> Date: Fri Nov 22 14:45:46 2024 -0800 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> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
1 parent f1bb812 commit d0d43c8

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
@@ -15999,6 +15999,7 @@ static void bnxt_shutdown(struct pci_dev *pdev)
1599915999
if (netif_running(dev))
1600016000
dev_close(dev);
1600116001

16002+
bnxt_ptp_clear(bp);
1600216003
bnxt_clear_int_mode(bp);
1600316004
pci_disable_device(pdev);
1600416005

@@ -16026,6 +16027,7 @@ static int bnxt_suspend(struct device *device)
1602616027
rc = bnxt_close(dev);
1602716028
}
1602816029
bnxt_hwrm_func_drv_unrgtr(bp);
16030+
bnxt_ptp_clear(bp);
1602916031
pci_disable_device(bp->pdev);
1603016032
bnxt_free_ctx_mem(bp);
1603116033
rtnl_unlock();
@@ -16069,6 +16071,10 @@ static int bnxt_resume(struct device *device)
1606916071
if (bp->fw_crash_mem)
1607016072
bnxt_hwrm_crash_dump_mem_cfg(bp);
1607116073

16074+
if (bnxt_ptp_init(bp)) {
16075+
kfree(bp->ptp_cfg);
16076+
bp->ptp_cfg = NULL;
16077+
}
1607216078
bnxt_get_wol_settings(bp);
1607316079
if (netif_running(dev)) {
1607416080
rc = bnxt_open(dev);

0 commit comments

Comments
 (0)