summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath11k/hal.c
diff options
context:
space:
mode:
authorCarl Huang <cjhuang@codeaurora.org>2020-10-01 12:34:46 +0300
committerKalle Valo <kvalo@codeaurora.org>2020-10-01 22:33:09 +0300
commit8ec5a6ab9c7eeeeb59f74e59e53de78dda402da8 (patch)
treed149fdc77e843a9b6e3a482bcdb2114becfcaa68 /drivers/net/wireless/ath/ath11k/hal.c
parent9df6d8399d6789c4eb81878285e7808225a2a141 (diff)
downloadlinux-8ec5a6ab9c7eeeeb59f74e59e53de78dda402da8.tar.xz
ath11k: start a timer to update TCL HP
The timer is to check if TCL HP isn't updated to target. The timer will postpone itself if there are TX operations during the interval, otherwise the timer handler updates the HP again so the index value in HP register will be forwarded to target register, and the timer stops afterwards. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang <cjhuang@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/1601544890-13450-5-git-send-email-kvalo@codeaurora.org
Diffstat (limited to 'drivers/net/wireless/ath/ath11k/hal.c')
-rw-r--r--drivers/net/wireless/ath/ath11k/hal.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath11k/hal.c b/drivers/net/wireless/ath/ath11k/hal.c
index d58dfdfe7860..20f9cebc86d2 100644
--- a/drivers/net/wireless/ath/ath11k/hal.c
+++ b/drivers/net/wireless/ath/ath11k/hal.c
@@ -1174,6 +1174,19 @@ void ath11k_hal_srng_get_shadow_config(struct ath11k_base *ab,
*cfg = hal->shadow_reg_addr;
}
+void ath11k_hal_srng_shadow_update_hp_tp(struct ath11k_base *ab,
+ struct hal_srng *srng)
+{
+ lockdep_assert_held(&srng->lock);
+
+ /* check whether the ring is emptry. Update the shadow
+ * HP only when then ring isn't' empty.
+ */
+ if (srng->ring_dir == HAL_SRNG_DIR_SRC &&
+ *srng->u.src_ring.tp_addr != srng->u.src_ring.hp)
+ ath11k_hal_srng_access_end(ab, srng);
+}
+
static int ath11k_hal_srng_create_config(struct ath11k_base *ab)
{
struct ath11k_hal *hal = &ab->hal;