[PATCH ath-next v2 2/2] wifi: ath12k: refactor m3 and aux_uc firmware memory handling

Jeff Johnson jeff.johnson at oss.qualcomm.com
Wed Nov 4 09:52:58 PST 2026


On 11/3/2026 10:30 PM, Madhavan Ganesan wrote:
> -	m3_mem->vaddr = dma_alloc_coherent(ab->dev,
> -					   m3_len, &m3_mem->paddr,
> -					   GFP_KERNEL);
> -	if (!m3_mem->vaddr) {
> -		ath12k_err(ab, "failed to allocate memory for M3 with size %zu\n",
> -			   m3_len);
> +	mem_region->vaddr = dma_alloc_coherent(ab->dev, len, &mem_region->paddr,
> +					       GFP_KERNEL);
> +	if (!mem_region->vaddr) {
> +		ath12k_err(ab, "failed to allocate memory for %s with size %zu\n",
> +			   filename, len);

I've dropped this logging in my pending branch:
1) checkpatch complains about it since the failure is already logged by
   dma_alloc_coherent()
2) the pre-existing M3 logging doesn't trigger the checkpatch warning only
   because checkpatch has a 3-line lookback for this issue, and in the
   existing code there are four lines between the assignment and the 'if'
   statement that checks the result. had the original code only used 2 lines
   for the dma_alloc_coherent() instead of 3, it would have been flagged as
   well.
3) in the case where the memory is embedded in board-2.bin:
       if (embedded_data && embedded_len > 0)
   the filename is not applicable so the message is actually misleading

https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git/commit/?h=pending&id=f4d0341946db1dcd3c36296d7577f2444cd7d412



More information about the ath12k mailing list