From 9231fb4a232b69480228ea0eb10f4c6275aa2780 Mon Sep 17 00:00:00 2001 From: haojl2 Date: Fri, 22 May 2020 18:12:30 +0800 Subject: [PATCH] touchscreen_mmi: do not lock in irq context ts_mmi_touch_event_handler is running in irq context. Do not wait mutex for long time. If mutex can not get, just enable update baseline next time. Change-Id: Ib943dfbebbd29e521c66360ff97d46ccc9dcb99f Signed-off-by: haojl2 Reviewed-on: https://gerrit.mot.com/1572687 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- .../touchscreen/touchscreen_mmi/touchscreen_mmi_gesture.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_gesture.c b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_gesture.c index 7b2311a3b3e7..0fec5d32a7c1 100644 --- a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_gesture.c +++ b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_gesture.c @@ -84,9 +84,11 @@ static int ts_mmi_touch_event_handler(struct touch_event_data *tev) #endif if (touch_cdev->pdata.fps_detection) { - if (touch_cdev->delay_baseline_update) { - TRY_TO_CALL(update_baseline, TS_MMI_UPDATE_BASELINE_ON); + if ((touch_cdev->delay_baseline_update) && + mutex_trylock(&touch_cdev->method_mutex)) { + _TRY_TO_CALL(update_baseline, TS_MMI_UPDATE_BASELINE_ON); touch_cdev->delay_baseline_update = false; + mutex_unlock(&touch_cdev->method_mutex); } } break;