Commit 19726cec authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

[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: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 974de4d7
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/cpu.h>
#include <asm/elf.h> #include <asm/elf.h>
#include <asm/lowcore.h> #include <asm/lowcore.h>
#include <asm/param.h> #include <asm/param.h>
...@@ -47,7 +47,6 @@ static int show_cpuinfo(struct seq_file *m, void *v) ...@@ -47,7 +47,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
int i; int i;
s390_adjust_jiffies(); s390_adjust_jiffies();
preempt_disable();
if (!n) { if (!n) {
seq_printf(m, "vendor_id : IBM/S390\n" seq_printf(m, "vendor_id : IBM/S390\n"
"# processors : %i\n" "# processors : %i\n"
...@@ -60,7 +59,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) ...@@ -60,7 +59,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_printf(m, "%s ", hwcap_str[i]); seq_printf(m, "%s ", hwcap_str[i]);
seq_puts(m, "\n"); seq_puts(m, "\n");
} }
get_online_cpus();
if (cpu_online(n)) { if (cpu_online(n)) {
struct cpuid *id = &per_cpu(cpu_id, n); struct cpuid *id = &per_cpu(cpu_id, n);
seq_printf(m, "processor %li: " seq_printf(m, "processor %li: "
...@@ -69,7 +68,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) ...@@ -69,7 +68,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
"machine = %04X\n", "machine = %04X\n",
n, id->version, id->ident, id->machine); n, id->version, id->ident, id->machine);
} }
preempt_enable(); put_online_cpus();
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment