[<prev] [next>] [day] [month] [year] [list]
Message-ID: <ead32f5b-730a-4b81-b38f-93d822f990c6@collabora.com>
Date: Thu, 19 Jun 2025 15:27:50 +0500
From: Muhammad Usama Anjum <usama.anjum@...labora.com>
To: Manivannan Sadhasivam <mani@...nel.org>,
Jeff Johnson <jjohnson@...nel.org>, quic_bqiang@...cinc.com,
jeff.hugo@....qualcomm.com
Cc: mhi@...ts.linux.dev, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org, ath11k@...ts.infradead.org,
linux-wireless@...r.kernel.org, ath12k@...ts.infradead.org,
sumit.garg@...nel.org
Subject: [Bug Report] mhi: ath11k: dma_alloc_coherent() failures during resume
Hi,
When there is memory pressure during resume and no DMA memory is available,
the ath11k driver fails to resume. The driver currently frees its DMA memory
during suspend or hibernate, and attempts to re-allocate it during resume.
However, if the DMA memory has been consumed by other software in the
meantime, these allocations can fail, leading to critical failures in the WiFi
driver.
Although I have recently fixed several instances to ensure DMA memory is not
freed once allocated, we continue to receive reports of failures. I was
preparing to submit a patch for the another case, but this issue cannot be
fully resolved as long as even one DMA allocation remains in the resume path.
The following functions are allocating dma memory in resume path:
<function> <size> <index>
mhi_init_dev_ctxt dma_alloc_coherent(5632)
mhi_init_dev_ctxt dma_alloc_coherent(88)
mhi_alloc_aligned_ring dma_alloc_coherent(1023)
mhi_alloc_aligned_ring dma_alloc_coherent(8191)
mhi_init_dev_ctxt dma_alloc_coherent(44)
mhi_alloc_aligned_ring dma_alloc_coherent(4095)
mhi_alloc_aligned_ring dma_alloc_coherent(2047)
mhi_alloc_aligned_ring dma_alloc_coherent(2047)
ath11k_hal_alloc_cont_rdp dma_alloc_coherent(688)
[ath11k_hal_alloc_cont_wrp dma_alloc_coherent(180)
ath11k_dp_srng_setup dma_alloc_coherent(262143)
ath11k_dp_link_desc_bank_alloc dma_alloc_coherent(2097152) 0
ath11k_dp_link_desc_bank_alloc dma_alloc_coherent(2097152) 1
ath11k_dp_link_desc_bank_alloc dma_alloc_coherent(384) 2
ath11k_dp_srng_setup dma_alloc_coherent(2055)
ath11k_dp_srng_setup dma_alloc_coherent(1031)
ath11k_dp_srng_setup dma_alloc_coherent(1159)
ath11k_dp_srng_setup dma_alloc_coherent(16391)
ath11k_dp_srng_setup dma_alloc_coherent(1048583)
ath11k_dp_srng_setup dma_alloc_coherent(1031)
ath11k_dp_srng_setup dma_alloc_coherent(32775)
ath11k_dp_srng_setup dma_alloc_coherent(8199)
ath11k_dp_srng_setup dma_alloc_coherent(10247)
ath11k_dp_srng_setup dma_alloc_coherent(212999)
ath11k_dp_srng_setup dma_alloc_coherent(131079)
ath11k_dp_srng_setup dma_alloc_coherent(131079)
ath11k_dp_srng_setup dma_alloc_coherent(131079)
ath11k_dp_srng_setup dma_alloc_coherent(131079)
ath11k_dp_srng_setup dma_alloc_coherent(32775)
ath11k_dp_srng_setup dma_alloc_coherent(8199)
ath11k_dp_srng_setup dma_alloc_coherent(8199)
ath11k_dp_srng_setup dma_alloc_coherent(32775)
ath11k_dp_srng_setup dma_alloc_coherent(32775)
ath11k_dp_srng_setup dma_alloc_coherent(8199)
ath11k_dp_srng_setup dma_alloc_coherent(8199)
Let's discuss the general possible solution for this. I'm sure a lot
of other drivers would be facing the same kind of issues. What can be
general approach to solve this problem.
Regards,
Muhammad Usama Anjum
View attachment "ath11k_dma_nomem.log" of type "text/x-log" (21937 bytes)
Powered by blists - more mailing lists