summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom
diff options
context:
space:
mode:
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>2019-11-23 22:30:43 -0500
committerJakub Kicinski <jakub.kicinski@netronome.com>2019-11-24 14:48:02 -0800
commitf9b69d7f62796b33657c98e0d3ca3be763f70fa4 (patch)
tree6e7f23c563f95025113e315f1596683303dccc5d /drivers/net/ethernet/broadcom
parentf92335d830059f3f9db950f0af49405d287924d5 (diff)
downloadlinux-stable-f9b69d7f62796b33657c98e0d3ca3be763f70fa4.tar.gz
linux-stable-f9b69d7f62796b33657c98e0d3ca3be763f70fa4.tar.bz2
linux-stable-f9b69d7f62796b33657c98e0d3ca3be763f70fa4.zip
bnxt_en: Fix suspend/resume path on 57500 chips
Driver calls HWRM_FUNC_RESET firmware call while resuming the device which clears the context memory backing store. Because of which allocating firmware resources would eventually fail. Fix it by freeing all context memory during suspend and reallocate the memory during resume. Call bnxt_hwrm_queue_qportcfg() in resume path. This firmware call is needed on the 57500 chips so that firmware will set up the proper queue mapping in relation to the context memory. Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> 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.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 69d7ab1d01db..6a12ab5b8830 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -11916,6 +11916,9 @@ static int bnxt_suspend(struct device *device)
}
bnxt_hwrm_func_drv_unrgtr(bp);
pci_disable_device(bp->pdev);
+ bnxt_free_ctx_mem(bp);
+ kfree(bp->ctx);
+ bp->ctx = NULL;
rtnl_unlock();
return rc;
}
@@ -11944,6 +11947,17 @@ static int bnxt_resume(struct device *device)
goto resume_exit;
}
+ if (bnxt_hwrm_queue_qportcfg(bp)) {
+ rc = -ENODEV;
+ goto resume_exit;
+ }
+
+ if (bp->hwrm_spec_code >= 0x10803) {
+ if (bnxt_alloc_ctx_mem(bp)) {
+ rc = -ENODEV;
+ goto resume_exit;
+ }
+ }
if (BNXT_NEW_RM(bp))
bnxt_hwrm_func_resc_qcaps(bp, false);