From patchwork Wed Mar 28 06:38:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francisco Jerez X-Patchwork-Id: 10312251 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3668A605B4 for ; Wed, 28 Mar 2018 06:44:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 220A529953 for ; Wed, 28 Mar 2018 06:44:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 166F529A4A; Wed, 28 Mar 2018 06:44:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B299E29A18 for ; Wed, 28 Mar 2018 06:43:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 344B76E205; Wed, 28 Mar 2018 06:43:56 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) by gabe.freedesktop.org (Postfix) with ESMTPS id 269C96E1F0 for ; Wed, 28 Mar 2018 06:43:50 +0000 (UTC) Received: from cotinga.riseup.net (cotinga-pn.riseup.net [10.0.1.164]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.riseup.net (Postfix) with ESMTPS id D4B121A0960; Tue, 27 Mar 2018 23:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1522219429; bh=BSk6weUxqavBqQ49tlN/wqMGZJKxFOG+qOGMcNjGif8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iR5mOaBXx7KHSpvYymMpv9sGcvJKMRvEgr0tTW+xhZcJwoVdwY5QraNeq80Ll31nH oXvB/GXw2Iqh8AnVKxYZLD8doHubWVCjnMVFlOiJeAEKv2AtT6Wh1WtC3/viLkfUvj ovIzMOEKFH4xk9lGI4Mir8OWAwATIaWKT5uy9xvg= X-Riseup-User-ID: EBC4C47AB641FC888BA5FB68E4B454DD342A4C01AA29944D6BEA8C0A7BE66DCD Received: from [127.0.0.1] (localhost [127.0.0.1]) by cotinga.riseup.net with ESMTPSA id 88C0F6C447; Tue, 27 Mar 2018 23:43:49 -0700 (PDT) From: Francisco Jerez To: linux-pm@vger.kernel.org, intel-gfx@lists.freedesktop.org, Srinivas Pandruvada Date: Tue, 27 Mar 2018 23:38:40 -0700 Message-Id: <20180328063845.4884-5-currojerez@riseup.net> In-Reply-To: <20180328063845.4884-1-currojerez@riseup.net> References: <20180328063845.4884-1-currojerez@riseup.net> Subject: [Intel-gfx] [PATCH 4/9] Revert "cpufreq: intel_pstate: Simplify intel_pstate_adjust_pstate()" X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eero Tamminen , "Rafael J. Wysocki" MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit a891283e56362543d1d276e192266069ef52075b. The previous approach of taking an explicit P-state target as argument makes it more easily reusable by a future commit. Signed-off-by: Francisco Jerez --- drivers/cpufreq/intel_pstate.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index e21645f0fd3a..ef8f46ff7168 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -1499,15 +1499,13 @@ static void intel_pstate_update_pstate(struct cpudata *cpu, int pstate) wrmsrl(MSR_IA32_PERF_CTL, pstate_funcs.get_val(cpu, pstate)); } -static void intel_pstate_adjust_pstate(struct cpudata *cpu) +static void intel_pstate_adjust_pstate(struct cpudata *cpu, int target_pstate) { int from = cpu->pstate.current_pstate; struct sample *sample; - int target_pstate; update_turbo_state(); - target_pstate = get_target_pstate_use_cpu_load(cpu); target_pstate = intel_pstate_prepare_request(cpu, target_pstate); trace_cpu_frequency(target_pstate * cpu->pstate.scaling, cpu->cpu); intel_pstate_update_pstate(cpu, target_pstate); @@ -1557,8 +1555,12 @@ static void intel_pstate_update_util(struct update_util_data *data, u64 time, return; set_pstate: - if (intel_pstate_sample(cpu, time)) - intel_pstate_adjust_pstate(cpu); + if (intel_pstate_sample(cpu, time)) { + int target_pstate; + + target_pstate = get_target_pstate_use_cpu_load(cpu); + intel_pstate_adjust_pstate(cpu, target_pstate); + } } static struct pstate_funcs core_funcs = {