Merge branch 'bnxt_en-Bug-fixes'

Michael Chan says:

====================
bnxt_en: Bug fixes.

Four fixes related to the bnxt_en driver's resume path, AER reset, and
the timer function.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2020-06-15 13:28:33 -07:00
Родитель 38af8f2d60 e000940473
Коммит 7c6cdf6376
1 изменённых файлов: 17 добавлений и 18 удалений

Просмотреть файл

@ -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)
@ -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;
@ -12161,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;
}
@ -12204,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. */
@ -12237,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) {