Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351010
b: refs/heads/master
c: 6954ca9
h: refs/heads/master
v: v3
  • Loading branch information
Viresh Kumar authored and Rafael J. Wysocki committed Feb 1, 2013
1 parent 92ae1ec commit cda47bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f6a7409cab3b525c5e55540e7cd08d23e198352f
refs/heads/master: 6954ca9c8b5cbaf45c3e45a5a5a7450c6b55ab27
8 changes: 7 additions & 1 deletion trunk/drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ static DEFINE_PER_CPU(char[CPUFREQ_NAME_LEN], cpufreq_cpu_governor);
#endif
static DEFINE_SPINLOCK(cpufreq_driver_lock);

/* Used when we unregister cpufreq driver */
static struct cpumask cpufreq_online_mask;

/*
* cpu_policy_rwsem is a per CPU reader-writer semaphore designed to cure
* all cpufreq/hotplug/workqueue/etc related lock issues.
Expand Down Expand Up @@ -981,6 +984,7 @@ static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
* managing offline cpus here.
*/
cpumask_and(policy->cpus, policy->cpus, cpu_online_mask);
cpumask_and(policy->cpus, policy->cpus, &cpufreq_online_mask);

policy->user_policy.min = policy->min;
policy->user_policy.max = policy->max;
Expand Down Expand Up @@ -1064,7 +1068,6 @@ static int __cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif
}
per_cpu(cpufreq_cpu_data, cpu) = NULL;


#ifdef CONFIG_SMP
/* if this isn't the CPU which is the parent of the kobj, we
* only need to unlink, put and exit
Expand Down Expand Up @@ -1185,6 +1188,7 @@ static int cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif)
if (unlikely(lock_policy_rwsem_write(cpu)))
BUG();

cpumask_clear_cpu(cpu, &cpufreq_online_mask);
retval = __cpufreq_remove_dev(dev, sif);
return retval;
}
Expand Down Expand Up @@ -1903,6 +1907,8 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
cpufreq_driver = driver_data;
spin_unlock_irqrestore(&cpufreq_driver_lock, flags);

cpumask_setall(&cpufreq_online_mask);

ret = subsys_interface_register(&cpufreq_interface);
if (ret)
goto err_null_driver;
Expand Down

0 comments on commit cda47bc

Please sign in to comment.