Commit 8c058d53 authored by Len Brown's avatar Len Brown
Browse files

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: default avatarLen Brown <len.brown@intel.com>
Cc: x86@kernel.org
parent 19583ca5
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -149,6 +149,9 @@


#define MSR_CORE_C1_RES			0x00000660
#define MSR_CORE_C1_RES			0x00000660


#define MSR_CC6_DEMOTION_POLICY_CONFIG	0x00000668
#define MSR_MC6_DEMOTION_POLICY_CONFIG	0x00000669

#define MSR_AMD64_MC0_MASK		0xc0010044
#define MSR_AMD64_MC0_MASK		0xc0010044


#define MSR_IA32_MCx_CTL(x)		(MSR_IA32_MC0_CTL + 4*(x))
#define MSR_IA32_MCx_CTL(x)		(MSR_IA32_MC0_CTL + 4*(x))
+7 −0
Original line number Original line Diff line number Diff line
@@ -89,6 +89,7 @@ struct idle_cpu {
	 * Indicate which enable bits to clear here.
	 * Indicate which enable bits to clear here.
	 */
	 */
	unsigned long auto_demotion_disable_flags;
	unsigned long auto_demotion_disable_flags;
	bool byt_auto_demotion_disable_flag;
	bool disable_promotion_to_c1e;
	bool disable_promotion_to_c1e;
};
};


@@ -613,6 +614,7 @@ static const struct idle_cpu idle_cpu_snb = {
static const struct idle_cpu idle_cpu_byt = {
static const struct idle_cpu idle_cpu_byt = {
	.state_table = byt_cstates,
	.state_table = byt_cstates,
	.disable_promotion_to_c1e = true,
	.disable_promotion_to_c1e = true,
	.byt_auto_demotion_disable_flag = true,
};
};


static const struct idle_cpu idle_cpu_ivb = {
static const struct idle_cpu idle_cpu_ivb = {
@@ -814,6 +816,11 @@ static int __init intel_idle_cpuidle_driver_init(void)
	if (icpu->auto_demotion_disable_flags)
	if (icpu->auto_demotion_disable_flags)
		on_each_cpu(auto_demotion_disable, NULL, 1);
		on_each_cpu(auto_demotion_disable, NULL, 1);


	if (icpu->byt_auto_demotion_disable_flag) {
		wrmsrl(MSR_CC6_DEMOTION_POLICY_CONFIG, 0);
		wrmsrl(MSR_MC6_DEMOTION_POLICY_CONFIG, 0);
	}

	if (icpu->disable_promotion_to_c1e)	/* each-cpu is redundant */
	if (icpu->disable_promotion_to_c1e)	/* each-cpu is redundant */
		on_each_cpu(c1e_promotion_disable, NULL, 1);
		on_each_cpu(c1e_promotion_disable, NULL, 1);