summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTai Kuo <taikuo@google.com>2021-06-15 17:32:18 +0800
committerTreeHugger Robot <treehugger-gerrit@google.com>2021-06-17 12:00:50 +0000
commit1657b04ce1350dbd056f5f22bb2d0c787cc605ca (patch)
treebf65f7770d583b582748917c4ce0925c036efd31
parent5eb77399114351f0a8d015bb2429b035d6f0cef9 (diff)
downloadfts_touch-1657b04ce1350dbd056f5f22bb2d0c787cc605ca.tar.gz
touch: fts: cancel offload_resume_work before suspend
Put offload_resume_work, resume_work, suspend_work into the same high-priority workqueue. Cancel the resume_work does not cancel the derived delayed work offload_resume_work. Need to cancel offload_resume_work before queue the suspend work. If suspend_work was executed right after the resume_work, __pm_relax in suspend will delete __pm_wakeup_event timer immediately, and hence the offload_resume_work spi_sync work will be blocked forever. Bug: 191124673 Test: test resume then suspend to check offload_resume_work. Signed-off-by: Tai Kuo <taikuo@google.com> Change-Id: I8c050d48f2d2d45fb1a82fb227bb24f915c604e7
-rw-r--r--fts.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fts.c b/fts.c
index c05260e..1f65054 100644
--- a/fts.c
+++ b/fts.c
@@ -5413,7 +5413,9 @@ static void fts_resume_work(struct work_struct *work)
/* The grip disable command will not take effect unless
* it is delayed ~100ms.
*/
- schedule_delayed_work(&info->offload_resume_work, 100);
+ queue_delayed_work(info->event_wq,
+ &info->offload_resume_work,
+ msecs_to_jiffies(100));
}
}
#endif
@@ -5480,9 +5482,12 @@ static void fts_aggregate_bus_state(struct fts_ts_info *info)
(info->bus_refmask != 0 && !info->sensor_sleep))
return;
- if (info->bus_refmask == 0)
+ if (info->bus_refmask == 0) {
+#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
+ cancel_delayed_work_sync(&info->offload_resume_work);
+#endif
queue_work(info->event_wq, &info->suspend_work);
- else
+ } else
queue_work(info->event_wq, &info->resume_work);
}