Browse Source

qcacld-3.0: Ignore idle_shutdown if any interface is up

In function __hdd_psoc_idle_shutdown(), after getting sync context,
ignore idle_shutdown if any interface is up. This is done to handle
special scenario in which platform driver triggers idle shutdown
when it receives Deep sleep/Hibernate entry notification from modem
subsystem in wearable devices.

And return EAGAIN to platform driver once checking failure.

Change-Id: I6ca2a1cb33aaf8a3b475f81109803fcdde86bbc4
CRs-Fixed: 3242998
Yu Ouyang 2 years ago
parent
commit
96b70b39b7
1 changed files with 11 additions and 11 deletions
  1. 11 11
      core/hdd/src/wlan_hdd_main.c

+ 11 - 11
core/hdd/src/wlan_hdd_main.c

@@ -11985,7 +11985,17 @@ static int __hdd_psoc_idle_shutdown(struct hdd_context *hdd_ctx)
 	}
 
 	osif_psoc_sync_wait_for_ops(psoc_sync);
-	errno = hdd_wlan_stop_modules(hdd_ctx, false);
+	/*
+	 * This is to handle scenario in which platform driver triggers
+	 * idle_shutdown if Deep Sleep/Hibernate entry notification is
+	 * received from modem subsystem in wearable devices
+	 */
+	if (hdd_is_any_interface_open(hdd_ctx)) {
+		hdd_err_rl("all interfaces are not down, ignore idle shutdown");
+		errno = -EAGAIN;
+	} else {
+		errno = hdd_wlan_stop_modules(hdd_ctx, false);
+	}
 
 	osif_psoc_sync_trans_stop(psoc_sync);
 
@@ -12011,16 +12021,6 @@ int hdd_psoc_idle_shutdown(struct device *dev)
 	if (is_mode_change_psoc_idle_shutdown)
 		ret = __hdd_mode_change_psoc_idle_shutdown(hdd_ctx);
 	else {
-		/*
-		 * This is to handle scenario in which platform driver triggers
-		 * idle_shutdown if Deep Sleep/Hibernate entry notification is
-		 * received from modem subsystem in wearable devices
-		 */
-		if (hdd_is_any_interface_open(hdd_ctx)) {
-			hdd_err_rl("all interfaces are not down, ignore idle shutdown");
-			return -EINVAL;
-		}
-
 		ret =  __hdd_psoc_idle_shutdown(hdd_ctx);
 	}