Skip to contentSkip to conversation

Clean up cpufreq hot-cpu callback.

RFC PATCH In review Gautham R Shenoy 1 participant 1 message Aug 24, 2006 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/4 Clean up cpufreq hot-cpu callback.

Signature · 6 lines
-- 
Gautham R Shenoy
Linux Technology Center
IBM India.
"Freedom comes with a price tag of responsibility, which is still a bargain,
because Freedom is priceless!"

This patch cleans up the hot-cpu callback interface of cpufreq so that lock_cpu_hotplug won't be called from a cpu_up or a cpu_down.

include/linux/cpufreq.h +5 -0
Index: current/include/linux/cpufreq.h
===================================================================
@@ -164,6 +164,9 @@ struct cpufreq_governor {
 
 /* pass a target to the cpufreq driver 
  */
+extern int cpufreq_driver_target_cpulocked(struct cpufreq_policy *policy,
+				 unsigned int target_freq,
+				 unsigned int relation);
 extern int cpufreq_driver_target(struct cpufreq_policy *policy,
 				 unsigned int target_freq,
 				 unsigned int relation);
@@ -253,8 +256,10 @@ struct freq_attr {
  *                        CPUFREQ 2.6. INTERFACE                     *
  *********************************************************************/
 int cpufreq_set_policy(struct cpufreq_policy *policy);
+int cpufreq_set_policy_cpulocked(struct cpufreq_policy *policy);
 int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
 int cpufreq_update_policy(unsigned int cpu);
+int cpufreq_update_policy_cpulocked(unsigned int cpu);
 
 /* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */
 unsigned int cpufreq_get(unsigned int cpu);
drivers/cpufreq/cpufreq.c +49 -13

141 lines not on this page · raw message

drivers/cpufreq/cpufreq_stats.c +1 -1
Index: current/drivers/cpufreq/cpufreq_stats.c
===================================================================
@@ -309,7 +309,7 @@ static int cpufreq_stat_cpu_callback(str
 
 	switch (action) {
 	case CPU_ONLINE:
-		cpufreq_update_policy(cpu);
+		cpufreq_update_policy_cpulocked(cpu);
 		break;
 	case CPU_DEAD:
 		cpufreq_stats_free_table(cpu);