From 987de7918215b2ff4a28441f0aa9531a47007104 Mon Sep 17 00:00:00 2001 From: Tiger Yu Date: Mon, 11 Nov 2019 10:59:45 +0800 Subject: [PATCH] qcacmn: Wake up system for early interrupt wakeup during suspending During system suspending, the target might request wakeup early to the host. The host will wakeup the system directly to abort current suspend to avoid mismatching PM state between host & target. Change-Id: Icf6e58ff24cbe072ef56aa22820432efb2ca1932 CRs-Fixed: 2559306 --- hif/src/hif_main.c | 2 ++ qdf/inc/qdf_lock.h | 2 ++ qdf/linux/src/qdf_lock.c | 13 +++++++++++++ 3 files changed, 17 insertions(+) diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c index dbdda54eafce..8a13b69a0e14 100644 --- a/hif/src/hif_main.c +++ b/hif/src/hif_main.c @@ -1283,6 +1283,8 @@ irqreturn_t hif_wake_interrupt_handler(int irq, void *context) if (hif_is_ut_suspended(scn)) hif_ut_fw_resume(scn); + qdf_pm_system_wakeup(); + return IRQ_HANDLED; } diff --git a/qdf/inc/qdf_lock.h b/qdf/inc/qdf_lock.h index 8b3516836316..3950c564c317 100644 --- a/qdf/inc/qdf_lock.h +++ b/qdf/inc/qdf_lock.h @@ -494,6 +494,8 @@ QDF_STATUS qdf_wake_lock_release(qdf_wake_lock_t *lock, uint32_t reason); QDF_STATUS qdf_wake_lock_destroy(qdf_wake_lock_t *lock); +void qdf_pm_system_wakeup(void); + QDF_STATUS qdf_runtime_pm_get(void); QDF_STATUS qdf_runtime_pm_put(void); QDF_STATUS qdf_runtime_pm_prevent_suspend(qdf_runtime_lock_t *lock); diff --git a/qdf/linux/src/qdf_lock.c b/qdf/linux/src/qdf_lock.c index f07e7acc23cd..0c1b19c22d7c 100644 --- a/qdf/linux/src/qdf_lock.c +++ b/qdf/linux/src/qdf_lock.c @@ -28,6 +28,7 @@ #include #endif #include +#include /** * qdf_mutex_create() - Initialize a mutex @@ -386,6 +387,18 @@ QDF_STATUS qdf_wake_lock_destroy(qdf_wake_lock_t *lock) #endif qdf_export_symbol(qdf_wake_lock_destroy); +/** + * qdf_pm_system_wakeup() - wakeup system + * + * Return: None + */ +void qdf_pm_system_wakeup(void) +{ + pm_system_wakeup(); +} + +qdf_export_symbol(qdf_pm_system_wakeup); + #ifdef FEATURE_RUNTIME_PM /** * qdf_runtime_pm_get() - do a get opperation on the device