Skip to content

Commit 8844d5c

Browse files
author
Shruti Parab
committed
bnxt_en: delay pci_alloc_irq_vectors() in the AER path
JIRA: https://issues.redhat.com/browse/RHEL-76568 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: Shruti Parab <shruti.parab@broadcom.com>
1 parent 17dea41 commit 8844d5c

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
@@ -12197,12 +12197,15 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
1219712197
{
1219812198
struct hwrm_func_drv_if_change_output *resp;
1219912199
struct hwrm_func_drv_if_change_input *req;
12200-
bool fw_reset = !bp->irq_tbl;
1220112200
bool resc_reinit = false;
1220212201
bool caps_change = false;
1220312202
int rc, retry = 0;
12203+
bool fw_reset;
1220412204
u32 flags = 0;
1220512205

12206+
fw_reset = (bp->fw_reset_state == BNXT_FW_RESET_STATE_ABORT);
12207+
bp->fw_reset_state = 0;
12208+
1220612209
if (!(bp->fw_cap & BNXT_FW_CAP_IF_CHANGE))
1220712210
return 0;
1220812211

@@ -14704,7 +14707,7 @@ static void bnxt_fw_reset_abort(struct bnxt *bp, int rc)
1470414707
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
1470514708
if (bp->fw_reset_state != BNXT_FW_RESET_STATE_POLL_VF)
1470614709
bnxt_dl_health_fw_status_update(bp, false);
14707-
bp->fw_reset_state = 0;
14710+
bp->fw_reset_state = BNXT_FW_RESET_STATE_ABORT;
1470814711
dev_close(bp->dev);
1470914712
}
1471014713

@@ -16787,10 +16790,9 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
1678716790
if (!err)
1678816791
result = PCI_ERS_RESULT_RECOVERED;
1678916792

16793+
/* IRQ will be initialized later in bnxt_io_resume */
1679016794
bnxt_ulp_irq_stop(bp);
1679116795
bnxt_clear_int_mode(bp);
16792-
err = bnxt_init_int_mode(bp);
16793-
bnxt_ulp_irq_restart(bp, err);
1679416796
}
1679516797

1679616798
reset_exit:
@@ -16819,10 +16821,13 @@ static void bnxt_io_resume(struct pci_dev *pdev)
1681916821

1682016822
err = bnxt_hwrm_func_qcaps(bp);
1682116823
if (!err) {
16822-
if (netif_running(netdev))
16824+
if (netif_running(netdev)) {
1682316825
err = bnxt_open(netdev);
16824-
else
16826+
} else {
1682516827
err = bnxt_reserve_rings(bp, true);
16828+
if (!err)
16829+
err = bnxt_init_int_mode(bp);
16830+
}
1682616831
}
1682716832

1682816833
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)