From: Vishwesh M Rudramuni <[email protected]> Date: Tue, 14 Dec 2010 14:08:33 +0530 Subject: [PATCH] temporary cpu hotplug patch med-mrst
This is a temporary patch to fix the cpu hotplug patch to put the non bsp processor to a deep c-state. Signed-off-by: Vishwesh M Rudramuni <[email protected]> --- arch/x86/include/asm/processor.h | 28 ++++++++++++++++++++++------ 1 files changed, 22 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 7e5c6a6..c9fcfed 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -21,6 +21,7 @@ struct mm_struct; #include <asm/msr.h> #include <asm/desc_defs.h> #include <asm/nops.h> +#include <asm/mrst.h> #include <linux/personality.h> #include <linux/cpumask.h> @@ -30,6 +31,7 @@ struct mm_struct; #include <linux/init.h> #include <linux/err.h> +#define C6_DATA_HINTS 0x52 #define HBP_NUM 4 /* * Default implementation of macro that returns current @@ -777,13 +779,27 @@ extern unsigned long idle_nomwait; */ static inline void wbinvd_halt(void) { - mb(); - /* check for clflush to determine if wbinvd is legal */ - if (cpu_has_clflush) - asm volatile("cli; wbinvd; 1: hlt; jmp 1b" : : : "memory"); - else + if ((__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT) || + (__mrst_cpu_chip == MRST_CPU_CHIP_PENWELL)) { + /* flush cache */ + wbinvd(); + + /* Here we are doing a forced mwait to make the thread 1 + * enter a C6 state. Forcefully clean up the thread info + * polling flags so that monitor succeeds. + */ while (1) - halt(); + mwait_idle_with_hints(C6_DATA_HINTS, 0x1); + } else { + mb(); + /* check for clflush to determine if wbinvd is legal */ + if (cpu_has_clflush) + asm volatile(\ + "cli; wbinvd; 1: hlt; jmp 1b" : : : "memory"); + else + while (1) + halt(); + } } extern void enable_sep_cpu(void); -- 1.6.0.4
_______________________________________________ MeeGo-kernel mailing list [email protected] http://lists.meego.com/listinfo/meego-kernel
