From a73cc691579968be1f60d5dfeda82375cd944e49 Mon Sep 17 00:00:00 2001 From: phadiman Date: Tue, 10 Dec 2019 13:45:16 +0530 Subject: [PATCH] qcacmn: Fix pool alloc issue in detach path Memory is freed and allocated only during wifi load and unload in case of WIN and not during wifi up/down Calling dp_tx_soc_detach unconditionally was leading to memory free in wifi down path and when wifi up was issued the memory which was freed was never allocated Call dp_tx_soc_detach conditonaly only for MCL in dp_soc_cmn_cleanup and for WIN in dp_soc_detach using dp_soc_reinit flag which is set for WIN during wifi unload Change-Id: I9da34f7945d65a34e719c7db58da13e85ae3d228 --- dp/wifi3.0/dp_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index f722ce020a..8c258cbf81 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -3055,7 +3055,9 @@ fail1: */ static void dp_soc_cmn_cleanup(struct dp_soc *soc) { - dp_tx_soc_detach(soc); + if (!dp_is_soc_reinit(soc)) { + dp_tx_soc_detach(soc); + } qdf_spinlock_destroy(&soc->rx.defrag.defrag_lock); @@ -4243,6 +4245,10 @@ static void dp_soc_detach(void *txrx_soc) qdf_minidump_remove(soc->wbm_desc_rel_ring.base_vaddr_unaligned); dp_srng_cleanup(soc, &soc->wbm_desc_rel_ring, SW2WBM_RELEASE, 0); + if (dp_is_soc_reinit(soc)) { + dp_tx_soc_detach(soc); + } + /* Tx data rings */ if (!wlan_cfg_per_pdev_tx_ring(soc->wlan_cfg_ctx)) { for (i = 0; i < soc->num_tcl_data_rings; i++) {