From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934903AbdCLRe2 (ORCPT ); Sun, 12 Mar 2017 13:34:28 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:54359 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934658AbdCLRcl (ORCPT ); Sun, 12 Mar 2017 13:32:41 -0400 From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Srinivas Pandruvada Subject: [PATCH 07/14] cpufreq: intel_pstate: Skip unnecessary PID resets on init Date: Sun, 12 Mar 2017 18:18:47 +0100 Message-ID: <1628936.Jbhxs73Drc@aspire.rjw.lan> User-Agent: KMail/4.14.10 (Linux/4.10.0+; KDE/4.14.9; x86_64; ; ) In-Reply-To: <5656785.7SEhxaGEOz@aspire.rjw.lan> References: <5656785.7SEhxaGEOz@aspire.rjw.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki PID controller parameters only need to be initialized if the get_target_pstate_use_performance() P-state selection routine is going to be used. It is not necessary to initialize them otherwise, so don't do that. Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/intel_pstate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-pm/drivers/cpufreq/intel_pstate.c =================================================================== --- linux-pm.orig/drivers/cpufreq/intel_pstate.c +++ linux-pm/drivers/cpufreq/intel_pstate.c @@ -1974,12 +1974,12 @@ static int intel_pstate_init_cpu(unsigne intel_pstate_disable_ee(cpunum); intel_pstate_hwp_enable(cpu); + } else if (pstate_funcs.get_target_pstate == get_target_pstate_use_performance) { + intel_pstate_pid_reset(cpu); } intel_pstate_get_cpu_pstates(cpu); - intel_pstate_pid_reset(cpu); - pr_debug("controlling: cpu %d\n", cpunum); return 0;