Commit d97e32d5 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] bluesmoke fixes.

- Makes UP preempt safe.
- Avoids double call of mce_checkregs on SMP
parent 65e6aacc
...@@ -280,6 +280,7 @@ static void mce_checkregs (void *info) ...@@ -280,6 +280,7 @@ static void mce_checkregs (void *info)
u32 low, high; u32 low, high;
int i; int i;
preempt_disable();
for (i=0; i<banks; i++) { for (i=0; i<banks; i++) {
rdmsr(MSR_IA32_MC0_STATUS+i*4, low, high); rdmsr(MSR_IA32_MC0_STATUS+i*4, low, high);
...@@ -294,16 +295,13 @@ static void mce_checkregs (void *info) ...@@ -294,16 +295,13 @@ static void mce_checkregs (void *info)
wmb(); wmb();
} }
} }
preempt_enable();
} }
static void do_mce_timer(void *data) static void do_mce_timer(void *data)
{ {
preempt_disable();
mce_checkregs(NULL); mce_checkregs(NULL);
smp_call_function (mce_checkregs, NULL, 1, 1); smp_call_function (mce_checkregs, NULL, 1, 1);
preempt_enable();
mce_timer.expires = jiffies + MCE_RATE;
add_timer (&mce_timer);
} }
static DECLARE_WORK(mce_work, do_mce_timer, NULL); static DECLARE_WORK(mce_work, do_mce_timer, NULL);
...@@ -311,12 +309,11 @@ static DECLARE_WORK(mce_work, do_mce_timer, NULL); ...@@ -311,12 +309,11 @@ static DECLARE_WORK(mce_work, do_mce_timer, NULL);
static void mce_timerfunc (unsigned long data) static void mce_timerfunc (unsigned long data)
{ {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
if (num_online_cpus() > 1) { if (num_online_cpus() > 1)
schedule_work(&mce_work); schedule_work(&mce_work);
return; #else
}
#endif
mce_checkregs(NULL); mce_checkregs(NULL);
#endif
mce_timer.expires = jiffies + MCE_RATE; mce_timer.expires = jiffies + MCE_RATE;
add_timer (&mce_timer); add_timer (&mce_timer);
} }
......
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