Parcourir la source

qcacld-3.0: Prevent race between suspend and idle shutdown

Idle shutdown is running in Thread 1 and in parallel suspend
request comes which is getting executed in thread 2. As a part
of idle shutdown the CE buffers are freed.As a result of this
WoW Ack is not reaped which leads to panic.

To avoid this issue, flush the idle shutdown delayed work before
proceeding for suspend.

CRs-Fixed: 2839296
Change-Id: I449bb1960776bf3d60e329a189b7bad998929240
Sachin Ahuja il y a 4 ans
Parent
commit
5ac9859206
2 fichiers modifiés avec 10 ajouts et 5 suppressions
  1. 7 5
      core/hdd/src/wlan_hdd_driver_ops.c
  2. 3 0
      core/hdd/src/wlan_hdd_power.c

+ 7 - 5
core/hdd/src/wlan_hdd_driver_ops.c

@@ -1118,8 +1118,13 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params)
 	hdd_info("starting bus suspend");
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx)
-		return -ENODEV;
+
+	err = wlan_hdd_validate_context(hdd_ctx);
+	if (err)
+		return err;
+
+	/* Wait for the stop module if already in progress */
+	hdd_psoc_idle_timer_stop(hdd_ctx);
 
 	/* If Wifi is off, return success for system suspend */
 	if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
@@ -1127,9 +1132,6 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params)
 		return 0;
 	}
 
-	err = wlan_hdd_validate_context(hdd_ctx);
-	if (err)
-		return err;
 
 	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
 	if (!hif_ctx)

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

@@ -2025,6 +2025,9 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
 	if (0 != rc)
 		return rc;
 
+	/* Wait for the stop module if already in progress */
+	hdd_psoc_idle_timer_stop(hdd_ctx);
+
 	if (hdd_ctx->config->is_wow_disabled) {
 		hdd_info_rl("wow is disabled");
 		return -EINVAL;