input: touch: maxim_sti: Check thread stop condition
authorBo Kim <bok@nvidia.com>
Fri, 13 Sep 2013 07:48:03 +0000 (16:48 +0900)
committerGabby Lee <galee@nvidia.com>
Sun, 13 Oct 2013 23:00:32 +0000 (16:00 -0700)
commitb7b916f5bed7e5f5a9c3933fb7f7f7eac82ee36a
treedd1aeec0c6c364cb509e08ee05a832b197cd68b9
parent5619343166ceb62444673e51c341deea5731f29f
input: touch: maxim_sti: Check thread stop condition

Problems:
If shutdown or remove is called when suspended, it could be stuck in
infinite loop.

Changes:
1. Check kthread_should_stop() in several loops should be helpful to
avoid infinite loop problem.
2. Add __pm_stay_awake() in resume() and __pm_relax() in suspend()
should be helpful to avoid messaging error touch fusion driver and touch
fusion daemon by user space freezing between suspend and resume.
3. shutdown()/remove() stops processing_thread() before killing daemon.

Bug 1366179

Change-Id: I68464164440418a53bd37ce1821e04b630c12aec
Signed-off-by: Bo Kim <bok@nvidia.com>
Reviewed-on: http://git-master/r/274196
(cherry picked from commit 62c978972b14446f49433e08552cd14972369013)
Reviewed-on: http://git-master/r/288761
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gabby Lee <galee@nvidia.com>
drivers/input/touchscreen/maxim_sti.c