]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
bnxt_en: Always provide max entry and entry size in coredump segments
authorKashyap Desai <kashyap.desai@broadcom.com>
Tue, 4 Nov 2025 00:56:58 +0000 (16:56 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:43 +0000 (15:37 -0500)
[ Upstream commit 28d9a84ef0ce56cc623da2a1ebf7583c00d52b31 ]

While populating firmware host logging segments for the coredump, it is
possible for the FW command that flushes the segment to fail.  When that
happens, the existing code will not update the max entry and entry size
in the segment header and this causes software that decodes the coredump
to skip the segment.

The segment most likely has already collected some DMA data, so always
update these 2 segment fields in the header to allow the decoder to
decode any data in the segment.

Fixes: 3c2179e66355 ("bnxt_en: Add FW trace coredump segments to the coredump")
Reviewed-by: Shruti Parab <shruti.parab@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20251104005700.542174-5-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_coredump.c

index a0a37216efb3b1e06ed7684ccdfc1bd7c369e3f2..b16534c1c3f116e5f4f165d85eae839ad2b1267b 100644 (file)
@@ -332,13 +332,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;
 }