Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933646AbcCNEsd (ORCPT ); Mon, 14 Mar 2016 00:48:33 -0400 Received: from mail.kernel.org ([198.145.29.136]:59863 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933538AbcCNEs1 (ORCPT ); Mon, 14 Mar 2016 00:48:27 -0400 From: Andy Lutomirski To: len.brown@intel.com Cc: "linux-kernel@vger.kernel.org" , Andy Lutomirski Subject: [PATCH 4/4] intel_idle: Move BYT/CHT auto-demotion fixup into fix_this_cpu Date: Sun, 13 Mar 2016 21:48:13 -0700 Message-Id: <9f68cc56173c332b37c1eb8fa672f5ea7d86d7c6.1457930807.git.luto@kernel.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: <1A7043D5F58CCB44A599DFD55ED4C94846A12FBC@fmsmsx115.amr.corp.intel.com> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1188 Lines: 40 The demotion policy config registers are per-package and these CPUs only exist in single-package variants AFAIK, so it's not stricly necessary to fix these MSRs on each core, but fixing them on resume is still likely to be helpful, so move them into fix_this_cpu. Signed-off-by: Andy Lutomirski --- drivers/idle/intel_idle.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index e3d7d8bbc843..cbb02d28dc48 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c @@ -826,6 +826,11 @@ static void fix_this_cpu(void *dummy) msr_bits &= ~0x2; wrmsrl(MSR_IA32_POWER_CTL, msr_bits); } + + if (icpu->byt_auto_demotion_disable_flag) { + wrmsrl(MSR_CC6_DEMOTION_POLICY_CONFIG, 0); + wrmsrl(MSR_MC6_DEMOTION_POLICY_CONFIG, 0); + } } static const struct idle_cpu idle_cpu_nehalem = { @@ -1084,11 +1089,6 @@ static int __init intel_idle_cpuidle_driver_init(void) drv->state_count += 1; } - if (icpu->byt_auto_demotion_disable_flag) { - wrmsrl(MSR_CC6_DEMOTION_POLICY_CONFIG, 0); - wrmsrl(MSR_MC6_DEMOTION_POLICY_CONFIG, 0); - } - return 0; } -- 2.5.0