From 19726cec63aeadad127f9e72ee69240336e37f15 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Wed, 5 Jan 2011 12:48:17 +0100 Subject: [PATCH] [S390] cpuinfo: use get_online_cpus() instead of preempt_disable() Use get_online_cpus() instead of preempt_disable() to make sure cpus don't go offline while accessing their per cpu data. The preempt_disable() stuff is old code which was used before get_online_cpus() was available. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/processor.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c index eeb651b48db3..753623bde8ec 100644 --- a/arch/s390/kernel/processor.c +++ b/arch/s390/kernel/processor.c @@ -13,7 +13,7 @@ #include #include #include - +#include #include #include #include @@ -47,7 +47,6 @@ static int show_cpuinfo(struct seq_file *m, void *v) int i; s390_adjust_jiffies(); - preempt_disable(); if (!n) { seq_printf(m, "vendor_id : IBM/S390\n" "# processors : %i\n" @@ -60,7 +59,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) seq_printf(m, "%s ", hwcap_str[i]); seq_puts(m, "\n"); } - + get_online_cpus(); if (cpu_online(n)) { struct cpuid *id = &per_cpu(cpu_id, n); seq_printf(m, "processor %li: " @@ -69,7 +68,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) "machine = %04X\n", n, id->version, id->ident, id->machine); } - preempt_enable(); + put_online_cpus(); return 0; }