for_each_cpu(j, policy->cpus) {
struct device *cpu_dev;
- if (j == policy->cpu)
+ if (j == policy->kobj_cpu)
continue;
pr_debug("Adding link for CPU: %u\n", j);
down_write(&policy->rwsem);
policy->cpu = cpu;
+ policy->kobj_cpu = cpu;
up_write(&policy->rwsem);
return 0;
* the creation of a brand new one. So we need to perform this update
* by invoking update_policy_cpu().
*/
- if (recover_policy && cpu != policy->cpu)
+ if (recover_policy && cpu != policy->cpu) {
WARN_ON(update_policy_cpu(policy, cpu, dev));
- else
+ } else {
policy->cpu = cpu;
+ policy->kobj_cpu = cpu;
+ }
cpumask_copy(policy->cpus, cpumask_of(cpu));
CPUFREQ_NAME_LEN);
up_write(&policy->rwsem);
- if (cpu != policy->cpu) {
+ if (cpu != policy->kobj_cpu) {
sysfs_remove_link(&dev->kobj, "cpufreq");
} else if (cpus > 1) {
/* Nominate new CPU */
unsigned int shared_type; /* ACPI: ANY or ALL affected CPUs
should set cpufreq */
- unsigned int cpu; /* cpu nr of CPU managing this policy */
+ unsigned int cpu; /* cpu managing this policy, must be online */
+ unsigned int kobj_cpu; /* cpu managing sysfs files, can be offline */
+
struct clk *clk;
struct cpufreq_cpuinfo cpuinfo;/* see above */