Re: [PATCH] wifi: ath11k: fix remapped ce accessing issue on 64bit OS

From: Sergey Ryazanov
Date: Thu May 02 2024 - 15:27:24 EST


Hi Jeff,

On 01.05.2024 19:56, Jeff Johnson wrote:
On 5/1/2024 9:14 AM, Ziyang Huang wrote:
On 64bit OS, when ab->mem_ce is lower than or 4G far away from ab->mem,
u32 is not enough to store the offsets, which makes ath11k_ahb_read32()
and ath11k_ahb_write32() access incorrect address and causes Data Abort
Exception.

Are you actually observing this issue?
Or is this a hypothetical situation?

Yep. This is the real issue. I faced it on IPQ5018 with 64bits kernel.

Let's use the high bits of offsets to decide where to access, which is
similar as ath11k_pci_get_window_start() done. In the future, we can merge
these functions for unified regs accessing.

Performing unnecessary tests and masking for every ioread/write operation will
potentially impact performance.

What other fixes were considered (i.e. did you consider making all the
register addresses u64?)

Probably, making argument u64 could also be too much. I/O address space of this chip fits 4GB so u32 should be enough. I have a bit different fix for this bug. It introduces an indirect call for the CE registers access and a dedicated set of accessing functions for chips that has the CE region outside the main I/O area. I am going to publish it in a couple of weeks, when I will come from a trip. The patch still needs some polishing.

--
Sergey