aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-07-19 13:59:39 -0400
committerTony Luck <tony.luck@intel.com>2012-08-03 14:46:29 -0400
commit26c3c283c5b08dd250279c06ba3ab5b094bbacc3 (patch)
treecbffbc3b6c5c5eddd439e217853b5fc6e7f938ed /arch/x86/kernel/cpu
parentb5975917a3e5f93b5d1c95561aab0aa44327baea (diff)
x86: mce: Split timer init
Split timer init function into the init and the start part, so the start part can replace the open coded version in CPU_DOWN_FAILED. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Chen Gong <gong.chen@linux.intel.com> Acked-by: Borislav Petkov <borislav.petkov@amd.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 5e095f873e3e..bd3a5e850f4f 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1557,23 +1557,28 @@ static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c)
1557 } 1557 }
1558} 1558}
1559 1559
1560static void __mcheck_cpu_init_timer(void) 1560static void mce_start_timer(unsigned int cpu, struct timer_list *t)
1561{ 1561{
1562 struct timer_list *t = &__get_cpu_var(mce_timer);
1563 unsigned long iv = check_interval * HZ; 1562 unsigned long iv = check_interval * HZ;
1564 1563
1565 setup_timer(t, mce_timer_fn, smp_processor_id()); 1564 __this_cpu_write(mce_next_interval, iv);
1566 1565
1567 if (mce_ignore_ce) 1566 if (mce_ignore_ce || !iv)
1568 return; 1567 return;
1569 1568
1570 __this_cpu_write(mce_next_interval, iv);
1571 if (!iv)
1572 return;
1573 t->expires = round_jiffies(jiffies + iv); 1569 t->expires = round_jiffies(jiffies + iv);
1574 add_timer_on(t, smp_processor_id()); 1570 add_timer_on(t, smp_processor_id());
1575} 1571}
1576 1572
1573static void __mcheck_cpu_init_timer(void)
1574{
1575 struct timer_list *t = &__get_cpu_var(mce_timer);
1576 unsigned int cpu = smp_processor_id();
1577
1578 setup_timer(t, mce_timer_fn, cpu);
1579 mce_start_timer(cpu, t);
1580}
1581
1577/* Handle unconfigured int18 (should never happen) */ 1582/* Handle unconfigured int18 (should never happen) */
1578static void unexpected_machine_check(struct pt_regs *regs, long error_code) 1583static void unexpected_machine_check(struct pt_regs *regs, long error_code)
1579{ 1584{
@@ -2277,12 +2282,8 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
2277 break; 2282 break;
2278 case CPU_DOWN_FAILED: 2283 case CPU_DOWN_FAILED:
2279 case CPU_DOWN_FAILED_FROZEN: 2284 case CPU_DOWN_FAILED_FROZEN:
2280 if (!mce_ignore_ce && check_interval) {
2281 t->expires = round_jiffies(jiffies +
2282 per_cpu(mce_next_interval, cpu));
2283 add_timer_on(t, cpu);
2284 }
2285 smp_call_function_single(cpu, mce_reenable_cpu, &action, 1); 2285 smp_call_function_single(cpu, mce_reenable_cpu, &action, 1);
2286 mce_start_timer(cpu, t);
2286 break; 2287 break;
2287 case CPU_POST_DEAD: 2288 case CPU_POST_DEAD:
2288 /* intentionally ignoring frozen here */ 2289 /* intentionally ignoring frozen here */