浏览代码

qcacld-3.0: Prevent RTPM wow for wow feature unit test

Prevent RTPM wow when executing wow feature unit tests to avoid
conflicting wow states.

Change-Id: I279f99e5b66ad0a28bdcb8a54534b0b048db5acd
CRs-Fixed: 2853620
Rajeev Kumar 4 年之前
父节点
当前提交
50e92e6f3c
共有 3 个文件被更改,包括 22 次插入0 次删除
  1. 2 0
      core/hdd/inc/wlan_hdd_main.h
  2. 2 0
      core/hdd/src/wlan_hdd_main.c
  3. 18 0
      core/hdd/src/wlan_hdd_power.c

+ 2 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -1146,6 +1146,7 @@ struct hdd_chan_change_params {
  * @user: user context to prevent/allow runtime pm
  * @is_user_wakelock_acquired: boolean to check if user wakelock status
  * @monitor_mode: monitor mode context to prevent/allow runtime pm
+ * @wow_unit_test: wow unit test mode context to prevent/allow runtime pm
  *
  * Runtime PM control for underlying activities
  */
@@ -1155,6 +1156,7 @@ struct hdd_runtime_pm_context {
 	qdf_runtime_lock_t user;
 	bool is_user_wakelock_acquired;
 	qdf_runtime_lock_t monitor_mode;
+	qdf_runtime_lock_t wow_unit_test;
 };
 
 /*

+ 2 - 0
core/hdd/src/wlan_hdd_main.c

@@ -1438,6 +1438,7 @@ static void hdd_runtime_suspend_context_init(struct hdd_context *hdd_ctx)
 	qdf_runtime_lock_init(&ctx->connect);
 	qdf_runtime_lock_init(&ctx->user);
 	qdf_runtime_lock_init(&ctx->monitor_mode);
+	qdf_runtime_lock_init(&ctx->wow_unit_test);
 
 	ctx->is_user_wakelock_acquired = false;
 
@@ -1457,6 +1458,7 @@ static void hdd_runtime_suspend_context_deinit(struct hdd_context *hdd_ctx)
 	if (ctx->is_user_wakelock_acquired)
 		qdf_runtime_pm_allow_suspend(&ctx->user);
 
+	qdf_runtime_lock_deinit(&ctx->wow_unit_test);
 	qdf_runtime_lock_deinit(&ctx->monitor_mode);
 	qdf_runtime_lock_deinit(&ctx->user);
 	qdf_runtime_lock_deinit(&ctx->connect);

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

@@ -2819,8 +2819,17 @@ static void __hdd_wlan_fake_apps_resume(struct wiphy *wiphy,
 					struct net_device *dev)
 {
 	struct hif_opaque_softc *hif_ctx;
+	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	qdf_device_t qdf_dev;
 
+	if (wlan_hdd_validate_context(hdd_ctx))
+		return;
+
+	if (!hdd_ctx->config->is_unit_test_framework_enabled) {
+		hdd_warn_rl("UT framework is disabled");
+		return;
+	}
+
 	hdd_info("Unit-test resume WLAN");
 
 	qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
@@ -2856,6 +2865,9 @@ static void __hdd_wlan_fake_apps_resume(struct wiphy *wiphy,
 	dev->watchdog_timeo = HDD_TX_TIMEOUT;
 
 	hdd_alert("Unit-test resume succeeded");
+
+	hdd_info("allow rtpm wow for wow unit test");
+	qdf_runtime_pm_allow_suspend(&hdd_ctx->runtime_context.wow_unit_test);
 }
 
 /**
@@ -2928,6 +2940,9 @@ int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy, struct net_device *dev,
 		return 0;
 	}
 
+	hdd_info("prevent rtpm wow for wow unit test");
+	qdf_runtime_pm_prevent_suspend(&hdd_ctx->runtime_context.wow_unit_test);
+
 	/* pci link is needed to wakeup from HTC wakeup trigger */
 	if (resume_setting == WOW_RESUME_TRIGGER_HTC_WAKEUP)
 		hif_vote_link_up(hif_ctx);
@@ -2988,6 +3003,9 @@ link_down:
 	clear_bit(HDD_FA_SUSPENDED_BIT, &fake_apps_state);
 	hdd_err("Unit-test suspend failed: %d", errno);
 
+	hdd_info("allow rtpm wow for wow unit test");
+	qdf_runtime_pm_allow_suspend(&hdd_ctx->runtime_context.wow_unit_test);
+
 	return errno;
 }