Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp477961pxb; Wed, 3 Mar 2021 07:54:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwVLA7ssBHdLDHjtU1XaQCc35tOXA2f93+7KJYMnKYs9zDdM+PPIdrL5HY2fk5jav67Fcv X-Received: by 2002:a17:906:380b:: with SMTP id v11mr26869154ejc.183.1614786858818; Wed, 03 Mar 2021 07:54:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614786858; cv=none; d=google.com; s=arc-20160816; b=vMCC5EqhZq9Cxasdk2zl+chV2wH7oqRPhs7IUjU+qSIirjauvcvSzeAG4l00ckAufJ 41BUZVLp92p4RECTxxn5dxTkTTblLLY0R08SQILE6uu8gZ55EzYvmwlx8z3646WxtQTg V3m06FxjW9nk6rv/lKx+b/gEAjjIPQgPcwXKmAm9pUGUIV0P6lNkD9OZIojOQMK8vsqB XtH47HAdtuuPQiyP4gyQJWk0o19gu7doZ+CgKEbBB3wYR6vF9tk9mADXgKkf9tKI44jm CKn4Lf7z+aEjK4xll4j8rgqsNG5rvE2eH1o8zn4Yl1/gcRDGXcuLuBc1dW1K1rZ2nQFa +yuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nvOnVgn3Jt0VJxgtrnPViNCvWaK7vO/r4e/LVBcRrag=; b=f4qk7HxpoakS1jiFTZca337FbrLCv87r7QWWyCm4o1Slek4/Jmp7TxBnpPM4EhP1lt BDIhG+PRyJTdBpxKATJsWxF8qIHC6YQgp+eYB33DxTs3HZhuY57afXR6IY50GquHVK+I gyIvkKf/Y7mkcLvYH7U8IFbuoj15s9/9ogSh8Uq4O3HCAT7Cobabg2zrjQp1Mw8wWNlp J7Ddn7Ds0ieo6I4NAke5c/hfzUQWio921d1U+WvZzjd2Ki9rcgR3YEhT6byV5WP/Z2nl Gf0yW25RCHr8iOfZrF7/AhJd6exMnVDreVabbLq8D+1XFpdTWdHuY1EqMlhd2i/Ttr/O THNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KMV9omhH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g21si13143419ejf.645.2021.03.03.07.53.40; Wed, 03 Mar 2021 07:54:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KMV9omhH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344811AbhCAXCd (ORCPT + 99 others); Mon, 1 Mar 2021 18:02:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:46818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238759AbhCARv5 (ORCPT ); Mon, 1 Mar 2021 12:51:57 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0A55A652A2; Mon, 1 Mar 2021 17:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614619987; bh=B+5Ej21oe3slsVUQB/DTQ5hFfsW+Sr1qpTmRgiFTSco=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KMV9omhHj9cBDd+3LchpY88AV2O2zseGPdLsHr2+or09IaGr8i3kXp4P9sktfivgL Nvj4ltOdpSYpPOcds8zS5Yz2aEli5MzqKNAVNJJwHQf3dfaHct4ZhLEJ4lWAZeok4Y PWbs/JIL2HLUMQ/dFLUKz/J6twrKo4xC0T6bX7LA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Rafael J. Wysocki" , Chen Yu Subject: [PATCH 5.10 623/663] cpufreq: intel_pstate: Change intel_pstate_get_hwp_max() argument Date: Mon, 1 Mar 2021 17:14:31 +0100 Message-Id: <20210301161212.671621980@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki commit a45ee4d4e13b0e35a8ec7ea0bf9267243d57b302 upstream. All of the callers of intel_pstate_get_hwp_max() access the struct cpudata object that corresponds to the given CPU already and the function itself needs to access that object (in order to update hwp_cap_cached), so modify the code to pass a struct cpudata pointer to it instead of the CPU number. Signed-off-by: Rafael J. Wysocki Tested-by: Chen Yu Signed-off-by: Greg Kroah-Hartman --- drivers/cpufreq/intel_pstate.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -829,13 +829,13 @@ static struct freq_attr *hwp_cpufreq_att NULL, }; -static void intel_pstate_get_hwp_max(unsigned int cpu, int *phy_max, +static void intel_pstate_get_hwp_max(struct cpudata *cpu, int *phy_max, int *current_max) { u64 cap; - rdmsrl_on_cpu(cpu, MSR_HWP_CAPABILITIES, &cap); - WRITE_ONCE(all_cpu_data[cpu]->hwp_cap_cached, cap); + rdmsrl_on_cpu(cpu->cpu, MSR_HWP_CAPABILITIES, &cap); + WRITE_ONCE(cpu->hwp_cap_cached, cap); if (global.no_turbo || global.turbo_disabled) *current_max = HWP_GUARANTEED_PERF(cap); else @@ -1223,7 +1223,7 @@ static void update_qos_request(enum freq continue; if (hwp_active) - intel_pstate_get_hwp_max(i, &turbo_max, &max_state); + intel_pstate_get_hwp_max(cpu, &turbo_max, &max_state); else turbo_max = cpu->pstate.turbo_pstate; @@ -1733,7 +1733,7 @@ static void intel_pstate_get_cpu_pstates if (hwp_active && !hwp_mode_bdw) { unsigned int phy_max, current_max; - intel_pstate_get_hwp_max(cpu->cpu, &phy_max, ¤t_max); + intel_pstate_get_hwp_max(cpu, &phy_max, ¤t_max); cpu->pstate.turbo_freq = phy_max * cpu->pstate.scaling; cpu->pstate.turbo_pstate = phy_max; } else { @@ -2217,7 +2217,7 @@ static void intel_pstate_update_perf_lim * rather than pure ratios. */ if (hwp_active) { - intel_pstate_get_hwp_max(cpu->cpu, &turbo_max, &max_state); + intel_pstate_get_hwp_max(cpu, &turbo_max, &max_state); } else { max_state = global.no_turbo || global.turbo_disabled ? cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; @@ -2332,7 +2332,7 @@ static void intel_pstate_verify_cpu_poli if (hwp_active) { int max_state, turbo_max; - intel_pstate_get_hwp_max(cpu->cpu, &turbo_max, &max_state); + intel_pstate_get_hwp_max(cpu, &turbo_max, &max_state); max_freq = max_state * cpu->pstate.scaling; } else { max_freq = intel_pstate_get_max_freq(cpu); @@ -2675,7 +2675,7 @@ static int intel_cpufreq_cpu_init(struct if (hwp_active) { u64 value; - intel_pstate_get_hwp_max(policy->cpu, &turbo_max, &max_state); + intel_pstate_get_hwp_max(cpu, &turbo_max, &max_state); policy->transition_delay_us = INTEL_CPUFREQ_TRANSITION_DELAY_HWP; rdmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, &value); WRITE_ONCE(cpu->hwp_req_cached, value);