bnxt_en: Bug fixes.
Michael Chan
maintainercover bnxt_en: Bug fixes.
Four fixes related to the bnxt_en driver's resume path, AER reset, and the timer function.
Michael Chan (3):
bnxt_en: Simplify bnxt_resume().
bnxt_en: Re-enable SRIOV during resume.
bnxt_en: Fix AER reset logic on 57500 chips.
Vasundhara Volam (1):
bnxt_en: Return from timer if interface is not in open state.
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 35 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 18 deletions(-)
Signature · 1 line
1.8.3.1
Michael Chan
maintainerPATCH 1/4 bnxt_en: Simplify bnxt_resume().
The separate steps we do in bnxt_resume() can be done more simply by calling bnxt_hwrm_func_qcaps(). This change will add an extra __bnxt_hwrm_func_qcaps() call which is needed anyway on older firmware.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -12
@@ -12133,19 +12133,9 @@ static int bnxt_resume(struct device *device) goto resume_exit; } -if (bnxt_hwrm_queue_qportcfg (bp)) { - rc = -ENODEV ; + rc =bnxt_hwrm_func_qcaps (bp); +if (rc) 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);if (bnxt_hwrm_func_drv_rgtr (bp,NULL ,0 , false)) { rc = -ENODEV ;
Signature · 1 line
1.8.3.1
Michael Chan
maintainerPATCH 2/4 bnxt_en: Re-enable SRIOV during resume.
In reply to Michael ChanIf VFs are enabled, we need to re-configure them during resume because firmware has been reset while resuming. Otherwise, the VFs won't work after resume.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -0
@@ -12151,6 +12151,8 @@ static int bnxt_resume(struct device *device) resume_exit:bnxt_ulp_start (bp, rc); +if (!rc) +bnxt_reenable_sriov (bp);rtnl_unlock ();return rc; }
Signature · 1 line
1.8.3.1
Michael Chan
maintainerPATCH 3/4 bnxt_en: Fix AER reset logic on 57500 chips.
In reply to Michael ChanAER reset should follow the same steps as suspend/resume. We need to free context memory during AER reset and allocate new context memory during recovery by calling bnxt_hwrm_func_qcaps(). We also need to call bnxt_reenable_sriov() to restore the VFs.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +12 -5
@@ -12196,6 +12196,9 @@ static pci_ers_result_t bnxt_io_error_detected(struct pci_dev *pdev,bnxt_close (netdev);pci_disable_device (pdev); +bnxt_free_ctx_mem (bp); +kfree (bp->ctx); + bp->ctx =NULL ;rtnl_unlock ();/* Request a slot slot reset. */
@@ -12229,12 +12232,16 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)pci_set_master (pdev); err =bnxt_hwrm_func_reset (bp); -if (!err &&netif_running (netdev)) - err =bnxt_open (netdev); - -if (!err) - result =PCI_ERS_RESULT_RECOVERED ; +if (!err) { + err =bnxt_hwrm_func_qcaps (bp); +if (!err &&netif_running (netdev)) + err =bnxt_open (netdev); + }bnxt_ulp_start (bp, err); +if (!err) { +bnxt_reenable_sriov (bp); + result =PCI_ERS_RESULT_RECOVERED ; + } }if (result !=PCI_ERS_RESULT_RECOVERED ) {
Signature · 1 line
1.8.3.1
Michael Chan
maintainerPATCH 4/4 bnxt_en: Return from timer if interface is not in open state.
In reply to Michael ChanFrom: Vasundhara Volam <[email protected]>
This will avoid many uneccessary error logs when driver or firmware is in reset.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -1
@@ -10037,7 +10037,7 @@ static void bnxt_timer(struct timer_list *t)struct bnxt *bp =from_timer (bp, t, timer);struct net_device *dev = bp->dev; -if (!netif_running (dev)) +if (!netif_running (dev) || !test_bit (BNXT_STATE_OPEN , &bp->state))return ;if (atomic_read (&bp->intr_sem) !=0 )
Signature · 1 line
1.8.3.1
David Miller
maintainerFrom: Michael Chan <[email protected]>
Date: Sun, 14 Jun 2020 19:57:06 -0400
Quoted 2 lines
Four fixes related to the
bnxt_endriver's resume path, AER reset, and the timer function.
Series applied, thanks Michael.