浏览代码

qcacld-3.0: Release vdev ref and delete pending peers in wma close

In hdd_vdev_destroy, if policy_mgr_check_and_stop_opportunistic_timer
decides to move to single mac mode and while sending the HW mode change
the target goes down, this leads to timeout of the HW mode change req in
WMA layer which is 2 sec and in serialization its 4 sec, but
policy_mgr_check_and_stop_opportunistic_timer timeout in 1 sec and proceed
to sme_close_session and wait for it to complete.

sme_close_session queue WLAN_SER_CMD_DEL_STA_SESSION to serialization but
it remains in pending queue, behind HW mode change req.

Now due to SSR the wait event for sme_close_session is set and thus
hdd_vdev_destroy logically deletes the vdev.

Now on WMA timeout the HW mode change try to remove the request from
serialization which it fails to remove as it fails to get ref for vdev
with vdev being logically deleted.

Thus WLAN_SER_CMD_DEL_STA_SESSION is not processed and is flushed in
hdd_wlan_shutdown.

Thus as SSR WLAN_SER_CMD_DEL_STA_SESSION is flushed from serialization
queue, the wma_vdev_detach() is not called for that vdev and thus the
peer attached to the vdev are not deleted and wma vdev ref is also not
released, this lead vdev/peer ref leak.

To fix this update the wait timeout in
policy_mgr_check_and_stop_opportunistic_timer with proper value higher
than the serialization timeout for the HW mode change request. ALso
set the wait event in policy_mgr_pdev_set_hw_mode_cb in failure cases
as well to avoid timeout in case of hw mode change failures.

Also release pending peer and vdef refs in wma_wmi_service_close.

Change-Id: I5ddf8263b0dbf889be506332a67f5e18c1bfb111
CRs-Fixed: 2458034
Abhishek Singh 6 年之前
父节点
当前提交
10358bcde1
共有 2 个文件被更改,包括 15 次插入9 次删除
  1. 10 7
      cmn_services/policy_mgr/src/wlan_policy_mgr_core.c
  2. 5 2
      cmn_services/policy_mgr/src/wlan_policy_mgr_i.h

+ 10 - 7
cmn_services/policy_mgr/src/wlan_policy_mgr_core.c

@@ -881,7 +881,7 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status,
 	pm_ctx = policy_mgr_get_context(context);
 	if (!pm_ctx) {
 		policy_mgr_err("Invalid Context");
-		return;
+		goto set_done_event;
 	}
 
 	policy_mgr_set_hw_mode_change_in_progress(context,
@@ -889,14 +889,14 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status,
 
 	if (status != SET_HW_MODE_STATUS_OK) {
 		policy_mgr_err("Set HW mode failed with status %d", status);
-		return;
+		goto set_done_event;
 	}
 
 	/* vdev mac map for NAN Discovery is expected in NAN Enable resp */
 	if (reason != POLICY_MGR_UPDATE_REASON_NAN_DISCOVERY &&
 	    !vdev_mac_map) {
 		policy_mgr_err("vdev_mac_map is NULL");
-		return;
+		goto set_done_event;
 	}
 
 	policy_mgr_debug("cfgd_hw_mode_index=%d", cfgd_hw_mode_index);
@@ -910,7 +910,7 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status,
 			&hw_mode);
 	if (ret != QDF_STATUS_SUCCESS) {
 		policy_mgr_err("Get HW mode failed: %d", ret);
-		return;
+		goto set_done_event;
 	}
 
 	policy_mgr_debug("MAC0: TxSS:%d, RxSS:%d, Bw:%d, band_cap %d",
@@ -940,12 +940,15 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status,
 			next_action, reason);
 	else {
 		policy_mgr_debug("No action needed right now");
-		ret = policy_mgr_set_opportunistic_update(context);
-		if (!QDF_IS_STATUS_SUCCESS(ret))
-			policy_mgr_err("ERROR: set opportunistic_update event failed");
+		goto set_done_event;
 	}
 
 	return;
+
+set_done_event:
+	ret = policy_mgr_set_opportunistic_update(context);
+	if (!QDF_IS_STATUS_SUCCESS(ret))
+		policy_mgr_err("ERROR: set opportunistic_update event failed");
 }
 
 /**

+ 5 - 2
cmn_services/policy_mgr/src/wlan_policy_mgr_i.h

@@ -27,10 +27,13 @@
 #include "wlan_reg_services_api.h"
 
 #define DBS_OPPORTUNISTIC_TIME   5
+
+#define POLICY_MGR_SER_CMD_TIMEOUT 4000
+
 #ifdef QCA_WIFI_3_0_EMU
-#define CONNECTION_UPDATE_TIMEOUT 3000
+#define CONNECTION_UPDATE_TIMEOUT (POLICY_MGR_SER_CMD_TIMEOUT + 3000)
 #else
-#define CONNECTION_UPDATE_TIMEOUT 1000
+#define CONNECTION_UPDATE_TIMEOUT (POLICY_MGR_SER_CMD_TIMEOUT + 2000)
 #endif
 
 #define PM_24_GHZ_CHANNEL_6   (6)