Commit a30297d3 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

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 #1 adds the necessary
call to shutdown the FW logging DMA during PCI shutdown.  Patch #3 fixes
a possible null pointer derefernce when using early versions of the FW
with this feature.  Patch #4 adds the coredump header information
unconditionally to make it more robust.

Patch #2 fixes a possible memory leak during PTP shutdown.  Patch #5
eliminates a dmesg warning when doing devlink reload.
====================

Link: https://patch.msgid.link/20251104005700.542174-1-michael.chan@broadcom.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents c3838262 5204943a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -12439,7 +12439,7 @@ static int bnxt_try_recover_fw(struct bnxt *bp)
	return -ENODEV;
}

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

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

	if (bnxt_hwrm_func_drv_unrgtr(bp)) {
		pcie_flr(pdev);
		goto shutdown_exit;
	}
	bnxt_ptp_clear(bp);
	bnxt_clear_int_mode(bp);
	pci_disable_device(pdev);
+2 −1
Original line number Diff line number Diff line
@@ -2149,7 +2149,7 @@ struct bnxt_bs_trace_info {
static inline void bnxt_bs_trace_check_wrap(struct bnxt_bs_trace_info *bs_trace,
					    u32 offset)
{
	if (!bs_trace->wrapped &&
	if (!bs_trace->wrapped && bs_trace->magic_byte &&
	    *bs_trace->magic_byte != BNXT_TRACE_BUF_MAGIC_BYTE)
		bs_trace->wrapped = 1;
	bs_trace->last_offset = offset;
@@ -2941,6 +2941,7 @@ void bnxt_report_link(struct bnxt *bp);
int bnxt_update_link(struct bnxt *bp, bool chng_link_state);
int bnxt_hwrm_set_pause(struct bnxt *);
int bnxt_hwrm_set_link_setting(struct bnxt *, bool, bool);
void bnxt_clear_reservations(struct bnxt *bp, bool fw_reset);
int bnxt_cancel_reservations(struct bnxt *bp, bool fw_reset);
int bnxt_hwrm_alloc_wol_fltr(struct bnxt *bp);
int bnxt_hwrm_free_wol_fltr(struct bnxt *bp);
+3 −2
Original line number Diff line number Diff line
@@ -333,13 +333,14 @@ static void bnxt_fill_drv_seg_record(struct bnxt *bp,
	u32 offset = 0;
	int rc = 0;

	record->max_entries = cpu_to_le32(ctxm->max_entries);
	record->entry_size = cpu_to_le32(ctxm->entry_size);

	rc = bnxt_dbg_hwrm_log_buffer_flush(bp, type, 0, &offset);
	if (rc)
		return;

	bnxt_bs_trace_check_wrap(bs_trace, offset);
	record->max_entries = cpu_to_le32(ctxm->max_entries);
	record->entry_size = cpu_to_le32(ctxm->entry_size);
	record->offset = cpu_to_le32(bs_trace->last_offset);
	record->wrapped = bs_trace->wrapped;
}
+1 −1
Original line number Diff line number Diff line
@@ -461,7 +461,7 @@ static int bnxt_dl_reload_down(struct devlink *dl, bool netns_change,
			rtnl_unlock();
			break;
		}
		bnxt_cancel_reservations(bp, false);
		bnxt_clear_reservations(bp, false);
		bnxt_free_ctx_mem(bp, false);
		break;
	}
+2 −2
Original line number Diff line number Diff line
@@ -1051,10 +1051,10 @@ static void bnxt_ptp_free(struct bnxt *bp)
	if (ptp->ptp_clock) {
		ptp_clock_unregister(ptp->ptp_clock);
		ptp->ptp_clock = NULL;
	}
	kfree(ptp->ptp_info.pin_config);
	ptp->ptp_info.pin_config = NULL;
}
}

int bnxt_ptp_init(struct bnxt *bp)
{