Browse Source

qcacld-3.0: Define a new RTPM wake lock for NDP

Define a new RTPM wake lock for NDP and create the functions
wma_ndp_prevent_runtime_pm()/wma_ndp_allow_runtime_pm() for it.

Change-Id: I6e70065b8c1ce3c91c411638957e13efff5a64ba
CRs-Fixed: 3050943
Alan Chen 3 years ago
parent
commit
ba84e38bc2
3 changed files with 15 additions and 2 deletions
  1. 1 0
      core/wma/inc/wma.h
  2. 11 2
      core/wma/src/wma_dev_if.c
  3. 3 0
      core/wma/src/wma_main.c

+ 1 - 0
core/wma/inc/wma.h

@@ -1006,6 +1006,7 @@ typedef struct {
 	qdf_wake_lock_t wmi_cmd_rsp_wake_lock;
 	qdf_runtime_lock_t wmi_cmd_rsp_runtime_lock;
 	qdf_runtime_lock_t sap_prevent_runtime_pm_lock;
+	qdf_runtime_lock_t ndp_prevent_runtime_pm_lock;
 	enum active_apf_mode active_uc_apf_mode;
 	enum active_apf_mode active_mc_bc_apf_mode;
 	struct wma_ini_config ini_config;

+ 11 - 2
core/wma/src/wma_dev_if.c

@@ -4949,6 +4949,15 @@ static void wma_sap_allow_runtime_pm(tp_wma_handle wma)
 	qdf_runtime_pm_allow_suspend(&wma->sap_prevent_runtime_pm_lock);
 }
 
+static void wma_ndp_prevent_runtime_pm(tp_wma_handle wma)
+{
+	qdf_runtime_pm_prevent_suspend(&wma->ndp_prevent_runtime_pm_lock);
+}
+
+static void wma_ndp_allow_runtime_pm(tp_wma_handle wma)
+{
+	qdf_runtime_pm_allow_suspend(&wma->ndp_prevent_runtime_pm_lock);
+}
 #ifdef FEATURE_STA_MODE_VOTE_LINK
 static bool wma_add_sta_allow_sta_mode_vote_link(uint8_t oper_mode)
 {
@@ -5122,7 +5131,7 @@ void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 	if (BSS_OPERATIONAL_MODE_NDI == oper_mode) {
 		wma_debug("disable runtime pm and vote for link up");
 		htc_vote_link_up(htc_handle, HTC_LINK_VOTE_NDP_USER_ID);
-		wma_sap_prevent_runtime_pm(wma);
+		wma_ndp_prevent_runtime_pm(wma);
 	} else if (wma_add_sta_allow_sta_mode_vote_link(oper_mode)) {
 		wma_debug("vote for link up");
 		htc_vote_link_up(htc_handle, HTC_LINK_VOTE_STA_USER_ID);
@@ -5220,7 +5229,7 @@ void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta)
 	if (BSS_OPERATIONAL_MODE_NDI == oper_mode) {
 		wma_debug("allow runtime pm and vote for link down");
 		htc_vote_link_down(htc_handle, HTC_LINK_VOTE_NDP_USER_ID);
-		wma_sap_allow_runtime_pm(wma);
+		wma_ndp_allow_runtime_pm(wma);
 	} else if (wma_add_sta_allow_sta_mode_vote_link(oper_mode)) {
 		wma_debug("vote for link down");
 		htc_vote_link_down(htc_handle, HTC_LINK_VOTE_STA_USER_ID);

+ 3 - 0
core/wma/src/wma_main.c

@@ -3393,6 +3393,7 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
 					"wlan_fw_rsp_wakelock");
 	qdf_runtime_lock_init(&wma_handle->wmi_cmd_rsp_runtime_lock);
 	qdf_runtime_lock_init(&wma_handle->sap_prevent_runtime_pm_lock);
+	qdf_runtime_lock_init(&wma_handle->ndp_prevent_runtime_pm_lock);
 
 	/* Register peer assoc conf event handler */
 	wmi_unified_register_event_handler(wma_handle->wmi_handle,
@@ -3504,6 +3505,7 @@ err_dbglog_init:
 		wma_err("Failed to destroy radio stats mutex");
 
 	qdf_wake_lock_destroy(&wma_handle->wmi_cmd_rsp_wake_lock);
+	qdf_runtime_lock_deinit(&wma_handle->ndp_prevent_runtime_pm_lock);
 	qdf_runtime_lock_deinit(&wma_handle->sap_prevent_runtime_pm_lock);
 	qdf_runtime_lock_deinit(&wma_handle->wmi_cmd_rsp_runtime_lock);
 	qdf_spinlock_destroy(&wma_handle->wma_hold_req_q_lock);
@@ -4575,6 +4577,7 @@ QDF_STATUS wma_close(void)
 	qdf_event_destroy(&wma_handle->tx_queue_empty_event);
 	wma_cleanup_hold_req(wma_handle);
 	qdf_wake_lock_destroy(&wma_handle->wmi_cmd_rsp_wake_lock);
+	qdf_runtime_lock_deinit(&wma_handle->ndp_prevent_runtime_pm_lock);
 	qdf_runtime_lock_deinit(&wma_handle->sap_prevent_runtime_pm_lock);
 	qdf_runtime_lock_deinit(&wma_handle->wmi_cmd_rsp_runtime_lock);
 	qdf_spinlock_destroy(&wma_handle->wma_hold_req_q_lock);