Browse Source

qcacld-3.0: Flush scheduler message queues before htc_stop

There is a window where wmi commands are reaching HTC while HTC is
getting stopped in other context irrespective of wma_wmi_stop() which
will lead to memory leaks.

To avoid this issue, flush all scheduler message queues before
proceeding to htc_stop.

Change-Id: I4d0742d7b9df6a9b0401fd4e840ff6a667d353da
CRs-Fixed: 2352291
Rakshith Suresh Patkar 6 years ago
parent
commit
ba55fd097f
1 changed files with 7 additions and 0 deletions
  1. 7 0
      core/cds/src/cds_api.c

+ 7 - 0
core/cds/src/cds_api.c

@@ -36,6 +36,7 @@
 #include "wlan_hdd_power.h"
 #include "wlan_hdd_tsf.h"
 #include <linux/vmalloc.h>
+#include <scheduler_core.h>
 
 #include "pld_common.h"
 #include "sap_api.h"
@@ -1050,6 +1051,7 @@ QDF_STATUS cds_post_disable(void)
 	tp_wma_handle wma_handle;
 	struct hif_opaque_softc *hif_ctx;
 	struct cdp_pdev *txrx_pdev;
+	struct scheduler_ctx *sched_ctx;
 
 	wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
 	if (!wma_handle) {
@@ -1069,6 +1071,11 @@ QDF_STATUS cds_post_disable(void)
 		return QDF_STATUS_E_INVAL;
 	}
 
+	/* flush any unprocessed scheduler messages */
+	sched_ctx = scheduler_get_context();
+	if (sched_ctx)
+		scheduler_queues_flush(sched_ctx);
+
 	/*
 	 * With new state machine changes cds_close can be invoked without
 	 * cds_disable. So, send the following clean up prerequisites to fw,