diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-01-14 08:23:03 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-02-01 18:01:14 -0500 |
commit | b8eed8af94f9203e0cc39245ea335f4b8dc1ed31 (patch) | |
tree | 39c9e57baa6daf91295c331c6b995c9d6286b2bc /include/linux/cpufreq.h | |
parent | f85178048c083520bd920921744dd2c4a797fbc5 (diff) |
cpufreq: Simplify __cpufreq_remove_dev()
__cpufreq_remove_dev() is called on multiple occasions: cpufreq_driver
unregister and cpu removals.
Current implementation of this routine is overly complex without much need. If
the cpu to be removed is the policy->cpu, we remove the policy first and add all
other cpus again from policy->cpus and then finally call __cpufreq_remove_dev()
again to remove the cpu to be deleted. Haahhhh..
There exist a simple solution to removal of a cpu:
- Simply use the old policy structure
- update its fields like: policy->cpu, etc.
- notify any users of cpufreq, which depend on changing policy->cpu
Hence this patch, which tries to implement the above theory. It is tested well
by myself on ARM big.LITTLE TC2 SoC, which has 5 cores (2 A15 and 3 A7). Both
A15's share same struct policy and all A7's share same policy structure.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r-- | include/linux/cpufreq.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index a55b88eaf96a..52be2d0c994a 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -93,7 +93,9 @@ struct cpufreq_policy { | |||
93 | cpumask_var_t related_cpus; /* CPUs with any coordination */ | 93 | cpumask_var_t related_cpus; /* CPUs with any coordination */ |
94 | unsigned int shared_type; /* ANY or ALL affected CPUs | 94 | unsigned int shared_type; /* ANY or ALL affected CPUs |
95 | should set cpufreq */ | 95 | should set cpufreq */ |
96 | unsigned int cpu; /* cpu nr of registered CPU */ | 96 | unsigned int cpu; /* cpu nr of CPU managing this policy */ |
97 | unsigned int last_cpu; /* cpu nr of previous CPU that managed | ||
98 | * this policy */ | ||
97 | struct cpufreq_cpuinfo cpuinfo;/* see above */ | 99 | struct cpufreq_cpuinfo cpuinfo;/* see above */ |
98 | 100 | ||
99 | unsigned int min; /* in kHz */ | 101 | unsigned int min; /* in kHz */ |
@@ -112,10 +114,11 @@ struct cpufreq_policy { | |||
112 | struct completion kobj_unregister; | 114 | struct completion kobj_unregister; |
113 | }; | 115 | }; |
114 | 116 | ||
115 | #define CPUFREQ_ADJUST (0) | 117 | #define CPUFREQ_ADJUST (0) |
116 | #define CPUFREQ_INCOMPATIBLE (1) | 118 | #define CPUFREQ_INCOMPATIBLE (1) |
117 | #define CPUFREQ_NOTIFY (2) | 119 | #define CPUFREQ_NOTIFY (2) |
118 | #define CPUFREQ_START (3) | 120 | #define CPUFREQ_START (3) |
121 | #define CPUFREQ_UPDATE_POLICY_CPU (4) | ||
119 | 122 | ||
120 | #define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ | 123 | #define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ |
121 | #define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ | 124 | #define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ |
@@ -405,6 +408,7 @@ extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; | |||
405 | 408 | ||
406 | void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, | 409 | void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, |
407 | unsigned int cpu); | 410 | unsigned int cpu); |
411 | void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); | ||
408 | 412 | ||
409 | void cpufreq_frequency_table_put_attr(unsigned int cpu); | 413 | void cpufreq_frequency_table_put_attr(unsigned int cpu); |
410 | #endif /* _LINUX_CPUFREQ_H */ | 414 | #endif /* _LINUX_CPUFREQ_H */ |