diff options
author | Ashok Raj <ashok.raj@intel.com> | 2005-11-09 00:34:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:55:50 -0500 |
commit | 90d45d17f3e68608ac7ba8fc3d7acce022a19c8e (patch) | |
tree | 615b2f21c3e02e0ec901febd180014fed64a6a01 /include/linux/cpu.h | |
parent | 330d57fb98a916fa8e1363846540dd420e99499a (diff) |
[PATCH] cpu hotplug: fix locking in cpufreq drivers
When calling target drivers to set frequency, we take cpucontrol lock.
When we modified the code to accomodate CPU hotplug, there was an attempt
to take a double lock of cpucontrol leading to a deadlock. Since the
current thread context is already holding the cpucontrol lock, we dont need
to make another attempt to acquire it.
Now we leave a trace in current->flags indicating current thread already is
under cpucontrol lock held, so we dont attempt to do this another time.
Thanks to Andrew Morton for the beating:-)
From: Brice Goglin <Brice.Goglin@ens-lyon.org>
Build fix
(akpm: this patch is still unpleasant. Ashok continues to look for a cleaner
solution, doesn't he? ;))
Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Signed-off-by: Brice Goglin <Brice.Goglin@ens-lyon.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/cpu.h')
-rw-r--r-- | include/linux/cpu.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 1f7b2c097503..43c44530ef9d 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -42,6 +42,7 @@ struct notifier_block; | |||
42 | /* Need to know about CPUs going up/down? */ | 42 | /* Need to know about CPUs going up/down? */ |
43 | extern int register_cpu_notifier(struct notifier_block *nb); | 43 | extern int register_cpu_notifier(struct notifier_block *nb); |
44 | extern void unregister_cpu_notifier(struct notifier_block *nb); | 44 | extern void unregister_cpu_notifier(struct notifier_block *nb); |
45 | extern int current_in_cpu_hotplug(void); | ||
45 | 46 | ||
46 | int cpu_up(unsigned int cpu); | 47 | int cpu_up(unsigned int cpu); |
47 | 48 | ||
@@ -54,6 +55,10 @@ static inline int register_cpu_notifier(struct notifier_block *nb) | |||
54 | static inline void unregister_cpu_notifier(struct notifier_block *nb) | 55 | static inline void unregister_cpu_notifier(struct notifier_block *nb) |
55 | { | 56 | { |
56 | } | 57 | } |
58 | static inline int current_in_cpu_hotplug(void) | ||
59 | { | ||
60 | return 0; | ||
61 | } | ||
57 | 62 | ||
58 | #endif /* CONFIG_SMP */ | 63 | #endif /* CONFIG_SMP */ |
59 | extern struct sysdev_class cpu_sysdev_class; | 64 | extern struct sysdev_class cpu_sysdev_class; |