Skip to content

Commit 132868a

Browse files
committed
bnxt_en: delay pci_alloc_irq_vectors() in the AER path
JIRA: https://issues.redhat.com/browse/RHEL-106550 commit c2d20a3 Author: Kashyap Desai <kashyap.desai@broadcom.com> Date: Mon Apr 28 15:59:00 2025 -0700 bnxt_en: delay pci_alloc_irq_vectors() in the AER path This patch is similar to the last patch to delay the pci_alloc_irq_vectors() call in the AER path until after calling bnxt_reserve_rings(). bnxt_reserve_rings() needs to properly map the MSIX table first before we call pci_alloc_irq_vectors() which may immediately write to the MSIX table in some architectures. Move the bnxt_init_int_mode() call from bnxt_io_slot_reset() to bnxt_io_resume() after calling bnxt_reserve_rings(). With this change, the AER path may call bnxt_open() -> bnxt_hwrm_if_change() with bp->irq_tbl set to NULL. bp->irq_tbl is cleared when we call bnxt_clear_int_mode() in bnxt_io_slot_reset(). So we cannot use !bp->irq_tbl to detect aborted FW reset. Add a new BNXT_FW_RESET_STATE_ABORT to detect aborted FW reset in bnxt_hwrm_if_change(). Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
1 parent b490fb0 commit 132868a

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12221,12 +12221,15 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
1222112221
{
1222212222
struct hwrm_func_drv_if_change_output *resp;
1222312223
struct hwrm_func_drv_if_change_input *req;
12224-
bool fw_reset = !bp->irq_tbl;
1222512224
bool resc_reinit = false;
1222612225
bool caps_change = false;
1222712226
int rc, retry = 0;
12227+
bool fw_reset;
1222812228
u32 flags = 0;
1222912229

12230+
fw_reset = (bp->fw_reset_state == BNXT_FW_RESET_STATE_ABORT);
12231+
bp->fw_reset_state = 0;
12232+
1223012233
if (!(bp->fw_cap & BNXT_FW_CAP_IF_CHANGE))
1223112234
return 0;
1223212235

@@ -14728,7 +14731,7 @@ static void bnxt_fw_reset_abort(struct bnxt *bp, int rc)
1472814731
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
1472914732
if (bp->fw_reset_state != BNXT_FW_RESET_STATE_POLL_VF)
1473014733
bnxt_dl_health_fw_status_update(bp, false);
14731-
bp->fw_reset_state = 0;
14734+
bp->fw_reset_state = BNXT_FW_RESET_STATE_ABORT;
1473214735
dev_close(bp->dev);
1473314736
}
1473414737

@@ -16821,10 +16824,9 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
1682116824
if (!err)
1682216825
result = PCI_ERS_RESULT_RECOVERED;
1682316826

16827+
/* IRQ will be initialized later in bnxt_io_resume */
1682416828
bnxt_ulp_irq_stop(bp);
1682516829
bnxt_clear_int_mode(bp);
16826-
err = bnxt_init_int_mode(bp);
16827-
bnxt_ulp_irq_restart(bp, err);
1682816830
}
1682916831

1683016832
reset_exit:
@@ -16853,10 +16855,13 @@ static void bnxt_io_resume(struct pci_dev *pdev)
1685316855

1685416856
err = bnxt_hwrm_func_qcaps(bp);
1685516857
if (!err) {
16856-
if (netif_running(netdev))
16858+
if (netif_running(netdev)) {
1685716859
err = bnxt_open(netdev);
16858-
else
16860+
} else {
1685916861
err = bnxt_reserve_rings(bp, true);
16862+
if (!err)
16863+
err = bnxt_init_int_mode(bp);
16864+
}
1686016865
}
1686116866

1686216867
if (!err)

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,6 +2609,7 @@ struct bnxt {
26092609
#define BNXT_FW_RESET_STATE_POLL_FW 4
26102610
#define BNXT_FW_RESET_STATE_OPENING 5
26112611
#define BNXT_FW_RESET_STATE_POLL_FW_DOWN 6
2612+
#define BNXT_FW_RESET_STATE_ABORT 7
26122613

26132614
u16 fw_reset_min_dsecs;
26142615
#define BNXT_DFLT_FW_RST_MIN_DSECS 20

0 commit comments

Comments
 (0)