Skip to content

Commit a30297d

Browse files
committed
Merge branch 'bnxt_en-bug-fixes'
Michael Chan says: ==================== bnxt_en: Bug fixes Patches 1, 3, and 4 are bug fixes related to the FW log tracing driver coredump feature recently added in 6.13. Patch kernel-patches#1 adds the necessary call to shutdown the FW logging DMA during PCI shutdown. Patch kernel-patches#3 fixes a possible null pointer derefernce when using early versions of the FW with this feature. Patch kernel-patches#4 adds the coredump header information unconditionally to make it more robust. Patch kernel-patches#2 fixes a possible memory leak during PTP shutdown. Patch kernel-patches#5 eliminates a dmesg warning when doing devlink reload. ==================== Link: https://patch.msgid.link/20251104005700.542174-1-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents c383826 + 5204943 commit a30297d

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12439,7 +12439,7 @@ static int bnxt_try_recover_fw(struct bnxt *bp)
1243912439
return -ENODEV;
1244012440
}
1244112441

12442-
static void bnxt_clear_reservations(struct bnxt *bp, bool fw_reset)
12442+
void bnxt_clear_reservations(struct bnxt *bp, bool fw_reset)
1244312443
{
1244412444
struct bnxt_hw_resc *hw_resc = &bp->hw_resc;
1244512445

@@ -16892,6 +16892,10 @@ static void bnxt_shutdown(struct pci_dev *pdev)
1689216892
if (netif_running(dev))
1689316893
netif_close(dev);
1689416894

16895+
if (bnxt_hwrm_func_drv_unrgtr(bp)) {
16896+
pcie_flr(pdev);
16897+
goto shutdown_exit;
16898+
}
1689516899
bnxt_ptp_clear(bp);
1689616900
bnxt_clear_int_mode(bp);
1689716901
pci_disable_device(pdev);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2149,7 +2149,7 @@ struct bnxt_bs_trace_info {
21492149
static inline void bnxt_bs_trace_check_wrap(struct bnxt_bs_trace_info *bs_trace,
21502150
u32 offset)
21512151
{
2152-
if (!bs_trace->wrapped &&
2152+
if (!bs_trace->wrapped && bs_trace->magic_byte &&
21532153
*bs_trace->magic_byte != BNXT_TRACE_BUF_MAGIC_BYTE)
21542154
bs_trace->wrapped = 1;
21552155
bs_trace->last_offset = offset;
@@ -2941,6 +2941,7 @@ void bnxt_report_link(struct bnxt *bp);
29412941
int bnxt_update_link(struct bnxt *bp, bool chng_link_state);
29422942
int bnxt_hwrm_set_pause(struct bnxt *);
29432943
int bnxt_hwrm_set_link_setting(struct bnxt *, bool, bool);
2944+
void bnxt_clear_reservations(struct bnxt *bp, bool fw_reset);
29442945
int bnxt_cancel_reservations(struct bnxt *bp, bool fw_reset);
29452946
int bnxt_hwrm_alloc_wol_fltr(struct bnxt *bp);
29462947
int bnxt_hwrm_free_wol_fltr(struct bnxt *bp);

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,14 @@ static void bnxt_fill_drv_seg_record(struct bnxt *bp,
333333
u32 offset = 0;
334334
int rc = 0;
335335

336+
record->max_entries = cpu_to_le32(ctxm->max_entries);
337+
record->entry_size = cpu_to_le32(ctxm->entry_size);
338+
336339
rc = bnxt_dbg_hwrm_log_buffer_flush(bp, type, 0, &offset);
337340
if (rc)
338341
return;
339342

340343
bnxt_bs_trace_check_wrap(bs_trace, offset);
341-
record->max_entries = cpu_to_le32(ctxm->max_entries);
342-
record->entry_size = cpu_to_le32(ctxm->entry_size);
343344
record->offset = cpu_to_le32(bs_trace->last_offset);
344345
record->wrapped = bs_trace->wrapped;
345346
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ static int bnxt_dl_reload_down(struct devlink *dl, bool netns_change,
461461
rtnl_unlock();
462462
break;
463463
}
464-
bnxt_cancel_reservations(bp, false);
464+
bnxt_clear_reservations(bp, false);
465465
bnxt_free_ctx_mem(bp, false);
466466
break;
467467
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,9 +1051,9 @@ static void bnxt_ptp_free(struct bnxt *bp)
10511051
if (ptp->ptp_clock) {
10521052
ptp_clock_unregister(ptp->ptp_clock);
10531053
ptp->ptp_clock = NULL;
1054-
kfree(ptp->ptp_info.pin_config);
1055-
ptp->ptp_info.pin_config = NULL;
10561054
}
1055+
kfree(ptp->ptp_info.pin_config);
1056+
ptp->ptp_info.pin_config = NULL;
10571057
}
10581058

10591059
int bnxt_ptp_init(struct bnxt *bp)

0 commit comments

Comments
 (0)