cpuquiet: Remove synchronization from runnables_work_func()
authorPeter Boonstoppel <pboonstoppel@nvidia.com>
Thu, 24 Jan 2013 19:04:02 +0000 (11:04 -0800)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 18 May 2015 08:07:10 +0000 (16:07 +0800)
commita0529ec18b5c492bb55707061873d4db078b0445
treef5af93cdeb2e40b5b1272753dbc8cf0da54acbd7
parenta5ba2c6a79c57e0b204517f8a0f9d904cb34ebcf
cpuquiet: Remove synchronization from runnables_work_func()

runnables_stop() can deadlock when cancel_work_sync() waits for the
work function to end and the work function blocks on the same lock
held by runnables_stop().

Removing the locks from runnables_work_func() fixes this. This should
be safe because runnables_lock protects runnables_state and
runnables_work_func() only reads runnables_state. Also, the functions
that change state to DISABLED do a cancel_work_sync() to guarantee the
work function stopped running.

Bug 1215668

Change-Id: I70617b3b0fc81db8555869e67e3b11652af8d94c
Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-on: http://git-master/r/193881
Reviewed-by: Mandar Padmawar <mpadmawar@nvidia.com>
Tested-by: Mandar Padmawar <mpadmawar@nvidia.com>
drivers/cpuquiet/governors/runnable_threads.c