Commit 72bbee2a authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'bnxt_en-Two-bug-fixes'

Michael Chan says:

====================
bnxt_en: Two bug fixes.

The first patch fixes AER recovery by reducing the time from several
minutes to a more reasonable 20 - 30 seconds.  The second patch fixes
a possible NULL pointer crash during firmware reset.
====================
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 4ddcaf1e b16939b5
...@@ -4305,7 +4305,7 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len, ...@@ -4305,7 +4305,7 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
u32 bar_offset = BNXT_GRCPF_REG_CHIMP_COMM; u32 bar_offset = BNXT_GRCPF_REG_CHIMP_COMM;
u16 dst = BNXT_HWRM_CHNL_CHIMP; u16 dst = BNXT_HWRM_CHNL_CHIMP;
if (test_bit(BNXT_STATE_FW_FATAL_COND, &bp->state)) if (BNXT_NO_FW_ACCESS(bp))
return -EBUSY; return -EBUSY;
if (msg_len > BNXT_HWRM_MAX_REQ_LEN) { if (msg_len > BNXT_HWRM_MAX_REQ_LEN) {
...@@ -5723,7 +5723,7 @@ static int hwrm_ring_free_send_msg(struct bnxt *bp, ...@@ -5723,7 +5723,7 @@ static int hwrm_ring_free_send_msg(struct bnxt *bp,
struct hwrm_ring_free_output *resp = bp->hwrm_cmd_resp_addr; struct hwrm_ring_free_output *resp = bp->hwrm_cmd_resp_addr;
u16 error_code; u16 error_code;
if (test_bit(BNXT_STATE_FW_FATAL_COND, &bp->state)) if (BNXT_NO_FW_ACCESS(bp))
return 0; return 0;
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_RING_FREE, cmpl_ring_id, -1); bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_RING_FREE, cmpl_ring_id, -1);
...@@ -7817,7 +7817,7 @@ static int bnxt_set_tpa(struct bnxt *bp, bool set_tpa) ...@@ -7817,7 +7817,7 @@ static int bnxt_set_tpa(struct bnxt *bp, bool set_tpa)
if (set_tpa) if (set_tpa)
tpa_flags = bp->flags & BNXT_FLAG_TPA; tpa_flags = bp->flags & BNXT_FLAG_TPA;
else if (test_bit(BNXT_STATE_FW_FATAL_COND, &bp->state)) else if (BNXT_NO_FW_ACCESS(bp))
return 0; return 0;
for (i = 0; i < bp->nr_vnics; i++) { for (i = 0; i < bp->nr_vnics; i++) {
rc = bnxt_hwrm_vnic_set_tpa(bp, i, tpa_flags); rc = bnxt_hwrm_vnic_set_tpa(bp, i, tpa_flags);
...@@ -11779,6 +11779,10 @@ static void bnxt_remove_one(struct pci_dev *pdev) ...@@ -11779,6 +11779,10 @@ static void bnxt_remove_one(struct pci_dev *pdev)
if (BNXT_PF(bp)) if (BNXT_PF(bp))
bnxt_sriov_disable(bp); bnxt_sriov_disable(bp);
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
bnxt_cancel_sp_work(bp);
bp->sp_event = 0;
bnxt_dl_fw_reporters_destroy(bp, true); bnxt_dl_fw_reporters_destroy(bp, true);
if (BNXT_PF(bp)) if (BNXT_PF(bp))
devlink_port_type_clear(&bp->dl_port); devlink_port_type_clear(&bp->dl_port);
...@@ -11786,9 +11790,6 @@ static void bnxt_remove_one(struct pci_dev *pdev) ...@@ -11786,9 +11790,6 @@ static void bnxt_remove_one(struct pci_dev *pdev)
unregister_netdev(dev); unregister_netdev(dev);
bnxt_dl_unregister(bp); bnxt_dl_unregister(bp);
bnxt_shutdown_tc(bp); bnxt_shutdown_tc(bp);
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
bnxt_cancel_sp_work(bp);
bp->sp_event = 0;
bnxt_clear_int_mode(bp); bnxt_clear_int_mode(bp);
bnxt_hwrm_func_drv_unrgtr(bp); bnxt_hwrm_func_drv_unrgtr(bp);
......
...@@ -1737,6 +1737,10 @@ struct bnxt { ...@@ -1737,6 +1737,10 @@ struct bnxt {
#define BNXT_STATE_FW_FATAL_COND 6 #define BNXT_STATE_FW_FATAL_COND 6
#define BNXT_STATE_DRV_REGISTERED 7 #define BNXT_STATE_DRV_REGISTERED 7
#define BNXT_NO_FW_ACCESS(bp) \
(test_bit(BNXT_STATE_FW_FATAL_COND, &(bp)->state) || \
pci_channel_offline((bp)->pdev))
struct bnxt_irq *irq_tbl; struct bnxt_irq *irq_tbl;
int total_irqs; int total_irqs;
u8 mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment