summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYen-Chao Chen <davidycchen@google.com>2023-05-10 16:13:31 +0800
committerYen-Chao Chen <davidycchen@google.com>2023-05-10 17:44:42 +0800
commit71028bc91b322fb73d49ac311ec12ac8161fb1a6 (patch)
tree1548b2a166292b723a01279dc47ee33182ca509c
parentf101de07c67c7d01ee27c4fa4450aa0805483930 (diff)
downloadcommon-71028bc91b322fb73d49ac311ec12ac8161fb1a6.tar.gz
Add IRQ wake lock to avoid the suspending process before IRQ handler finishes. Bug: 281463326 Test: Put fingers on the screen and suspend/resume the device. Change-Id: Id98013ac1d87deebd3d5028113946cfda3b7171e Signed-off-by: Yen-Chao Chen <davidycchen@google.com>
-rw-r--r--goog_touch_interface.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/goog_touch_interface.c b/goog_touch_interface.c
index db2ab83..8369505 100644
--- a/goog_touch_interface.c
+++ b/goog_touch_interface.c
@@ -3467,10 +3467,20 @@ static irqreturn_t gti_irq_handler(int irq, void *data)
static irqreturn_t gti_irq_thread_fn(int irq, void *data)
{
- irqreturn_t ret;
+ int error;
+ irqreturn_t ret = IRQ_NONE;
struct goog_touch_interface *gti = (struct goog_touch_interface *)data;
ATRACE_BEGIN(__func__);
+
+ error = goog_pm_wake_lock(gti, GTI_PM_WAKELOCK_TYPE_IRQ, true);
+ if (error < 0) {
+ GOOG_WARN(gti, "Skipping stray interrupt, power_status: %d, new power_status: %d\n",
+ gti->pm.state, gti->pm.new_state);
+ ATRACE_END();
+ return IRQ_HANDLED;
+ }
+
cpu_latency_qos_update_request(&gti->pm_qos_req, 100 /* usec */);
/*
@@ -3491,6 +3501,7 @@ static irqreturn_t gti_irq_thread_fn(int irq, void *data)
gti_debug_hc_update(gti, false);
cpu_latency_qos_update_request(&gti->pm_qos_req, PM_QOS_DEFAULT_VALUE);
+ goog_pm_wake_unlock_nosync(gti, GTI_PM_WAKELOCK_TYPE_IRQ);
ATRACE_END();
return ret;