Skip to content

Commit 100c08c

Browse files
Shruti Parabkuba-moo
authored andcommitted
bnxt_en: Flush FW trace before copying to the coredump
bnxt_fill_drv_seg_record() calls bnxt_dbg_hwrm_log_buffer_flush() to flush the FW trace buffer. This needs to be done before we call bnxt_copy_ctx_mem() to copy the trace data. Without this fix, the coredump may not contain all the FW traces. Fixes: 3c2179e ("bnxt_en: Add FW trace coredump segments to the coredump") Reviewed-by: Kalesh AP <[email protected]> Signed-off-by: Shruti Parab <[email protected]> Signed-off-by: Michael Chan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b74c2a2 commit 100c08c

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,23 +368,27 @@ static u32 bnxt_get_ctx_coredump(struct bnxt *bp, void *buf, u32 offset,
368368
if (!ctxm->mem_valid || !seg_id)
369369
continue;
370370

371-
if (trace)
371+
if (trace) {
372372
extra_hlen = BNXT_SEG_RCD_LEN;
373+
if (buf) {
374+
u16 trace_type = bnxt_bstore_to_trace[type];
375+
376+
bnxt_fill_drv_seg_record(bp, &record, ctxm,
377+
trace_type);
378+
}
379+
}
380+
373381
if (buf)
374382
data = buf + BNXT_SEG_HDR_LEN + extra_hlen;
383+
375384
seg_len = bnxt_copy_ctx_mem(bp, ctxm, data, 0) + extra_hlen;
376385
if (buf) {
377386
bnxt_fill_coredump_seg_hdr(bp, &seg_hdr, NULL, seg_len,
378387
0, 0, 0, comp_id, seg_id);
379388
memcpy(buf, &seg_hdr, BNXT_SEG_HDR_LEN);
380389
buf += BNXT_SEG_HDR_LEN;
381-
if (trace) {
382-
u16 trace_type = bnxt_bstore_to_trace[type];
383-
384-
bnxt_fill_drv_seg_record(bp, &record, ctxm,
385-
trace_type);
390+
if (trace)
386391
memcpy(buf, &record, BNXT_SEG_RCD_LEN);
387-
}
388392
buf += seg_len;
389393
}
390394
len += BNXT_SEG_HDR_LEN + seg_len;

0 commit comments

Comments
 (0)