[PATCH] cpu hotplug: fix locking in cpufreq drivers
commit90d45d17f3e68608ac7ba8fc3d7acce022a19c8e
authorAshok Raj <ashok.raj@intel.com>
Wed, 9 Nov 2005 05:34:24 +0000 (8 21:34 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 9 Nov 2005 15:55:50 +0000 (9 07:55 -0800)
tree615b2f21c3e02e0ec901febd180014fed64a6a01
parent330d57fb98a916fa8e1363846540dd420e99499a
[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>
drivers/cpufreq/cpufreq.c
include/linux/cpu.h
include/linux/sched.h
kernel/cpu.c