diff options
| author | Komal Seelam <kseelam@qti.qualcomm.com> | 2015-11-25 17:02:17 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2015-11-26 15:39:20 +0530 |
| commit | f6759ebef229f8fb31abb9fdd8ae3b0caf3ba2f8 (patch) | |
| tree | e35b562d5272f10c10f0a261e407a74daf124bb6 | |
| parent | 53277599cba0bc5f60a2f743e993e0a179065363 (diff) | |
qcacld-2.0: Delete Runtime Context from prevent suspend list on SSR
During SSR, HDD retains both HDD global context and adapter context.
Along with HDD global context, HDD runtime pm context should not be
deleted during SSR. During SSR shutdown, deactive the runtime context
and delete the entry from prevent suspend list and decrement the usage
count of the context.
Change-Id: I7a51cbbb0762778dde5bb578bb8d89fec01a460a
CRs-Fixed: 943563
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_early_suspend.c | 3 | ||||
| -rw-r--r-- | CORE/SERVICES/HIF/PCIe/hif_pci.c | 16 | ||||
| -rw-r--r-- | CORE/SERVICES/HIF/PCIe/hif_pci.h | 3 | ||||
| -rw-r--r-- | CORE/SERVICES/HIF/PCIe/if_pci.c | 25 |
4 files changed, 43 insertions, 4 deletions
diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c index 48516a44759e..447a3e8a8761 100644 --- a/CORE/HDD/src/wlan_hdd_early_suspend.c +++ b/CORE/HDD/src/wlan_hdd_early_suspend.c @@ -1845,7 +1845,6 @@ VOS_STATUS hdd_wlan_shutdown(void) } #endif - hdd_runtime_suspend_deinit(pHddCtx); hdd_reset_all_adapters(pHddCtx); #ifdef IPA_UC_OFFLOAD @@ -2159,7 +2158,6 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) /* Pass FW version to HIF layer */ hif_set_fw_info(hif_sc, pHddCtx->target_fw_version); - hdd_runtime_suspend_init(pHddCtx); /* Restart all adapters */ hdd_start_all_adapters(pHddCtx); @@ -2238,7 +2236,6 @@ err_unregister_pmops: #ifdef CONFIG_HAS_EARLYSUSPEND hdd_unregister_mcast_bcast_filter(pHddCtx); #endif - hdd_runtime_suspend_deinit(pHddCtx); hdd_close_all_adapters(pHddCtx); err_vosstop: diff --git a/CORE/SERVICES/HIF/PCIe/hif_pci.c b/CORE/SERVICES/HIF/PCIe/hif_pci.c index fbfe1ce3c11e..ec38d9557fdf 100644 --- a/CORE/SERVICES/HIF/PCIe/hif_pci.c +++ b/CORE/SERVICES/HIF/PCIe/hif_pci.c @@ -3578,6 +3578,22 @@ void hif_runtime_pm_prevent_suspend_deinit(void *data) adf_os_mem_free(context); } + +/** + * hif_pm_ssr_runtime_allow_suspend() - Release Runtime Context during SSR + * @sc: hif_pci context + * @context: runtime context + * + * API is used to release runtime pm context from prevent suspend list and + * reduce the usage count taken by the context and set the context state to + * false. + * + * Return: void + */ +void hif_pm_ssr_runtime_allow_suspend(struct hif_pci_softc *sc, void *context) +{ + __hif_pm_runtime_allow_suspend(sc, context); +} #endif /** diff --git a/CORE/SERVICES/HIF/PCIe/hif_pci.h b/CORE/SERVICES/HIF/PCIe/hif_pci.h index 693dbb83649e..a754c188067f 100644 --- a/CORE/SERVICES/HIF/PCIe/hif_pci.h +++ b/CORE/SERVICES/HIF/PCIe/hif_pci.h @@ -156,6 +156,7 @@ void hif_dump_pipe_debug_count(HIF_DEVICE *hif_device); #include <linux/pm_runtime.h> void hif_pci_runtime_pm_timeout_fn(unsigned long data); void hif_pci_runtime_pm_warn(struct hif_pci_softc *, const char *); +void hif_pm_ssr_runtime_allow_suspend(struct hif_pci_softc *, void *); /** * Runtime PM Context for wakelocks @@ -221,6 +222,8 @@ static inline void hif_pm_runtime_mark_last_busy(struct device *dev) { } static inline void hif_pci_runtime_pm_warn(struct hif_pci_softc *sc, const char *name) { } +static inline void +hif_pm_ssr_runtime_allow_suspend(struct hif_pci_softc *sc, void *ctx) { } #endif #define CE_HTT_T2H_MSG 1 diff --git a/CORE/SERVICES/HIF/PCIe/if_pci.c b/CORE/SERVICES/HIF/PCIe/if_pci.c index 77fb47805b9f..7d0e543614a0 100644 --- a/CORE/SERVICES/HIF/PCIe/if_pci.c +++ b/CORE/SERVICES/HIF/PCIe/if_pci.c @@ -1436,11 +1436,34 @@ static void hif_pci_pm_runtime_post_exit(struct hif_pci_softc *sc) while (atomic_read(&sc->dev->power.usage_count) != 1) pm_runtime_put_noidle(sc->dev); } + +/** + * hif_pci_pm_runtime_ssr_post_exit() - Empty the prevent suspend list on SSR + * @sc: hif_pci context + * + * API is used to empty the runtime pm prevent suspend list. + * + * Return: void + */ +static void hif_pci_pm_runtime_ssr_post_exit(struct hif_pci_softc *sc) +{ + unsigned long flags; + struct hif_pm_runtime_context *ctx, *tmp; + + spin_lock_irqsave(&sc->runtime_lock, flags); + list_for_each_entry_safe(ctx, tmp, &sc->prevent_suspend_list, list) { + hif_pm_ssr_runtime_allow_suspend(sc, ctx); + } + spin_unlock_irqrestore(&sc->runtime_lock, flags); +} + #else static inline void hif_pci_pm_runtime_init(struct hif_pci_softc *sc) { } static inline void hif_pci_pm_runtime_pre_init(struct hif_pci_softc *sc) { } static inline void hif_pci_pm_runtime_exit(struct hif_pci_softc *sc) { } static inline void hif_pci_pm_runtime_post_exit(struct hif_pci_softc *sc) { } +static inline void +hif_pci_pm_runtime_ssr_post_exit(struct hif_pci_softc *sc) { } #endif int @@ -2461,7 +2484,7 @@ void hif_pci_shutdown(struct pci_dev *pdev) pci_disable_msi(pdev); - hif_pci_pm_runtime_post_exit(sc); + hif_pci_pm_runtime_ssr_post_exit(sc); hif_deinit_adf_ctx(scn); A_FREE(scn); A_FREE(sc->hif_device); |
