diff options
| author | Komal Seelam <kseelam@qti.qualcomm.com> | 2016-05-19 21:22:14 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-05-30 14:51:46 +0530 |
| commit | 0f628694a6cfb2d7ec23f7c9bece9b2067fbe1e3 (patch) | |
| tree | b531532af5c347abf8759f254e663326513b9430 | |
| parent | b414242636bc681daf25b02276b0ca48c10b703e (diff) | |
qcacld-2.0: API to do runtime pm active
Driver Upper layers are not aware of runtime pm state. We have seen
cases, where upper layers want to do driver to be runtime active.
One such case is, during MCC, Firmware sends pause event to host,
and driver is runtime suspended.
Host got a DHCP or ARP packet, which gets queued in the tx layer,
as the vdev queues are paused.
Firmware doesn't have wakeup capability for un pause events, so
driver doesn't unpause the queues, which results in a data stall.
The fix is to do runtime resume so driver can recieve unpause events
and allow data packets to flow through.
Hence provide an API to do runtime resume when needed.
CRs-Fixed: 1018401
Change-Id: Ie0d080ff1a8f6c05677af6f575fb93a62f13a0c6
| -rw-r--r-- | CORE/SERVICES/COMMON/hif.h | 5 | ||||
| -rw-r--r-- | CORE/SERVICES/HIF/PCIe/hif_pci.c | 18 | ||||
| -rw-r--r-- | CORE/VOSS/inc/vos_lock.h | 3 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_lock.c | 27 |
4 files changed, 51 insertions, 2 deletions
diff --git a/CORE/SERVICES/COMMON/hif.h b/CORE/SERVICES/COMMON/hif.h index 4e163e104701..a3c31afe3bd6 100644 --- a/CORE/SERVICES/COMMON/hif.h +++ b/CORE/SERVICES/COMMON/hif.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -853,6 +853,7 @@ int hif_pm_runtime_prevent_suspend(void *ol_sc, void *data); int hif_pm_runtime_allow_suspend(void *ol_sc, void *data); int hif_pm_runtime_prevent_suspend_timeout(void *ol_sc, void *data, unsigned int delay); +void hif_request_runtime_pm_resume(void *ol_sc); #else static inline int hif_pm_runtime_get(HIF_DEVICE *device) { return 0; } static inline int hif_pm_runtime_put(HIF_DEVICE *device) { return 0; } @@ -870,6 +871,8 @@ static inline void * hif_runtime_pm_prevent_suspend_init(const char *name) { return NULL; } static inline void hif_runtime_pm_prevent_suspend_deinit(void *context) { } +static inline void hif_request_runtime_pm_resume(void *ol_sc) +{ } #endif #ifdef __cplusplus } diff --git a/CORE/SERVICES/HIF/PCIe/hif_pci.c b/CORE/SERVICES/HIF/PCIe/hif_pci.c index cc96b373085e..3a1de9d23d07 100644 --- a/CORE/SERVICES/HIF/PCIe/hif_pci.c +++ b/CORE/SERVICES/HIF/PCIe/hif_pci.c @@ -3595,6 +3595,24 @@ void hif_pm_ssr_runtime_allow_suspend(struct hif_pci_softc *sc, void *context) { __hif_pm_runtime_allow_suspend(sc, context); } + +/** + * hif_request_runtime_pm_resume() - API to do runtime resume + * @ol_sc: HIF context + * + * API to request runtime resume + * + * Return: void + */ +void hif_request_runtime_pm_resume(void *ol_sc) +{ + struct ol_softc *sc = (struct ol_softc *)ol_sc; + struct hif_pci_softc *hif_sc = sc->hif_sc; + struct device *dev = hif_sc->dev; + + hif_pm_request_resume(dev); + hif_pm_runtime_mark_last_busy(dev); +} #endif /** diff --git a/CORE/VOSS/inc/vos_lock.h b/CORE/VOSS/inc/vos_lock.h index 37608982979e..882ddbae32b2 100644 --- a/CORE/VOSS/inc/vos_lock.h +++ b/CORE/VOSS/inc/vos_lock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -313,4 +313,5 @@ VOS_STATUS vos_runtime_pm_prevent_suspend_timeout(runtime_pm_context_t context, unsigned int msec); void *vos_runtime_pm_prevent_suspend_init(const char *); void vos_runtime_pm_prevent_suspend_deinit(runtime_pm_context_t); +VOS_STATUS vos_request_runtime_pm_resume(void); #endif // __VOSS_LOCK_H diff --git a/CORE/VOSS/src/vos_lock.c b/CORE/VOSS/src/vos_lock.c index f99fe25d83f5..4dcb3394e42c 100644 --- a/CORE/VOSS/src/vos_lock.c +++ b/CORE/VOSS/src/vos_lock.c @@ -745,3 +745,30 @@ void vos_runtime_pm_prevent_suspend_deinit(runtime_pm_context_t data) { hif_runtime_pm_prevent_suspend_deinit(data); } + +/** + * vos_request_runtime_pm_resume() - API to ensure driver is runtime pm active + * + * Driver modules can use this API to ensure driver is runtime pm active + * + * Return: VOS_STATUS + */ +VOS_STATUS vos_request_runtime_pm_resume(void) +{ + void *ol_sc; + v_CONTEXT_t gContext; + + gContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + + ol_sc = vos_get_context(VOS_MODULE_ID_HIF, gContext); + + if (ol_sc == NULL) { + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: HIF context is null!", __func__); + return VOS_STATUS_E_INVAL; + } + + hif_request_runtime_pm_resume(ol_sc); + + return VOS_STATUS_SUCCESS; +} |
