Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpufreq: Update Documentation for cpus and related_cpus

Documentation related to cpus and related_cpus is confusing and not very clear.
Over that CPUFreq core has seen much changes recently. Lets update documentation
and comments for cpus and related_cpus.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Viresh Kumar and committed by
Rafael J. Wysocki
951fc5f4 5553f9e2

+14 -6
+6
Documentation/cpu-freq/cpu-drivers.txt
··· 111 111 For setting some of these values, the frequency table helpers might be 112 112 helpful. See the section 2 for more information on them. 113 113 114 + SMP systems normally have same clock source for a group of cpus. For these the 115 + .init() would be called only once for the first online cpu. Here the .init() 116 + routine must initialize policy->cpus with mask of all possible cpus (Online + 117 + Offline) that share the clock. Then the core would copy this mask onto 118 + policy->related_cpus and will reset policy->cpus to carry only online cpus. 119 + 114 120 115 121 1.3 verify 116 122 ------------
+4 -4
Documentation/cpu-freq/user-guide.txt
··· 190 190 first set scaling_max_freq, then 191 191 scaling_min_freq. 192 192 193 - affected_cpus : List of CPUs that require software coordination 194 - of frequency. 193 + affected_cpus : List of Online CPUs that require software 194 + coordination of frequency. 195 195 196 - related_cpus : List of CPUs that need some sort of frequency 197 - coordination, whether software or hardware. 196 + related_cpus : List of Online + Offline CPUs that need software 197 + coordination of frequency. 198 198 199 199 scaling_driver : Hardware driver for cpufreq. 200 200
+4 -2
include/linux/cpufreq.h
··· 89 89 }; 90 90 91 91 struct cpufreq_policy { 92 - cpumask_var_t cpus; /* CPUs requiring sw coordination */ 93 - cpumask_var_t related_cpus; /* CPUs with any coordination */ 92 + /* CPUs sharing clock, require sw coordination */ 93 + cpumask_var_t cpus; /* Online CPUs only */ 94 + cpumask_var_t related_cpus; /* Online + Offline CPUs */ 95 + 94 96 unsigned int shared_type; /* ANY or ALL affected CPUs 95 97 should set cpufreq */ 96 98 unsigned int cpu; /* cpu nr of CPU managing this policy */