aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>2007-02-05 19:12:44 -0500
committerDave Jones <davej@redhat.com>2007-02-10 20:01:47 -0500
commit5a01f2e8f3ac134e24144d74bb48a60236f7024d (patch)
tree8d807b81618dc1b4782e0e58a9629a6d0a09fbe3 /include
parentc120069779e3e35917c15393cf2847fa79811eb6 (diff)
[CPUFREQ] Rewrite lock in cpufreq to eliminate cpufreq/hotplug related issues
Yet another attempt to resolve cpufreq and hotplug locking issues. Patchset has 3 patches: * Rewrite the lock infrastructure of cpufreq using a per cpu rwsem. * Minor restructuring of work callback in ondemand driver. * Use the new cpufreq rwsem infrastructure in ondemand work. This patch: Convert policy->lock to rwsem and move it to per_cpu area. This rwsem will protect against both changing/accessing policy related parameters and CPU hot plug/unplug. [malattia@linux.it: fix oops in kref_put()] Cc: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Cc: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/cpufreq.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 7f008f6bfdc3..0899e2cdcdd1 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -84,9 +84,6 @@ struct cpufreq_policy {
84 unsigned int policy; /* see above */ 84 unsigned int policy; /* see above */
85 struct cpufreq_governor *governor; /* see below */ 85 struct cpufreq_governor *governor; /* see below */
86 86
87 struct mutex lock; /* CPU ->setpolicy or ->target may
88 only be called once a time */
89
90 struct work_struct update; /* if update_policy() needs to be 87 struct work_struct update; /* if update_policy() needs to be
91 * called, but you're in IRQ context */ 88 * called, but you're in IRQ context */
92 89
@@ -172,11 +169,16 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy,
172 unsigned int relation); 169 unsigned int relation);
173 170
174 171
175extern int cpufreq_driver_getavg(struct cpufreq_policy *policy); 172extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy);
176 173
177int cpufreq_register_governor(struct cpufreq_governor *governor); 174int cpufreq_register_governor(struct cpufreq_governor *governor);
178void cpufreq_unregister_governor(struct cpufreq_governor *governor); 175void cpufreq_unregister_governor(struct cpufreq_governor *governor);
179 176
177int lock_policy_rwsem_read(int cpu);
178int lock_policy_rwsem_write(int cpu);
179void unlock_policy_rwsem_read(int cpu);
180void unlock_policy_rwsem_write(int cpu);
181
180 182
181/********************************************************************* 183/*********************************************************************
182 * CPUFREQ DRIVER INTERFACE * 184 * CPUFREQ DRIVER INTERFACE *