Browse Source

qcacld-3.0: Resume wlan threads during shutdown before adapter reset

Resume wlan threads during wlan shutdown process before adapter reset
because adapter reset triggers vdev destroy and vdev destroy sends
del sta self message to lower layers and in absence of wlan threads
this message will not be processed leading to timeout and vdev peer
object leak. Hence add fix to make sure wlan threads are resumed
before resetting adapters during wlan shutdown process.

Change-Id: Idc31b7e41e5d9734b5f6b96fba24948dbfb45c3d
CRs-Fixed: 2321503
Rajeev Kumar 6 years ago
parent
commit
9f46158146
3 changed files with 35 additions and 14 deletions
  1. 10 0
      core/cds/inc/cds_sched.h
  2. 13 0
      core/cds/src/cds_sched.c
  3. 12 14
      core/hdd/src/wlan_hdd_power.c

+ 10 - 0
core/cds/inc/cds_sched.h

@@ -493,4 +493,14 @@ void cds_shutdown_notifier_purge(void);
  * shutdown.
  */
 void cds_shutdown_notifier_call(void);
+
+/**
+ * cds_resume_rx_thread() - resume rx thread by completing its resume event
+ *
+ * Resume RX thread by completing RX thread resume event
+ *
+ * Return: None
+ */
+void cds_resume_rx_thread(void);
+
 #endif /* #if !defined __CDS_SCHED_H */

+ 13 - 0
core/cds/src/cds_sched.c

@@ -1105,3 +1105,16 @@ int cds_get_gfp_flags(void)
 
 	return flags;
 }
+
+void cds_resume_rx_thread(void)
+{
+	p_cds_sched_context cds_sched_context = NULL;
+
+	cds_sched_context = get_cds_sched_ctxt();
+	if (NULL == cds_sched_context) {
+		cds_err("cds_sched_context is NULL");
+		return;
+	}
+
+	complete(&cds_sched_context->ol_resume_rx_event);
+}

+ 12 - 14
core/hdd/src/wlan_hdd_power.c

@@ -1197,7 +1197,6 @@ static void hdd_ssr_restart_sap(struct hdd_context *hdd_ctx)
 QDF_STATUS hdd_wlan_shutdown(void)
 {
 	struct hdd_context *hdd_ctx;
-	p_cds_sched_context cds_sched_context = NULL;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	hdd_info("WLAN driver shutting down!");
@@ -1215,6 +1214,18 @@ QDF_STATUS hdd_wlan_shutdown(void)
 	hdd_debug("Invoking packetdump deregistration API");
 	wlan_deregister_txrx_packetdump();
 
+	/* resume wlan threads before adapter reset which does vdev destroy */
+	if (hdd_ctx->is_scheduler_suspended) {
+		scheduler_resume();
+		hdd_ctx->is_scheduler_suspended = false;
+		hdd_ctx->is_wiphy_suspended = false;
+	}
+
+	if (hdd_ctx->is_ol_rx_thread_suspended) {
+		cds_resume_rx_thread();
+		hdd_ctx->is_ol_rx_thread_suspended = false;
+	}
+
 	/*
 	 * After SSR, FW clear its txrx stats. In host,
 	 * as adapter is intact so those counts are still
@@ -1240,19 +1251,6 @@ QDF_STATUS hdd_wlan_shutdown(void)
 	/* De-register the HDD callbacks */
 	hdd_deregister_cb(hdd_ctx);
 
-	cds_sched_context = get_cds_sched_ctxt();
-
-	if (hdd_ctx->is_scheduler_suspended) {
-		scheduler_resume();
-		hdd_ctx->is_scheduler_suspended = false;
-		hdd_ctx->is_wiphy_suspended = false;
-	}
-
-	if (true == hdd_ctx->is_ol_rx_thread_suspended) {
-		complete(&cds_sched_context->ol_resume_rx_event);
-		hdd_ctx->is_ol_rx_thread_suspended = false;
-	}
-
 	hdd_wlan_stop_modules(hdd_ctx, false);
 
 	hdd_bus_bandwidth_deinit(hdd_ctx);