summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/broadcom
diff options
context:
space:
mode:
authorMichael Chan <michael.chan@broadcom.com>2019-11-24 06:30:39 +0300
committerJakub Kicinski <jakub.kicinski@netronome.com>2019-11-25 01:48:02 +0300
commitef02af8c8ece3d6fb01fe267c1c7622399bc34f6 (patch)
treedc88c00bc0243fa856f4a4040cfb5d1eec2fa625 /drivers/net/ethernet/broadcom
parentfb4cd81e4c03efa54b82e81e2a4afc092c061384 (diff)
downloadlinux-ef02af8c8ece3d6fb01fe267c1c7622399bc34f6.tar.xz
bnxt_en: Disable/enable Bus master during suspend/resume.
Disable Bus master during suspend to prevent DMAs after the device goes into D3hot state. The new 57500 devices may continue to DMA from context memory after the system goes into D3hot state. This may cause some PCIe errors on some system. Re-enable it during resume. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 35bc579d594a..14b610451331 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -11921,6 +11921,7 @@ static int bnxt_suspend(struct device *device)
rc = bnxt_close(dev);
}
bnxt_hwrm_func_drv_unrgtr(bp);
+ pci_disable_device(bp->pdev);
rtnl_unlock();
return rc;
}
@@ -11932,6 +11933,13 @@ static int bnxt_resume(struct device *device)
int rc = 0;
rtnl_lock();
+ rc = pci_enable_device(bp->pdev);
+ if (rc) {
+ netdev_err(dev, "Cannot re-enable PCI device during resume, err = %d\n",
+ rc);
+ goto resume_exit;
+ }
+ pci_set_master(bp->pdev);
if (bnxt_hwrm_ver_get(bp) || bnxt_hwrm_func_drv_rgtr(bp)) {
rc = -ENODEV;
goto resume_exit;