Skip to content

Commit 9c57d7e

Browse files
Vasanthakumar ThiagarajanKalle Valo
authored andcommitted
ath11k: Setup REO destination ring before sending wmi_init command
Firmware expects all the required REO destination rings setup while processing wmi_init command. Not doing this causes connected stations getting disconnected and not able to connect back. Signed-off-by: Vasanthakumar Thiagarajan <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 0366f42 commit 9c57d7e

File tree

5 files changed

+67
-14
lines changed

5 files changed

+67
-14
lines changed

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "ahb.h"
1111
#include "core.h"
1212
#include "dp_tx.h"
13+
#include "dp_rx.h"
1314
#include "debug.h"
1415

1516
unsigned int ath11k_debug_mask;
@@ -325,6 +326,7 @@ static void ath11k_core_stop(struct ath11k_base *ab)
325326
ath11k_qmi_firmware_stop(ab);
326327
ath11k_ahb_stop(ab);
327328
ath11k_wmi_detach(ab);
329+
ath11k_dp_pdev_reo_cleanup(ab);
328330

329331
/* De-Init of components as needed */
330332
}
@@ -476,28 +478,38 @@ static int ath11k_core_start(struct ath11k_base *ab,
476478
goto err_hif_stop;
477479
}
478480

481+
ath11k_dp_pdev_pre_alloc(ab);
482+
483+
ret = ath11k_dp_pdev_reo_setup(ab);
484+
if (ret) {
485+
ath11k_err(ab, "failed to initialize reo destination rings: %d\n", ret);
486+
goto err_mac_destroy;
487+
}
488+
479489
ret = ath11k_wmi_cmd_init(ab);
480490
if (ret) {
481491
ath11k_err(ab, "failed to send wmi init cmd: %d\n", ret);
482-
goto err_mac_destroy;
492+
goto err_reo_cleanup;
483493
}
484494

485495
ret = ath11k_wmi_wait_for_unified_ready(ab);
486496
if (ret) {
487497
ath11k_err(ab, "failed to receive wmi unified ready event: %d\n",
488498
ret);
489-
goto err_mac_destroy;
499+
goto err_reo_cleanup;
490500
}
491501

492502
ret = ath11k_dp_tx_htt_h2t_ver_req_msg(ab);
493503
if (ret) {
494504
ath11k_err(ab, "failed to send htt version request message: %d\n",
495505
ret);
496-
goto err_mac_destroy;
506+
goto err_reo_cleanup;
497507
}
498508

499509
return 0;
500510

511+
err_reo_cleanup:
512+
ath11k_dp_pdev_reo_cleanup(ab);
501513
err_mac_destroy:
502514
ath11k_mac_destroy(ab);
503515
err_hif_stop:
@@ -561,6 +573,7 @@ static int ath11k_core_reconfigure_on_crash(struct ath11k_base *ab)
561573
ath11k_dp_pdev_free(ab);
562574
ath11k_ahb_stop(ab);
563575
ath11k_wmi_detach(ab);
576+
ath11k_dp_pdev_reo_cleanup(ab);
564577
mutex_unlock(&ab->core_lock);
565578

566579
ath11k_dp_free(ab);

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,11 +684,10 @@ void ath11k_dp_pdev_free(struct ath11k_base *ab)
684684
}
685685
}
686686

687-
int ath11k_dp_pdev_alloc(struct ath11k_base *ab)
687+
void ath11k_dp_pdev_pre_alloc(struct ath11k_base *ab)
688688
{
689689
struct ath11k *ar;
690690
struct ath11k_pdev_dp *dp;
691-
int ret;
692691
int i;
693692

694693
for (i = 0; i < ab->num_radios; i++) {
@@ -704,6 +703,13 @@ int ath11k_dp_pdev_alloc(struct ath11k_base *ab)
704703
idr_init(&dp->rxdma_mon_buf_ring.bufs_idr);
705704
spin_lock_init(&dp->rxdma_mon_buf_ring.idr_lock);
706705
}
706+
}
707+
708+
int ath11k_dp_pdev_alloc(struct ath11k_base *ab)
709+
{
710+
struct ath11k *ar;
711+
int ret;
712+
int i;
707713

708714
/* TODO:Per-pdev rx ring unlike tx ring which is mapped to different AC's */
709715
for (i = 0; i < ab->num_radios; i++) {

drivers/net/wireless/ath/ath11k/dp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,7 @@ void ath11k_dp_vdev_tx_attach(struct ath11k *ar, struct ath11k_vif *arvif);
15071507
void ath11k_dp_free(struct ath11k_base *ab);
15081508
int ath11k_dp_alloc(struct ath11k_base *ab);
15091509
int ath11k_dp_pdev_alloc(struct ath11k_base *ab);
1510+
void ath11k_dp_pdev_pre_alloc(struct ath11k_base *ab);
15101511
void ath11k_dp_pdev_free(struct ath11k_base *ab);
15111512
int ath11k_dp_tx_htt_srng_setup(struct ath11k_base *ab, u32 ring_id,
15121513
int mac_id, enum hal_ring_type ring_type);

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

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -395,12 +395,51 @@ static void ath11k_dp_rx_pdev_srng_free(struct ath11k *ar)
395395
struct ath11k_pdev_dp *dp = &ar->dp;
396396

397397
ath11k_dp_srng_cleanup(ar->ab, &dp->rx_refill_buf_ring.refill_buf_ring);
398-
ath11k_dp_srng_cleanup(ar->ab, &dp->reo_dst_ring);
399398
ath11k_dp_srng_cleanup(ar->ab, &dp->rxdma_err_dst_ring);
400399
ath11k_dp_srng_cleanup(ar->ab, &dp->rx_mon_status_refill_ring.refill_buf_ring);
401400
ath11k_dp_srng_cleanup(ar->ab, &dp->rxdma_mon_buf_ring.refill_buf_ring);
402401
}
403402

403+
void ath11k_dp_pdev_reo_cleanup(struct ath11k_base *ab)
404+
{
405+
struct ath11k_pdev_dp *dp;
406+
struct ath11k *ar;
407+
int i;
408+
409+
for (i = 0; i < ab->num_radios; i++) {
410+
ar = ab->pdevs[i].ar;
411+
dp = &ar->dp;
412+
ath11k_dp_srng_cleanup(ab, &dp->reo_dst_ring);
413+
}
414+
}
415+
416+
int ath11k_dp_pdev_reo_setup(struct ath11k_base *ab)
417+
{
418+
struct ath11k *ar;
419+
struct ath11k_pdev_dp *dp;
420+
int ret;
421+
int i;
422+
423+
for (i = 0; i < ab->num_radios; i++) {
424+
ar = ab->pdevs[i].ar;
425+
dp = &ar->dp;
426+
ret = ath11k_dp_srng_setup(ab, &dp->reo_dst_ring, HAL_REO_DST,
427+
dp->mac_id, dp->mac_id,
428+
DP_REO_DST_RING_SIZE);
429+
if (ret) {
430+
ath11k_warn(ar->ab, "failed to setup reo_dst_ring\n");
431+
goto err_reo_cleanup;
432+
}
433+
}
434+
435+
return 0;
436+
437+
err_reo_cleanup:
438+
ath11k_dp_pdev_reo_cleanup(ab);
439+
440+
return ret;
441+
}
442+
404443
static int ath11k_dp_rx_pdev_srng_alloc(struct ath11k *ar)
405444
{
406445
struct ath11k_pdev_dp *dp = &ar->dp;
@@ -416,14 +455,6 @@ static int ath11k_dp_rx_pdev_srng_alloc(struct ath11k *ar)
416455
return ret;
417456
}
418457

419-
ret = ath11k_dp_srng_setup(ar->ab, &dp->reo_dst_ring, HAL_REO_DST,
420-
dp->mac_id, dp->mac_id,
421-
DP_REO_DST_RING_SIZE);
422-
if (ret) {
423-
ath11k_warn(ar->ab, "failed to setup reo_dst_ring\n");
424-
return ret;
425-
}
426-
427458
ret = ath11k_dp_srng_setup(ar->ab, &dp->rxdma_err_dst_ring,
428459
HAL_RXDMA_DST, 0, dp->mac_id,
429460
DP_RXDMA_ERR_DST_RING_SIZE);

drivers/net/wireless/ath/ath11k/dp_rx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ int ath11k_peer_rx_tid_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id,
4848
u8 tid, u32 ba_win_sz, u16 ssn);
4949
void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab,
5050
struct sk_buff *skb);
51+
int ath11k_dp_pdev_reo_setup(struct ath11k_base *ab);
52+
void ath11k_dp_pdev_reo_cleanup(struct ath11k_base *ab);
5153
int ath11k_dp_rx_pdev_alloc(struct ath11k_base *ab, int pdev_idx);
5254
void ath11k_dp_rx_pdev_free(struct ath11k_base *ab, int pdev_idx);
5355
void ath11k_dp_reo_cmd_list_cleanup(struct ath11k_base *ab);

0 commit comments

Comments
 (0)