Browse Source

qcacld-3.0: Don't set unload flags before unregister_driver when unloading

Don't set unload flags earlier before unregister_driver when driver
unloading to avoid runtime resume failure. And set this flags earlier
before wait_for_ops in the pld_pcie_remove to give chance SSR will be
skipped if unloading is in progress.

Change-Id: I084db32b436148932a2a90e3e1dcb1122f4303b5
CRs-Fixed: 2589413
Tiger Yu 5 years ago
parent
commit
db568a828c
2 changed files with 8 additions and 3 deletions
  1. 3 3
      core/hdd/src/wlan_hdd_main.c
  2. 5 0
      core/pld/src/pld_pcie.c

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

@@ -14766,9 +14766,6 @@ static void hdd_driver_unload(void)
 	pr_info("%s: Unloading driver v%s\n", WLAN_MODULE_NAME,
 		QWLAN_VERSIONSTR);
 
-	cds_set_driver_loaded(false);
-	cds_set_unload_in_progress(true);
-
 	if (hdd_ctx)
 		hdd_psoc_idle_timer_stop(hdd_ctx);
 
@@ -14785,6 +14782,9 @@ static void hdd_driver_unload(void)
 	osif_driver_sync_unregister();
 	osif_driver_sync_wait_for_ops(driver_sync);
 
+	cds_set_driver_loaded(false);
+	cds_set_unload_in_progress(true);
+
 	hdd_driver_mode_change_unregister();
 	pld_deinit();
 	wlan_hdd_state_ctrl_param_destroy();

+ 5 - 0
core/pld/src/pld_pcie.c

@@ -29,6 +29,7 @@
 #include "pld_internal.h"
 #include "pld_pcie.h"
 #include "osif_psoc_sync.h"
+#include <cds_api.h>
 
 #ifdef CONFIG_PCI
 
@@ -91,6 +92,10 @@ static void pld_pcie_remove(struct pci_dev *pdev)
 		return;
 
 	osif_psoc_sync_unregister(&pdev->dev);
+
+	cds_set_driver_loaded(false);
+	cds_set_unload_in_progress(true);
+
 	osif_psoc_sync_wait_for_ops(psoc_sync);
 
 	pld_context = pld_get_global_context();