Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'bnxt_en-error-recovery-bug-fixes'

Michael Chan says:

====================
bnxt_en: Error recovery bug fixes.

Two error recovery related bug fixes for 2 corner cases.

Please queue patch #2 for -stable. Thanks.
====================

Link: https://lore.kernel.org/r/1614332590-17865-1-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+15 -2
+15 -2
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 8556 8556 bp->irq_tbl[0].handler = bnxt_inta; 8557 8557 } 8558 8558 8559 + static int bnxt_init_int_mode(struct bnxt *bp); 8560 + 8559 8561 static int bnxt_setup_int_mode(struct bnxt *bp) 8560 8562 { 8561 8563 int rc; 8564 + 8565 + if (!bp->irq_tbl) { 8566 + rc = bnxt_init_int_mode(bp); 8567 + if (rc || !bp->irq_tbl) 8568 + return rc ?: -ENODEV; 8569 + } 8562 8570 8563 8571 if (bp->flags & BNXT_FLAG_USING_MSIX) 8564 8572 bnxt_setup_msix(bp); ··· 8752 8744 8753 8745 static int bnxt_init_int_mode(struct bnxt *bp) 8754 8746 { 8755 - int rc = 0; 8747 + int rc = -ENODEV; 8756 8748 8757 8749 if (bp->flags & BNXT_FLAG_MSIX_CAP) 8758 8750 rc = bnxt_init_msix(bp); ··· 9522 9514 { 9523 9515 struct hwrm_func_drv_if_change_output *resp = bp->hwrm_cmd_resp_addr; 9524 9516 struct hwrm_func_drv_if_change_input req = {0}; 9525 - bool resc_reinit = false, fw_reset = false; 9517 + bool fw_reset = !bp->irq_tbl; 9518 + bool resc_reinit = false; 9526 9519 int rc, retry = 0; 9527 9520 u32 flags = 0; 9528 9521 ··· 9566 9557 9567 9558 if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state) && !fw_reset) { 9568 9559 netdev_err(bp->dev, "RESET_DONE not set during FW reset.\n"); 9560 + set_bit(BNXT_STATE_ABORT_ERR, &bp->state); 9569 9561 return -ENODEV; 9570 9562 } 9571 9563 if (resc_reinit || fw_reset) { ··· 9899 9889 9900 9890 if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) 9901 9891 return -EBUSY; 9892 + 9893 + if (bp->dev->reg_state == NETREG_UNREGISTERED) 9894 + return -ENODEV; 9902 9895 9903 9896 rc = bnxt_fw_init_one(bp); 9904 9897 if (!rc) {