On 21-07-15, 03:14, Rafael J. Wysocki wrote:
That said, cpu_present_mask may only be updated after calling arch_unregister_cpu(), so checking it in cpufreq_remove_dev() doesn't really help.
No, it is indeed useful. This is a snippet from the latest code we have:
cpumask_copy(&mask, policy->related_cpus); cpumask_clear_cpu(cpu, &mask);
/* * Free policy only if all policy->related_cpus are removed * physically. */ if (cpumask_intersects(&mask, cpu_present_mask)) { remove_cpu_dev_symlink(policy, cpu); return 0; }
cpufreq_policy_free(policy, true);
So what we are checking in the 'if' block is: "Is any CPU from related_cpus, apart from the one getting removed now, present in the system."
If not, then free the policy.
It looks like using cpufreq_remove_dev() as the subsys ->remove_dev callback is a mistake as it cannot really tell the difference between that code path and the CPU offline one.
What do you mean by this? Doesn't the sif parameter confirms that its called from subsys path ?