Bläddra i källkod

qcacld-3.0: Purge all active and pending cmds during SSR

During Vdev start/restart LimProcessDefdMsgs is set to false. If
start/restart timeouts, it will initiate SSR but will not send
response to LIM and thus gLimProcessDefdMsgs will not set to true.
Thus no other commands will be processed in LIM. If any command is
queued in serialization during this time it will timeout.

This will eventually lead to timeout of the vdev destroy command as
it won't get processed until the command in active queue timeout and
it leads to peer and vdev refcount leaks.

To fix it purge all active and pending cmds during SSR, so that vdev
destroy cmd can be processed immediately and can release vdev/peer
ref count.

Change-Id: Id5c15ccb4c27dabfdd4a9e0d7ee9b765130e03bf
CRs-Fixed: 2354899
Abhishek Singh 6 år sedan
förälder
incheckning
0d0568a647
3 ändrade filer med 27 tillägg och 0 borttagningar
  1. 5 0
      core/hdd/src/wlan_hdd_power.c
  2. 9 0
      core/sme/inc/sme_api.h
  3. 13 0
      core/sme/src/common/sme_api.c

+ 5 - 0
core/hdd/src/wlan_hdd_power.c

@@ -1269,6 +1269,11 @@ QDF_STATUS hdd_wlan_shutdown(void)
 	 * increment their counts from 0.
 	 */
 	hdd_reset_all_adapters_connectivity_stats(hdd_ctx);
+	/*
+	 * Purge all active and pending list to avoid vdev destroy timeout and
+	 * thus avoid peer/vdev refcount leak.
+	 */
+	sme_purge_pdev_all_ser_cmd_list(hdd_ctx->mac_handle);
 
 	hdd_reset_all_adapters(hdd_ctx);
 

+ 9 - 0
core/sme/inc/sme_api.h

@@ -432,6 +432,15 @@ QDF_STATUS sme_hdd_ready_ind(mac_handle_t mac_handle);
 QDF_STATUS sme_ser_cmd_callback(void *buf,
 				enum wlan_serialization_cb_reason reason);
 
+/**
+ * sme_purge_pdev_all_ser_cmd_list() - purge all scan and non-scan
+ * active and pending cmds for pdev
+ * @mac_handle: pointer to global MAC context
+ *
+ * Return : none
+ */
+void sme_purge_pdev_all_ser_cmd_list(mac_handle_t mac_handle);
+
 /*
  * sme_process_msg() - The main message processor for SME.
  * @mac: The global mac context

+ 13 - 0
core/sme/src/common/sme_api.c

@@ -261,6 +261,19 @@ static QDF_STATUS sme_process_hw_mode_trans_ind(tpAniSirGlobal mac,
 	return QDF_STATUS_SUCCESS;
 }
 
+void sme_purge_pdev_all_ser_cmd_list(mac_handle_t mac_handle)
+{
+	QDF_STATUS status;
+	tpAniSirGlobal mac_ctx = PMAC_STRUCT(mac_handle);
+
+	status = sme_acquire_global_lock(&mac_ctx->sme);
+	if (QDF_IS_STATUS_ERROR(status))
+		return;
+
+	csr_purge_pdev_all_ser_cmd_list(mac_ctx);
+	sme_release_global_lock(&mac_ctx->sme);
+}
+
 /**
  * free_sme_cmds() - This function frees memory allocated for SME commands
  * @mac_ctx:      Pointer to Global MAC structure