Selaa lähdekoodia

qcacld-3.0: request runtime sync resume while removing driver

When __hdd_soc_remove is called from platform driver, for
removing the driver, request runtime sync resume before setting
unload_in_progress flag, such that runtime resume can happen.
Also, remove wlan_hdd_validate_context to skip unload_in_progress
flag check and have only SSR check during resume callback.

Change-Id: I545c6e10f9c18ff44c05a5d284aa9b82c7ec5ed5
CRs-Fixed: 2750981
Vevek Venkatesan 4 vuotta sitten
vanhempi
sitoutus
d33b74f869
1 muutettua tiedostoa jossa 15 lisäystä ja 1 poistoa
  1. 15 1
      core/hdd/src/wlan_hdd_driver_ops.c

+ 15 - 1
core/hdd/src/wlan_hdd_driver_ops.c

@@ -676,6 +676,7 @@ static int hdd_soc_recovery_reinit(struct device *dev,
 static void __hdd_soc_remove(struct device *dev)
 {
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+	void *hif_ctx;
 
 	QDF_BUG(hdd_ctx);
 	if (!hdd_ctx)
@@ -684,6 +685,15 @@ static void __hdd_soc_remove(struct device *dev)
 	pr_info("%s: Removing driver v%s\n", WLAN_MODULE_NAME,
 		QWLAN_VERSIONSTR);
 
+	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
+	if (hif_ctx) {
+		/*
+		 * Trigger runtime sync resume before setting unload in progress
+		 * such that resume can happen successfully
+		 */
+		hif_pm_runtime_sync_resume(hif_ctx);
+	}
+
 	cds_set_driver_loaded(false);
 	cds_set_unload_in_progress(true);
 	if (!hdd_wait_for_debugfs_threads_completion())
@@ -1517,8 +1527,12 @@ static int wlan_hdd_runtime_resume(struct device *dev)
 	hdd_debug("Starting runtime resume");
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (wlan_hdd_validate_context(hdd_ctx))
+
+	if (cds_is_driver_recovering()) {
+		hdd_debug("Recovery in progress, state:0x%x",
+			  cds_get_driver_state());
 		return 0;
+	}
 
 	if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
 		hdd_debug("Driver module closed skipping runtime resume");