diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-02-01 00:42:58 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-02-01 19:29:31 -0500 |
commit | b394058f064848deac7a7cd6942b6521d7b3fe1d (patch) | |
tree | 2e6272ca452cf2d116f00a561344a4672f751063 /drivers/cpufreq/cpufreq.c | |
parent | 4447266b842d27f77b017a59eb9dc38ad7b299f1 (diff) |
cpufreq: governors: Reset tunables only for cpufreq_unregister_governor()
Currently, whenever governor->governor() is called for CPUFRREQ_GOV_START event
we reset few tunables of governor. Which isn't correct, as this routine is
called for every cpu hot-[un]plugging event. We should actually be resetting
these only when the governor module is removed and re-installed.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 1cea7a1eac13..0b4be4481433 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1562,6 +1562,9 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, | |||
1562 | policy->cpu, event); | 1562 | policy->cpu, event); |
1563 | ret = policy->governor->governor(policy, event); | 1563 | ret = policy->governor->governor(policy, event); |
1564 | 1564 | ||
1565 | if (!policy->governor->initialized && (event == CPUFREQ_GOV_START)) | ||
1566 | policy->governor->initialized = 1; | ||
1567 | |||
1565 | /* we keep one module reference alive for | 1568 | /* we keep one module reference alive for |
1566 | each CPU governed by this CPU */ | 1569 | each CPU governed by this CPU */ |
1567 | if ((event != CPUFREQ_GOV_START) || ret) | 1570 | if ((event != CPUFREQ_GOV_START) || ret) |
@@ -1585,6 +1588,7 @@ int cpufreq_register_governor(struct cpufreq_governor *governor) | |||
1585 | 1588 | ||
1586 | mutex_lock(&cpufreq_governor_mutex); | 1589 | mutex_lock(&cpufreq_governor_mutex); |
1587 | 1590 | ||
1591 | governor->initialized = 0; | ||
1588 | err = -EBUSY; | 1592 | err = -EBUSY; |
1589 | if (__find_governor(governor->name) == NULL) { | 1593 | if (__find_governor(governor->name) == NULL) { |
1590 | err = 0; | 1594 | err = 0; |