ath11k: use cache line aligned buffers for dbring
authorRameshkumar Sundaram <quic_ramess@quicinc.com>
Tue, 2 Nov 2021 05:41:33 +0000 (11:11 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 17 Nov 2021 07:28:29 +0000 (09:28 +0200)
commitbd77f6b1d7104cf6451399a7c67d08afecb9a7c7
treed51a6474a7d5c180d179295fe1eb21c78bfac7c1
parentf951380a6022440335f668f85296096ba13071ba
ath11k: use cache line aligned buffers for dbring

The DMA buffers of dbring which is used for spectral/cfr
starts at certain offset from original kmalloc() returned buffer.
This is not cache line aligned.
And also driver tries to access the data that is immediately before
this offset address (i.e. buff->paddr) after doing dma map.
This will cause cache line sharing issues and data corruption,
if CPU happen to write back cache after HW has dma'ed the data.

Fix this by mapping a cache line aligned buffer to dma.

Tested on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1635831693-15962-1-git-send-email-quic_ramess@quicinc.com
drivers/net/wireless/ath/ath11k/dbring.c
drivers/net/wireless/ath/ath11k/dbring.h