Skip to content

Commit f51e4b3

Browse files
Kyle Farnungjeff-t-johnson
authored andcommitted
wifi: ath11k: clear shared SRNG pointer state on restart
LMAC rings reuse the shared rdp/wrp pointer buffers without going through the normal SRNG hw-init path that zeros non-LMAC ring pointers. After restart, ath11k_hal_srng_clear() can therefore hand stale hp/tp state from the previous firmware instance back to the new one. Clear the shared pointer buffers while keeping the allocations in place so restart still avoids reallocating SRNG DMA memory, but starts with fresh ring-pointer state. Fixes: 32be3ca ("wifi: ath11k: HAL SRNG: don't deinitialize and re-initialize again") Cc: stable@vger.kernel.org Closes: https://lore.kernel.org/all/CAOPSVF04q6uvVdq8GTRLHBrVMdpt9=o9wVcFMc6f-yhmSBcZqQ@mail.gmail.com/ Signed-off-by: Kyle Farnung <kfarnung@gmail.com> Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20260513-kfarnung-ath11k-srng-clear-pointer-state-v1-1-bc700dd8b333@gmail.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
1 parent 72b8654 commit f51e4b3

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

  • drivers/net/wireless/ath/ath11k

drivers/net/wireless/ath/ath11k/hal.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,14 +1387,22 @@ EXPORT_SYMBOL(ath11k_hal_srng_deinit);
13871387

13881388
void ath11k_hal_srng_clear(struct ath11k_base *ab)
13891389
{
1390-
/* No need to memset rdp and wrp memory since each individual
1391-
* segment would get cleared in ath11k_hal_srng_src_hw_init()
1392-
* and ath11k_hal_srng_dst_hw_init().
1390+
/*
1391+
* Preserve the shared pointer buffers, but clear the previous
1392+
* firmware instance's hp/tp state before handing them back to FW.
1393+
* LMAC rings reuse this shared memory without going through the
1394+
* normal SRNG hw-init path that zeros non-LMAC ring pointers.
13931395
*/
13941396
memset(ab->hal.srng_list, 0,
13951397
sizeof(ab->hal.srng_list));
13961398
memset(ab->hal.shadow_reg_addr, 0,
13971399
sizeof(ab->hal.shadow_reg_addr));
1400+
if (ab->hal.rdp.vaddr)
1401+
memset(ab->hal.rdp.vaddr, 0,
1402+
sizeof(*ab->hal.rdp.vaddr) * HAL_SRNG_RING_ID_MAX);
1403+
if (ab->hal.wrp.vaddr)
1404+
memset(ab->hal.wrp.vaddr, 0,
1405+
sizeof(*ab->hal.wrp.vaddr) * HAL_SRNG_NUM_LMAC_RINGS);
13981406
ab->hal.avail_blk_resource = 0;
13991407
ab->hal.current_blk_index = 0;
14001408
ab->hal.num_shadow_reg_configured = 0;

0 commit comments

Comments
 (0)