Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351009
b: refs/heads/master
c: f6a7409
h: refs/heads/master
i:
  351007: 74ef8cf
v: v3
  • Loading branch information
Viresh Kumar authored and Rafael J. Wysocki committed Feb 1, 2013
1 parent ed4fb4c commit 92ae1ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 643ae6e81dd65b333a13259852405fc9f764ac76
refs/heads/master: f6a7409cab3b525c5e55540e7cd08d23e198352f
10 changes: 10 additions & 0 deletions trunk/drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,16 @@ static int cpufreq_add_dev_policy(unsigned int cpu,
return -EBUSY;
}

__cpufreq_governor(managed_policy, CPUFREQ_GOV_STOP);

spin_lock_irqsave(&cpufreq_driver_lock, flags);
cpumask_copy(managed_policy->cpus, policy->cpus);
per_cpu(cpufreq_cpu_data, cpu) = managed_policy;
spin_unlock_irqrestore(&cpufreq_driver_lock, flags);

__cpufreq_governor(managed_policy, CPUFREQ_GOV_START);
__cpufreq_governor(managed_policy, CPUFREQ_GOV_LIMITS);

pr_debug("CPU already managed, adding link\n");
ret = sysfs_create_link(&dev->kobj,
&managed_policy->kobj,
Expand Down Expand Up @@ -1066,8 +1071,13 @@ static int __cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif
*/
if (unlikely(cpu != data->cpu)) {
pr_debug("removing link\n");
__cpufreq_governor(data, CPUFREQ_GOV_STOP);
cpumask_clear_cpu(cpu, data->cpus);
spin_unlock_irqrestore(&cpufreq_driver_lock, flags);

__cpufreq_governor(data, CPUFREQ_GOV_START);
__cpufreq_governor(data, CPUFREQ_GOV_LIMITS);

kobj = &dev->kobj;
cpufreq_cpu_put(data);
unlock_policy_rwsem_write(cpu);
Expand Down

0 comments on commit 92ae1ec

Please sign in to comment.