cpufreq: cpufreq_stats: Register for bL_switcher notifiers
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 11 Dec 2012 11:00:01 +0000 (16:30 +0530)
committerJon Medhurst <tixy@linaro.org>
Fri, 19 Jul 2013 12:43:15 +0000 (13:43 +0100)
commit2759011945a8b811fa6db98392b629423d7e21d9
treeaacaa22b6080c6b16832305961a3b1df684c91cf
parent24abb4a376229e68895d1296f38c4743a4559a2f
cpufreq: cpufreq_stats: Register for bL_switcher notifiers

cpufreq_stat has registered notifiers with both cpufreq and cpu core. It adds
cpu/cpu0/cpufreq/stats/ directory with a notifier of cpufreq CPUFREQ_NOTIFY and
removes this directory with a notifier to cpu core.

On bL_switcher enable/disable, cpufreq drivers notifiers gets called and they
call cpufreq_unregister(), followed by cpufreq_register(). For unregister stats
directories per cpu aren't removed, because cpu never went to dead state and cpu
notifier isn't called.

When cpufreq_register() is called, we try to add these directories again and
that simply fails, as directories were already present.

Fix these issues by registering cpufreq_stats too with bL_switcher notifiers, so
that they get unregistered and registered on switcher enable/disable.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/cpufreq_stats.c