]> www.infradead.org Git - users/jedix/linux-maple.git/commit
wifi: ath11k: Use dma_alloc_noncoherent for rx_tid buffer allocation
authorP Praneesh <quic_ppranees@quicinc.com>
Sun, 19 Jan 2025 16:42:19 +0000 (22:12 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Wed, 22 Jan 2025 18:31:27 +0000 (10:31 -0800)
commiteeadc6baf8b3dcd32787cc84f0473dc2a2850370
treed0aff23f2e4f0f90304bd8153f4f72124a159b74
parent1bcd20981834928ccc5d981aacb806bb523d8b29
wifi: ath11k: Use dma_alloc_noncoherent for rx_tid buffer allocation

Currently, the driver allocates cacheable DMA buffers for the rx_tid
structure using kzalloc() and dma_map_single(). These buffers are
long-lived and can persist for the lifetime of the peer, which is not
advisable. Instead of using kzalloc() and dma_map_single() for allocating
cacheable DMA buffers, utilize the dma_alloc_noncoherent() helper for the
allocation of long-lived cacheable DMA buffers, such as the peer's rx_tid.
Since dma_alloc_noncoherent() returns unaligned physical and virtual
addresses, align them internally before use within the driver. This
ensures proper allocation of non-coherent memory through the kernel
helper.

Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3

Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
Tested-by: Tim Harvey <tharvey@gateworks.com>
Link: https://patch.msgid.link/20250119164219.647059-3-quic_ppranees@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath11k/dp.h
drivers/net/wireless/ath/ath11k/dp_rx.c