From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752731AbdC0WjU (ORCPT ); Mon, 27 Mar 2017 18:39:20 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:54993 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752522AbdC0WjI (ORCPT ); Mon, 27 Mar 2017 18:39:08 -0400 From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Srinivas Pandruvada , Doug Smythies Subject: [PATCH 07/16] cpufreq: intel_pstate: Skip unnecessary PID resets on init Date: Tue, 28 Mar 2017 00:11:53 +0200 Message-ID: <212962062.RFRfYPMrrC@aspire.rjw.lan> User-Agent: KMail/4.14.10 (Linux/4.10.0+; KDE/4.14.9; x86_64; ; ) In-Reply-To: <6409323.DYHvh3CYlO@aspire.rjw.lan> References: <6409323.DYHvh3CYlO@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 @@ -1911,12 +1911,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;