From bc74187e4a8dec8eb34e6ebd660c424edc0f31cd Mon Sep 17 00:00:00 2001 From: Ravi Jain Date: Thu, 1 Dec 2022 13:14:26 +0800 Subject: touch: goodix: Fix deadlock between irq and wakelock 1. Use of disable_irq_nosync instead of disable_irq. 2. Add Error handling while obtaining irq_wakelock. Test: Flashed locally to test resume/suspend operations. Bug: 230827813 Change-Id: Icf0e6ce80c9b5e9e3b95c9f8d4debf1163b69843 Signed-off-by: Ravi Jain --- goodix_ts_core.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'goodix_ts_core.c') 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; -- cgit v1.2.3