summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/topology.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-11-15 11:38:02 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2008-11-15 11:38:02 -0800
commit011331483da8842bc4ab6f2b4e88df60b25eb817 (patch)
tree008d1ce7cf620e26c85bcd5ca6ffcf5526fb4be9 /arch/s390/kernel/topology.c
parentc98114db2d70bc670206878e92bb88da9cf6f8f2 (diff)
parentd2f019fe40e8fecd822f87bc759f74925a5c31d6 (diff)
downloadlinux-011331483da8842bc4ab6f2b4e88df60b25eb817.tar.gz
linux-011331483da8842bc4ab6f2b4e88df60b25eb817.tar.bz2
linux-011331483da8842bc4ab6f2b4e88df60b25eb817.zip
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: [S390] fix s390x_newuname [S390] dasd: log sense for fatal errors [S390] cpu topology: fix locking [S390] cio: Fix refcount after moving devices. [S390] ftrace: fix kernel stack backchain walking [S390] ftrace: disable tracing on idle psw [S390] lockdep: fix compile bug [S390] kvm_s390: Fix oops in virtio device detection with "mem=" [S390] sclp: emit error message if assign storage fails [S390] Fix range for add_active_range() in setup_memory()
Diffstat (limited to 'arch/s390/kernel/topology.c')
-rw-r--r--arch/s390/kernel/topology.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index 632b13e10053..a947899dcba1 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -65,18 +65,21 @@ static int machine_has_topology_irq;
static struct timer_list topology_timer;
static void set_topology_timer(void);
static DECLARE_WORK(topology_work, topology_work_fn);
+/* topology_lock protects the core linked list */
+static DEFINE_SPINLOCK(topology_lock);
cpumask_t cpu_core_map[NR_CPUS];
cpumask_t cpu_coregroup_map(unsigned int cpu)
{
struct core_info *core = &core_info;
+ unsigned long flags;
cpumask_t mask;
cpus_clear(mask);
if (!machine_has_topology)
return cpu_present_map;
- mutex_lock(&smp_cpu_state_mutex);
+ spin_lock_irqsave(&topology_lock, flags);
while (core) {
if (cpu_isset(cpu, core->mask)) {
mask = core->mask;
@@ -84,7 +87,7 @@ cpumask_t cpu_coregroup_map(unsigned int cpu)
}
core = core->next;
}
- mutex_unlock(&smp_cpu_state_mutex);
+ spin_unlock_irqrestore(&topology_lock, flags);
if (cpus_empty(mask))
mask = cpumask_of_cpu(cpu);
return mask;
@@ -133,7 +136,7 @@ static void tl_to_cores(struct tl_info *info)
union tl_entry *tle, *end;
struct core_info *core = &core_info;
- mutex_lock(&smp_cpu_state_mutex);
+ spin_lock_irq(&topology_lock);
clear_cores();
tle = info->tle;
end = (union tl_entry *)((unsigned long)info + info->length);
@@ -157,7 +160,7 @@ static void tl_to_cores(struct tl_info *info)
}
tle = next_tle(tle);
}
- mutex_unlock(&smp_cpu_state_mutex);
+ spin_unlock_irq(&topology_lock);
}
static void topology_update_polarization_simple(void)