diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index ada556907c..77ebe6a612 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/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())) { diff --git a/core/hif/inc/hif.h b/core/hif/inc/hif.h index ec210a9123..3ccf9d2f4a 100644 --- a/core/hif/inc/hif.h +++ b/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); diff --git a/core/hif/src/pcie/if_pci.c b/core/hif/src/pcie/if_pci.c index 8971bb3a88..7b90546f4c 100644 --- a/core/hif/src/pcie/if_pci.c +++ b/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