Kaynağa Gözat

qcacld-3.0: Fix rmmod for runtime pm

Runtime PM should be turned off before the driver is unloaded.

Change-Id: I8746e92931375893708556e77a3d93bfd6266668
CRs-Fixed: 935300
Houston Hoffman 9 yıl önce
ebeveyn
işleme
53b34c4714

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

@@ -314,6 +314,7 @@ static void wlan_hdd_remove(void)
 
 	hif_ctx = cds_get_context(CDF_MODULE_ID_HIF);
 
+	hif_disable_power_management(hif_ctx);
 	hif_pktlogmod_exit(hif_ctx);
 
 	if (WLAN_IS_EPPING_ENABLED(cds_get_conparam())) {

+ 1 - 0
core/hif/inc/hif.h

@@ -684,6 +684,7 @@ void hif_runtime_pm_set_state_inprogress(void);
 void hif_runtime_pm_set_state_on(void);
 
 void hif_enable_power_management(void *hif_ctx);
+void hif_disable_power_management(void *hif_ctx);
 int hif_runtime_suspend(void);
 int hif_runtime_resume(void);
 int hif_bus_resume(void);

+ 23 - 0
core/hif/src/pcie/if_pci.c

@@ -1094,6 +1094,7 @@ static void hif_pm_runtime_close(struct hif_pci_softc *sc)
 static void hif_pm_runtime_close(struct hif_pci_softc *sc) {}
 static void hif_pm_runtime_open(struct hif_pci_softc *sc) {}
 static void hif_pm_runtime_start(struct hif_pci_softc *sc) {}
+static void hif_pm_runtime_stop(struct hif_pci_softc *sc) {}
 #endif
 
 /**
@@ -1119,6 +1120,28 @@ void hif_enable_power_management(void *hif_ctx)
 	hif_pm_runtime_start(pci_ctx);
 }
 
+/**
+ * hif_disable_power_management(): disable power management
+ * @hif_ctx: hif context
+ *
+ * Currently disables runtime pm. Should be updated to behave
+ * if runtime pm is not started. Should be updated to take care
+ * of aspm and soc sleep for driver load.
+ */
+void hif_disable_power_management(void *hif_ctx)
+{
+	struct hif_pci_softc *pci_ctx;
+
+	if (hif_ctx == NULL) {
+		HIF_ERROR("%s, hif_ctx null", __func__);
+		return;
+	}
+
+	pci_ctx = ((struct ol_softc *)hif_ctx)->hif_sc;
+
+	hif_pm_runtime_stop(pci_ctx);
+}
+
 #define ATH_PCI_PROBE_RETRY_MAX 3
 /**
  * hif_bus_open(): hif_bus_open