From: Ali Ahmet Memis <ali@iusegentoo.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: neeraj.sanjaykale@nxp.com, amitkumar.karwar@nxp.com,
marcel@holtmann.org, alex.zhou@nxp.com, song.xue_1@nxp.com,
linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: btnxpuart: Keep FW dump header in coredump chunks
Date: Tue, 18 Aug 2026 16:24:30 +0000 [thread overview]
Message-ID: <20260818162501.584425-1-ali@iusegentoo.com> (raw)
In-Reply-To: <CABBYNZ+yDwFJ7YFB60-SG6Tr1R+6BeE1E=06d5+UEK_y4j7g+Q@mail.gmail.com>
Hi Luiz,
On Tue, Aug 18, 2026 at 11:51 AM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> Ok, but if that is the case why are we parsing the headers in the
> kernel? I thought the idea was that the kernel would assemble all the
> segments and then push the dump as a whole. However, the above
> suggests the NXP FW analyzer expects the headers. In that case I would
> just have each segment reported on its own rather than appending it to
> a separate skb including the headers.
The two fields are not just optional parsing for a concatenated
dump. They are what the driver uses to handle the dump state.
seq_num == 0x0001 tells us that a new dump has started, so
hci_devcd_init() is called. buf_len == 0 marks the end of the dump,
so hci_devcd_complete() is called.
The chunks are passed to hci_devcd_append() as they
arrive. nxp_process_fw_dump() does not check whether the dump is
currently active before calling it. That state is handled by the
coredump code itself.
> Id argue that this should be appended as is then, and the analyzer
> should be the one checking it, _or_ it needs changing and then it only
> process the dump _after_ reassemble.
The driver also does not otherwise interpret the chunk contents. It
does not validate the payload length against buf_len, slice the
payload, or remove anything from it. Once the chunk is long enough
to contain the header, the whole skb is passed to hci_devcd_append()
as-is, including the header.
So the length check is only there to make reading seq_num and buf_len
safe. It does not change what gets appended.
The only packets we drop are those that are too short to contain
the header. Without the header, there is no seq_num or buf_len,
so we cannot determine whether the packet starts or ends a dump.
next prev parent reply other threads:[~2026-08-18 16:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AS4PR04MB969206113CDC2F5C66994E6EE7A62@AS4PR04MB9692.eurprd04.prod.outlook.com>
2026-08-18 8:00 ` Ali Ahmet Memis
2026-08-18 9:42 ` Neeraj Kale
2026-08-18 15:51 ` Luiz Augusto von Dentz
2026-08-18 16:24 ` Ali Ahmet Memis [this message]
2026-08-18 16:59 ` Luiz Augusto von Dentz
2026-08-18 19:30 ` Ali Ahmet Memis
2026-08-18 19:58 ` Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260818162501.584425-1-ali@iusegentoo.com \
--to=ali@iusegentoo.com \
--cc=alex.zhou@nxp.com \
--cc=amitkumar.karwar@nxp.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=neeraj.sanjaykale@nxp.com \
--cc=song.xue_1@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®