[PATCH 6.6.y 2/2] wifi: ath12k: copy M3 firmware when reusing the buffer
Baochen Qiang
baochen.qiang at oss.qualcomm.com
Thu Oct 15 00:38:30 PDT 2026
On 10/13/2026 12:59 AM, Artem Dinaburg wrote:
> This fixes my 6.6.y backport of upstream commit 05090ae82f44 ("wifi:
> ath12k: check M3 buffer size as well whey trying to reuse it"). There is
> no corresponding upstream commit, because upstream never had this bug.
>
> When the existing M3 buffer is large enough for the new m3.bin, my
> backport releases the firmware and returns early. The new image is never
> copied, and m3_mem->size keeps the old length. Upstream instead jumps to
> skip_m3_alloc, which copies the current image into the existing buffer
> and records its length. As a result, after recovery or resume, 6.6.y
> gives the firmware the previous M3 image whenever the new one is the
> same size or smaller. A larger image is reallocated and loaded.
>
> Replace the early return with the upstream goto skip_m3_alloc. The
> previous patch, a backport of upstream commit 00575bb44b2c ("wifi:
> ath12k: fix reusing m3 memory"), keeps the allocation size in
> total_size. So copying a smaller image no longer changes the size passed
> to dma_free_coherent().
>
> Fixes: 9a38ba5561d9 ("wifi: ath12k: check M3 buffer size as well whey trying to reuse it")
> Assisted-by: LLM
> Signed-off-by: Artem Dinaburg <artem at trailofbits.com>
Reviewed-by: Baochen Qiang <baochen.qiang at oss.qualcomm.com>
More information about the ath12k
mailing list