diff options
author | Super Liu <supercjliu@google.com> | 2023-09-19 00:38:03 +0000 |
---|---|---|
committer | Super Liu <supercjliu@google.com> | 2023-09-20 06:00:17 +0000 |
commit | 9d099a1b868f0a9c6a13db171f63dd26a97b3f44 (patch) | |
tree | 421efce6a1e69f9e59067e8a308495aa6ca0fa96 | |
parent | 7f921e8d6bf3a03e8d731fda839a5eb8ea4cc54b (diff) | |
download | common-9d099a1b868f0a9c6a13db171f63dd26a97b3f44.tar.gz |
gti: fix the race between irq and pmandroid-u-qpr1-beta-2.2_r0.6android-u-qpr1-beta-2.2_r0.5android-u-qpr1-beta-2.2_r0.4android-u-qpr1-beta-2.2_r0.3android-u-qpr1-beta-2.2_r0.2android-u-qpr1-beta-2.2_r0.1android-u-qpr1-beta-2.1_r0.7android-u-qpr1-beta-2.1_r0.5android-u-qpr1-beta-2.1_r0.4android-u-qpr1-beta-2.1_r0.3android-u-qpr1-beta-2.1_r0.2android-u-qpr1-beta-2.1_r0.1android-14.0.0_r0.44android-14.0.0_r0.43android-14.0.0_r0.42android-14.0.0_r0.41android-14.0.0_r0.40android-14.0.0_r0.39android-14.0.0_r0.37android-14.0.0_r0.36android-14.0.0_r0.35android-14.0.0_r0.34android-14.0.0_r0.33android-14.0.0_r0.31android-14.0.0_r0.25android-14.0.0_r0.23android-14.0.0_r0.22android-14.0.0_r0.21android-14.0.0_r0.19android-gs-tangorpro-5.10-u-qpr1-beta2android-gs-tangorpro-5.10-android14-qpr1-betaandroid-gs-tangorpro-5.10-android14-qpr1android-gs-raviole-5.10-u-qpr1-beta2android-gs-raviole-5.10-android14-qpr1-betaandroid-gs-raviole-5.10-android14-qpr1android-gs-pantah-5.10-u-qpr1-beta2android-gs-pantah-5.10-android14-qpr1-betaandroid-gs-pantah-5.10-android14-qpr1android-gs-lynx-5.10-u-qpr1-beta2android-gs-lynx-5.10-android14-qpr1-betaandroid-gs-lynx-5.10-android14-qpr1android-gs-felix-5.10-u-qpr1-beta2android-gs-felix-5.10-android14-qpr1-betaandroid-gs-felix-5.10-android14-qpr1android-gs-bluejay-5.10-u-qpr1-beta2android-gs-bluejay-5.10-android14-qpr1-betaandroid-gs-bluejay-5.10-android14-qpr1
In the context of the TDDI project, the vendor driver
will handle wake-up gestures without requiring a prior
request for an IRQ wakelock. This situation may potentially
lead to a race condition of input_process() between the
release_all_fingers() and the irq_thread_fn(). The changes
is to keep IRQ wakelock logic to avoid the race between.
Bug: 298137746
Test: verify wake-up gesture.
Test: keeps persistent fingers to reproduce issue along
with suspend and resume.
Change-Id: I358f386fe6a428b07158c09f447dcab030ea9127
Signed-off-by: Super Liu <supercjliu@google.com>
-rw-r--r-- | goog_touch_interface.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/goog_touch_interface.c b/goog_touch_interface.c index dc8ac24..a966060 100644 --- a/goog_touch_interface.c +++ b/goog_touch_interface.c @@ -3471,20 +3471,22 @@ static irqreturn_t gti_irq_handler(int irq, void *data) static irqreturn_t gti_irq_thread_fn(int irq, void *data) { - int error; + int pm_ret; irqreturn_t ret = IRQ_NONE; struct goog_touch_interface *gti = (struct goog_touch_interface *)data; ATRACE_BEGIN(__func__); - - if (gti->tbn_enabled) { - error = goog_pm_wake_lock(gti, GTI_PM_WAKELOCK_TYPE_IRQ, true); - if (error < 0) { - GOOG_WARN(gti, "Skipping stray interrupt, pm state: (%d, %d)\n", - gti->pm.state, gti->pm.new_state); - ATRACE_END(); - return IRQ_HANDLED; - } + /* + * Allow vendor driver to handle wake-up gesture events by irq_thread_fn() + * after pm_suspend() complete without requiring a prior request for an IRQ + * wakelock. This is only for the tbn_enabled disabled case. + */ + pm_ret = goog_pm_wake_lock(gti, GTI_PM_WAKELOCK_TYPE_IRQ, true); + if (pm_ret < 0 && gti->tbn_enabled) { + GOOG_WARN(gti, "Skipping stray interrupt, pm state: (%d, %d)\n", + gti->pm.state, gti->pm.new_state); + ATRACE_END(); + return IRQ_HANDLED; } cpu_latency_qos_update_request(>i->pm_qos_req, 100 /* usec */); @@ -3507,7 +3509,7 @@ static irqreturn_t gti_irq_thread_fn(int irq, void *data) gti_debug_hc_update(gti, false); cpu_latency_qos_update_request(>i->pm_qos_req, PM_QOS_DEFAULT_VALUE); - if (gti->tbn_enabled) + if (pm_ret == 0) goog_pm_wake_unlock_nosync(gti, GTI_PM_WAKELOCK_TYPE_IRQ); ATRACE_END(); |