x86: get the MWAIT idle driver in sync with the ACPI one
authorJan Beulich <jbeulich@suse.com>
Thu, 4 Oct 2012 07:03:06 +0000 (09:03 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 4 Oct 2012 07:03:06 +0000 (09:03 +0200)
.. with respect to behavior when there is no HPET broadcast support
(for using the PIT broadcast instead, it requires explicitly enabling
CPU idle management).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/cpu/mwait-idle.c

index 6a9ca95d33b36c52d54ec4fce54ffa91ffe6d070..f8bbf0f2314b784b1de4accb19bf3e14cdbee068 100644 (file)
@@ -501,11 +501,14 @@ int __init mwait_idle_init(struct notifier_block *nfb)
                return -ENODEV;
 
        err = mwait_idle_probe();
-       if (!err) {
-               if (!boot_cpu_has(X86_FEATURE_ARAT))
-                       hpet_broadcast_init();
-               if (!lapic_timer_init())
+       if (!err && !boot_cpu_has(X86_FEATURE_ARAT)) {
+               hpet_broadcast_init();
+               if (xen_cpuidle < 0 && !hpet_broadcast_is_available())
+                       err = -ENODEV;
+               else if(!lapic_timer_init())
                        err = -EINVAL;
+               if (err)
+                       pr_debug(PREFIX "not used (%d)\n", err);
        }
        if (!err) {
                nfb->notifier_call = mwait_idle_cpu_init;