diff options
author | Len Brown <len.brown@intel.com> | 2014-07-31 15:21:24 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2014-08-15 17:06:14 -0400 |
commit | 8c058d53f6f2eb0b9cd3bc4ce5c053a64dded671 (patch) | |
tree | fb657c7092c97ce7452746008c2894ec17e481ae | |
parent | 19583ca584d6f574384e17fe7613dfaeadcdc4a6 (diff) |
intel_idle: Disable Baytrail Core and Module C6 auto-demotion
Power efficiency improves on Baytrail (Intel Atom Processor E3000)
when Linux disables C6 auto-demotion.
Based on work by Srinidhi Kasagar <srinidhi.kasagar@intel.com>.
Signed-off-by: Len Brown <len.brown@intel.com>
Cc: x86@kernel.org
-rw-r--r-- | arch/x86/include/uapi/asm/msr-index.h | 3 | ||||
-rw-r--r-- | drivers/idle/intel_idle.c | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h index fcf2b3ae1bf0..4a7aecd2ea13 100644 --- a/arch/x86/include/uapi/asm/msr-index.h +++ b/arch/x86/include/uapi/asm/msr-index.h | |||
@@ -149,6 +149,9 @@ | |||
149 | 149 | ||
150 | #define MSR_CORE_C1_RES 0x00000660 | 150 | #define MSR_CORE_C1_RES 0x00000660 |
151 | 151 | ||
152 | #define MSR_CC6_DEMOTION_POLICY_CONFIG 0x00000668 | ||
153 | #define MSR_MC6_DEMOTION_POLICY_CONFIG 0x00000669 | ||
154 | |||
152 | #define MSR_AMD64_MC0_MASK 0xc0010044 | 155 | #define MSR_AMD64_MC0_MASK 0xc0010044 |
153 | 156 | ||
154 | #define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x)) | 157 | #define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x)) |
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index 4d140bbbe100..2d23cf8279f0 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c | |||
@@ -89,6 +89,7 @@ struct idle_cpu { | |||
89 | * Indicate which enable bits to clear here. | 89 | * Indicate which enable bits to clear here. |
90 | */ | 90 | */ |
91 | unsigned long auto_demotion_disable_flags; | 91 | unsigned long auto_demotion_disable_flags; |
92 | bool byt_auto_demotion_disable_flag; | ||
92 | bool disable_promotion_to_c1e; | 93 | bool disable_promotion_to_c1e; |
93 | }; | 94 | }; |
94 | 95 | ||
@@ -613,6 +614,7 @@ static const struct idle_cpu idle_cpu_snb = { | |||
613 | static const struct idle_cpu idle_cpu_byt = { | 614 | static const struct idle_cpu idle_cpu_byt = { |
614 | .state_table = byt_cstates, | 615 | .state_table = byt_cstates, |
615 | .disable_promotion_to_c1e = true, | 616 | .disable_promotion_to_c1e = true, |
617 | .byt_auto_demotion_disable_flag = true, | ||
616 | }; | 618 | }; |
617 | 619 | ||
618 | static const struct idle_cpu idle_cpu_ivb = { | 620 | static const struct idle_cpu idle_cpu_ivb = { |
@@ -814,6 +816,11 @@ static int __init intel_idle_cpuidle_driver_init(void) | |||
814 | if (icpu->auto_demotion_disable_flags) | 816 | if (icpu->auto_demotion_disable_flags) |
815 | on_each_cpu(auto_demotion_disable, NULL, 1); | 817 | on_each_cpu(auto_demotion_disable, NULL, 1); |
816 | 818 | ||
819 | if (icpu->byt_auto_demotion_disable_flag) { | ||
820 | wrmsrl(MSR_CC6_DEMOTION_POLICY_CONFIG, 0); | ||
821 | wrmsrl(MSR_MC6_DEMOTION_POLICY_CONFIG, 0); | ||
822 | } | ||
823 | |||
817 | if (icpu->disable_promotion_to_c1e) /* each-cpu is redundant */ | 824 | if (icpu->disable_promotion_to_c1e) /* each-cpu is redundant */ |
818 | on_each_cpu(c1e_promotion_disable, NULL, 1); | 825 | on_each_cpu(c1e_promotion_disable, NULL, 1); |
819 | 826 | ||