From: Sai Gurrappadi Date: Tue, 13 May 2014 21:50:09 +0000 (-0700) Subject: drivers: cpuquiet: Fix runnable gov device_busy X-Git-Tag: firefly_0821_release~4158^2~20 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=336b58f94a79f653c0b7826aa7cd145aa5fba5b5;p=firefly-linux-kernel-4.4.55.git drivers: cpuquiet: Fix runnable gov device_busy On device_busy, the runnable governor stops its sample timer and cancels any queued runnable_work. However, it is possible for the cpuquiet platform driver to call device_busy on cpuquiet_quiesence/wake_cpu calls which can be invoked from the queued runnable_worker thread. This will lead to the runnable_worker thread waiting infinitely on it self finishing in cancel_work_sync. Fix this by removing the cancel_work_sync call as it isn't necessary because the worker doesn't requeue it self. Stopping the timer is sufficient. Bug 200002511 Change-Id: Ic69061b12d4dbb96b259ed9b62a0475271bd36d0 Signed-off-by: Sai Gurrappadi (cherry picked from commit b9a2a2cfa91d14935fdef626517d738399af4e4d) Reviewed-on: http://git-master/r/415315 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Diwakar Tundlam Reviewed-by: Kerwin Wan --- diff --git a/drivers/cpuquiet/governors/runnable_threads.c b/drivers/cpuquiet/governors/runnable_threads.c index f670d1a1aec5..f9d6d560cb35 100644 --- a/drivers/cpuquiet/governors/runnable_threads.c +++ b/drivers/cpuquiet/governors/runnable_threads.c @@ -292,7 +292,6 @@ static void runnables_device_busy(void) mutex_lock(&runnables_lock); if (runnables_state == RUNNING) { runnables_state = IDLE; - cancel_work_sync(&runnables_work); del_timer_sync(&runnables_timer); } mutex_unlock(&runnables_lock); @@ -314,7 +313,6 @@ static void runnables_stop(void) runnables_state = DISABLED; del_timer_sync(&runnables_timer); - cancel_work_sync(&runnables_work); kobject_put(runnables_kobject); kfree(runnables_kobject);