Skip to content

Commit eee7ede

Browse files
committed
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/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 82adc45 + 20d7d1c commit eee7ede

File tree

1 file changed

+15
-2
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+15
-2
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8556,10 +8556,18 @@ static void bnxt_setup_inta(struct bnxt *bp)
85568556
bp->irq_tbl[0].handler = bnxt_inta;
85578557
}
85588558

8559+
static int bnxt_init_int_mode(struct bnxt *bp);
8560+
85598561
static int bnxt_setup_int_mode(struct bnxt *bp)
85608562
{
85618563
int rc;
85628564

8565+
if (!bp->irq_tbl) {
8566+
rc = bnxt_init_int_mode(bp);
8567+
if (rc || !bp->irq_tbl)
8568+
return rc ?: -ENODEV;
8569+
}
8570+
85638571
if (bp->flags & BNXT_FLAG_USING_MSIX)
85648572
bnxt_setup_msix(bp);
85658573
else
@@ -8744,7 +8752,7 @@ static int bnxt_init_inta(struct bnxt *bp)
87448752

87458753
static int bnxt_init_int_mode(struct bnxt *bp)
87468754
{
8747-
int rc = 0;
8755+
int rc = -ENODEV;
87488756

87498757
if (bp->flags & BNXT_FLAG_MSIX_CAP)
87508758
rc = bnxt_init_msix(bp);
@@ -9514,7 +9522,8 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
95149522
{
95159523
struct hwrm_func_drv_if_change_output *resp = bp->hwrm_cmd_resp_addr;
95169524
struct hwrm_func_drv_if_change_input req = {0};
9517-
bool resc_reinit = false, fw_reset = false;
9525+
bool fw_reset = !bp->irq_tbl;
9526+
bool resc_reinit = false;
95189527
int rc, retry = 0;
95199528
u32 flags = 0;
95209529

@@ -9557,6 +9566,7 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
95579566

95589567
if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state) && !fw_reset) {
95599568
netdev_err(bp->dev, "RESET_DONE not set during FW reset.\n");
9569+
set_bit(BNXT_STATE_ABORT_ERR, &bp->state);
95609570
return -ENODEV;
95619571
}
95629572
if (resc_reinit || fw_reset) {
@@ -9890,6 +9900,9 @@ static int bnxt_reinit_after_abort(struct bnxt *bp)
98909900
if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
98919901
return -EBUSY;
98929902

9903+
if (bp->dev->reg_state == NETREG_UNREGISTERED)
9904+
return -ENODEV;
9905+
98939906
rc = bnxt_fw_init_one(bp);
98949907
if (!rc) {
98959908
bnxt_clear_int_mode(bp);

0 commit comments

Comments
 (0)