On 01/27/2015 12:36 AM, Viresh Kumar wrote:
Later commits would change the way policies are managed today. Policies wouldn't be freed on cpu hotplug (currently they aren't freed on suspend), and while the CPU is offline, the sysfs cpufreq files would still be present.
User may accidentally try to update the sysfs files in following directory: '/sys/devices/system/cpu/cpuX/cpufreq/'. And that would result in undefined behavior as policy wouldn't be active then.
To disallow such accesses, sense if a policy is active or not while doing such operations. This can be done easily by getting the policy again with cpufreq_cpu_get_raw(), as that would traverse the list of active policies.
Apart from updating the store() routine, we also update __cpufreq_get() which can call cpufreq_out_of_sync(). The later routine tries to update policy->cur and start notifying kernel about it.
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
I'm okay with the idea of this patch for now. I'll argue against this after this series goes in as it'll need more non-trivial changes before this idea of this patch can be removed.
But not acking it because I expect the code to change after combining active/inactive list.
-Saravana