cpufreq: cpufreq_interactive_pro: Fix add_timer race in CPUFREQ_GOV_LIMITS
When the governor limits are changed, it was calling
cpufreq_interactive_timer_start() after deleting the timers. But there's a
possibility for another thread to race and add the timer before
cpufreq_interactive_timer_start() is called. Remove the possibility of this
race by calling cpufreq_interactive_timer_resched() that grabs a spinlock,
deletes the timer and then adds the timer again. This works because timers
can be deleted multiple times without any side effects.
[ 686.764888] ------------[ cut here ]------------
[ 686.768484] kernel BUG at .../kernel/timer.c:931!
[ 686.787923] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[ 686.793390] Modules linked in:
[ 687.311878] Call trace:
[ 687.314316] [<ffffffc000223dd4>] add_timer_on+0x5c/0x148
[ 687.319607] [<ffffffc00082584c>] cpufreq_interactive_timer_start+0x60/0xd8
[ 687.326466] [<ffffffc0008264f8>] cpufreq_governor_interactive+0x6d4/0x720
[ 687.333239] [<ffffffc00081ca94>] __cpufreq_governor+0x120/0x1d0
[ 687.339139] [<ffffffc00081cdb0>] cpufreq_set_policy+0x26c/0x284
[ 687.345043] [<ffffffc00081db5c>] cpufreq_update_policy+0x110/0x140
[ 687.351207] [<ffffffc0007ff220>] update_cpu_freq+0x30/0x68
[ 687.356672] [<ffffffc0007ff358>] update_cluster_freq+0x100/0x128
[ 687.362667] [<ffffffc000b80d30>] do_freq_mitigation+0x140/0x16c
[ 687.368570] [<ffffffc0002363e0>] kthread+0xac/0xb8
Change-Id: I4dbc084cc5bd7f583fdca2b593a227298c345518
Signed-off-by:
Saravana Kannan <skannan@codeaurora.org>
Loading
Please register or sign in to comment