Commit 0dfc0a28 authored by Dave Jones's avatar Dave Jones

[PATCH] Make cpuid driver preempt safe.

parent 043adc93
...@@ -64,6 +64,7 @@ static inline void do_cpuid(int cpu, u32 reg, u32 *data) ...@@ -64,6 +64,7 @@ static inline void do_cpuid(int cpu, u32 reg, u32 *data)
{ {
struct cpuid_command cmd; struct cpuid_command cmd;
preempt_disable();
if ( cpu == smp_processor_id() ) { if ( cpu == smp_processor_id() ) {
cpuid(reg, &data[0], &data[1], &data[2], &data[3]); cpuid(reg, &data[0], &data[1], &data[2], &data[3]);
} else { } else {
...@@ -73,6 +74,7 @@ static inline void do_cpuid(int cpu, u32 reg, u32 *data) ...@@ -73,6 +74,7 @@ static inline void do_cpuid(int cpu, u32 reg, u32 *data)
smp_call_function(cpuid_smp_cpuid, &cmd, 1, 1); smp_call_function(cpuid_smp_cpuid, &cmd, 1, 1);
} }
preempt_enable();
} }
#else /* ! CONFIG_SMP */ #else /* ! CONFIG_SMP */
......
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