summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRavi Jain <raviajain@google.com>2022-12-06 09:32:34 +0000
committerAndroid Partner Code Review <android-gerrit-partner@google.com>2022-12-06 09:32:34 +0000
commit23f746a78e7081741677a30eec3a62df2e4fac76 (patch)
treed3f28218759d639fd7da9e64a48b535a02af9d20
parentf513b970e0473db577afe9bba02e2cd8327eb270 (diff)
parentb8701900bbc56e52f8c1f381aecbd53017174881 (diff)
downloadgoodix_touch-23f746a78e7081741677a30eec3a62df2e4fac76.tar.gz
Merge "touch: goodix: Fix deadlock between irq and wakelock" into android13-gs-pixel-5.10-tm-qpr2
-rw-r--r--goodix_brl_hw.c2
-rw-r--r--goodix_ts_core.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/goodix_brl_hw.c b/goodix_brl_hw.c
index c423674..1e3bc1a 100644
--- a/goodix_brl_hw.c
+++ b/goodix_brl_hw.c
@@ -344,7 +344,7 @@ static int brl_irq_enable(struct goodix_ts_core *cd, bool enable)
}
if (!enable && atomic_cmpxchg(&cd->irq_enabled, 1, 0)) {
- disable_irq(cd->irq);
+ disable_irq_nosync(cd->irq);
ts_debug("Irq disabled");
return 0;
}
diff --git a/goodix_ts_core.c b/goodix_ts_core.c
index 44291c8..ce66b48 100644
--- a/goodix_ts_core.c
+++ b/goodix_ts_core.c
@@ -1871,7 +1871,11 @@ static irqreturn_t goodix_ts_threadirq_func(int irq, void *data)
int ret;
#if IS_ENABLED(CONFIG_GOOG_TOUCH_INTERFACE) && IS_ENABLED(CONFIG_GTI_PM)
- goog_pm_wake_lock(core_data->gti, GTI_PM_WAKELOCK_TYPE_IRQ, true);
+ ret = goog_pm_wake_lock(core_data->gti, GTI_PM_WAKELOCK_TYPE_IRQ, true);
+ if(ret < 0) {
+ GOOG_INFO("Error while obtaing IRQ wakelock: %d!\n", ret);
+ return IRQ_HANDLED;
+ }
#endif
ts_esd->irq_status = true;
@@ -1886,7 +1890,7 @@ static irqreturn_t goodix_ts_threadirq_func(int irq, void *data)
if (ret == EVT_CANCEL_IRQEVT) {
mutex_unlock(&goodix_modules.mutex);
#if IS_ENABLED(CONFIG_GOOG_TOUCH_INTERFACE) && IS_ENABLED(CONFIG_GTI_PM)
- goog_pm_wake_unlock(core_data->gti, GTI_PM_WAKELOCK_TYPE_IRQ);
+ goog_pm_wake_unlock_nosync(core_data->gti, GTI_PM_WAKELOCK_TYPE_IRQ);
#endif
return IRQ_HANDLED;
}
@@ -1925,7 +1929,7 @@ static irqreturn_t goodix_ts_threadirq_func(int irq, void *data)
}
#if IS_ENABLED(CONFIG_GOOG_TOUCH_INTERFACE) && IS_ENABLED(CONFIG_GTI_PM)
- goog_pm_wake_unlock(core_data->gti, GTI_PM_WAKELOCK_TYPE_IRQ);
+ goog_pm_wake_unlock_nosync(core_data->gti, GTI_PM_WAKELOCK_TYPE_IRQ);
#endif
return IRQ_HANDLED;