]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86_64/kernel/mce.c
Pull bugzilla-3774 into release branch
[linux-2.6-omap-h63xx.git] / arch / x86_64 / kernel / mce.c
index 7c8ab423abe362e624401d8cf43ae740954c77bd..a66d607f5b924e09d864120d1d656c3e1a1c2da0 100644 (file)
@@ -375,7 +375,8 @@ static void mcheck_timer(struct work_struct *work)
        if (mce_notify_user()) {
                next_interval = max(next_interval/2, HZ/100);
        } else {
-               next_interval = min(next_interval*2, check_interval*HZ);
+               next_interval = min(next_interval*2,
+                               (int)round_jiffies_relative(check_interval*HZ));
        }
 
        schedule_delayed_work(&mcheck_work, next_interval);
@@ -428,7 +429,8 @@ static __init int periodic_mcheck_init(void)
 { 
        next_interval = check_interval * HZ;
        if (next_interval)
-               schedule_delayed_work(&mcheck_work, next_interval);
+               schedule_delayed_work(&mcheck_work,
+                                     round_jiffies_relative(next_interval));
        idle_notifier_register(&mce_idle_notifier);
        return 0;
 } 
@@ -665,6 +667,20 @@ static struct miscdevice mce_log_device = {
        &mce_chrdev_ops,
 };
 
+static unsigned long old_cr4 __initdata;
+
+void __init stop_mce(void)
+{
+       old_cr4 = read_cr4();
+       clear_in_cr4(X86_CR4_MCE);
+}
+
+void __init restart_mce(void)
+{
+       if (old_cr4 & X86_CR4_MCE)
+               set_in_cr4(X86_CR4_MCE);
+}
+
 /* 
  * Old style boot options parsing. Only for compatibility. 
  */
@@ -720,7 +736,8 @@ static void mce_restart(void)
        on_each_cpu(mce_init, NULL, 1, 1);       
        next_interval = check_interval * HZ;
        if (next_interval)
-               schedule_delayed_work(&mcheck_work, next_interval);
+               schedule_delayed_work(&mcheck_work,
+                                     round_jiffies_relative(next_interval));
 }
 
 static struct sysdev_class mce_sysclass = {