cpufreq: interactive: fix race on governor start/stop
authorLianwei Wang <a22439@motorola.com>
Mon, 7 Jan 2013 06:15:51 +0000 (14:15 +0800)
committerArve Hjønnevåg <arve@android.com>
Mon, 1 Jul 2013 21:16:19 +0000 (14:16 -0700)
commitde096a7b3f3aa0efd65593dd8c0f0f6153776416
tree47778e79a6049c8d8dd240ff8276ed488bf696f8
parente585d17670d55246c2fe0a8cf8a1fe8d2275d1ff
cpufreq: interactive: fix race on governor start/stop

There is race condition when both two cpu do CPUFREQ_GOV_STOP and one cpu
do CPUFREQ_GOV_START soon. The sysfs_remove_group is not done yet on one
cpu, but sysfs_create_group is called on another cpu, which cause governor
start failed and then kernel panic in timer callback because the policy and
cpu mask are all kfree in cpufreq driver.

Replace atomic with mutex to lock the whole START/STOP sequence.

Change-Id: I3762b3d44315ae021b8275aca84f5ea9147cc540
Signed-off-by: Lianwei Wang <a22439@motorola.com>
drivers/cpufreq/cpufreq_interactive.c