lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <63fee713-34f0-4c76-bd38-8f2fc095849f@collabora.com>
Date: Thu, 26 Jun 2025 22:39:45 +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: Re: [Bug Report] mhi: ath11k: dma_alloc_coherent() failures during
 resume

Hi,

I'm trying to understand ath11k_core_reconfigure_on_crash(). It seems after
every suspend/hibernate cycle, the hal and dp specifically are de-initialized
and initialized again to have clean state again to start working with firmware.
When there's memory pressure, driver isn't able to get the free-ed dma memory
area again.

The name of the function, ath11k_core_reconfigure_on_crash() suggests that we
are recovering from crash and that's why all of the states of different
components are being allocated cleanly from the start. But we aren't resuming
from crash, instead we are resuming from suspend which was handled by the driver
itself. So this state cleanup must have been done by the suspend handler.

Any pointers on how to avoid going through deinit-init cycle of whole objects
every time?

Thanks,
Usama

On 6/19/25 3:27 PM, Muhammad Usama Anjum wrote:
> 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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ