]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
x86, AMD: Set ARAT feature on AMD processors
authorBoris Ostrovsky <boris.ostrovsky@amd.com>
Tue, 15 Mar 2011 16:13:44 +0000 (12:13 -0400)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Wed, 14 Mar 2012 14:57:14 +0000 (10:57 -0400)
commit b87cf80af3ba4b4c008b4face3c68d604e1715c6 upstream.

Support for Always Running APIC timer (ARAT) was introduced in
commit db954b5898dd3ef3ef93f4144158ea8f97deb058. This feature
allows us to avoid switching timers from LAPIC to something else
(e.g. HPET) and go into timer broadcasts when entering deep
C-states.

AMD processors don't provide a CPUID bit for that feature but
they also keep APIC timers running in deep C-states (except for
cases when the processor is affected by erratum 400). Therefore
we should set ARAT feature bit on AMD CPUs.

Tested-by: Borislav Petkov <borislav.petkov@amd.com>
Acked-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Acked-by: Mark Langsdorf <mark.langsdorf@amd.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
LKML-Reference: <1300205624-4813-1-git-send-email-ostr@amd64.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
arch/x86/kernel/cpu/amd.c

index 08dd1beb74631fc372249ef7419a2c4871112a38..6f834f8da33a363ccbb2eb5b48ecf757248bf6f7 100644 (file)
@@ -565,6 +565,10 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
                }
        }
 #endif
+
+       /* As a rule processors have APIC timer running in deep C states */
+       if (c->x86 >= 0xf && !cpu_has_amd_erratum(amd_erratum_400))
+               set_cpu_cap(c, X86_FEATURE_ARAT);
 }
 
 #ifdef CONFIG_X86_32