aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <[email protected]>2019-11-27 18:30:09 +0200
committerKalle Valo <[email protected]>2019-11-29 09:36:19 +0200
commit051cefa4466744cb669d7eef9399cbf850b2a6d4 (patch)
tree8d4de0b7c81e1cddcd9ca30dabeed41bd606c505
parent79c647a3c59ddc1a1acf68e82e555201c10d3c18 (diff)
ath11k: Fix target crash due to WBM_IDLE_LINK ring desc shortage
Make sure the number of WBM_IDLE_LINK ring descriptors is power of 2. This increases the number of descriptors to 32k from the current ~18k to fix the target assert because of the shortage in the descriptors in WBM_IDLE_LINK ring. Remove unnecessary power of 2 calculation in ath11k_dp_link_desc_setup() as it is not required after this change. Signed-off-by: Vasanthakumar Thiagarajan <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
-rw-r--r--drivers/net/wireless/ath/ath11k/dp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath11k/dp.c b/drivers/net/wireless/ath/ath11k/dp.c
index ff510e821a29..72c21cf6a352 100644
--- a/drivers/net/wireless/ath/ath11k/dp.c
+++ b/drivers/net/wireless/ath/ath11k/dp.c
@@ -478,6 +478,9 @@ static int ath11k_wbm_idle_ring_setup(struct ath11k_base *ab, u32 *n_link_desc)
*n_link_desc = n_mpdu_link_desc + n_mpdu_queue_desc +
n_tx_msdu_link_desc + n_rx_msdu_link_desc;
+ if (*n_link_desc & (*n_link_desc - 1))
+ *n_link_desc = 1 << fls(*n_link_desc);
+
ret = ath11k_dp_srng_setup(ab, &dp->wbm_idle_ring,
HAL_WBM_IDLE_LINK, 0, 0, *n_link_desc);
if (ret) {
@@ -499,9 +502,6 @@ int ath11k_dp_link_desc_setup(struct ath11k_base *ab,
u32 *desc;
int i, ret;
- if (n_link_desc & (n_link_desc - 1))
- n_link_desc = 1 << fls(n_link_desc);
-
tot_mem_sz = n_link_desc * HAL_LINK_DESC_SIZE;
tot_mem_sz += HAL_LINK_DESC_ALIGN;