From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CB7C131E2D for ; Sat, 6 Sep 2025 13:12:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757164348; cv=none; b=rnYTiCI7m3gnqe6r08cnrpOmDHWpGhgz7QFF2qvdYReMmEPiWeMKeJK5oFqnrZSlQsL6B7+8cGHTIM6jXVpZy5HA30WE65i3q5PRIq8MKW2+nVay714IMZc1X9N2/or8dzZ/24x1K23cSRTEQ1SkH6yxy7uLaj1xov0dtKjwg6Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757164348; c=relaxed/simple; bh=FbCCccFAEspALZFjCbBhtO83VUm6j/6wVgwl2NjRb20=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gu5zqqm36nfuKzuCWnc4s1Ga19ST5J3RItudGM1vz0tW+NDe8xz1Xrp4X/QV4fipXFDBKkW6N0B/SSzjImW9tWIIm9ZUCwxXviDJp4qtE6XfAKNMFTuLcT6DO+ePcvtz18BlZLWn8EhuuAdXp0Eq/aCcs7XtKEC3gY1SOAbfR78= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b7X1DWSG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b7X1DWSG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D310C4CEF4; Sat, 6 Sep 2025 13:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757164347; bh=FbCCccFAEspALZFjCbBhtO83VUm6j/6wVgwl2NjRb20=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b7X1DWSG8m7YTXHE6c/OhYJqcWQvKIdJkS4mf5BpoUZx2cyz08A211H/iAfHKSiBb /f9LZgAJulqeBrJMWIzCyxtvE4nc7YPiBCppVAL1x/a/Soy4vqzXXkhoV9hGKTacVr IAQSyzQWURHBTxLsoSDlSyoiEaB/5M625Q4Ac6874TStLDmb/ZNvU2waj17zaWKrYm sgJFeBqWJaieHoY5yPX4PjzBOEIBCjkC7C/GnxP8TS+9velPIftV1ReTKRB2JgP4F5 us9p+9sKFqppqRNHBQ439oPyE0xQXVrsDUqFkzNswzuW/StWrYKclVXvMbtsd3skIR ZmyOZLhDDXccw== From: Sasha Levin To: stable@vger.kernel.org Cc: "Rafael J. Wysocki" , Srinivas Pandruvada , Sasha Levin Subject: [PATCH 6.6.y 2/4] cpufreq: intel_pstate: Fold intel_pstate_max_within_limits() into caller Date: Sat, 6 Sep 2025 09:12:22 -0400 Message-ID: <20250906131224.3883544-2-sashal@kernel.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250906131224.3883544-1-sashal@kernel.org> References: <2025050513-urchin-estranged-d31c@gregkh> <20250906131224.3883544-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Rafael J. Wysocki" [ Upstream commit 032c5565eb80edb6f2faeb31939540c897987119 ] Fold intel_pstate_max_within_limits() into its only caller. No functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Srinivas Pandruvada Stable-dep-of: ac4e04d9e378 ("cpufreq: intel_pstate: Unchecked MSR aceess in legacy mode") Signed-off-by: Sasha Levin --- drivers/cpufreq/intel_pstate.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index b2da03cd8ebd9..03c585113d569 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2027,14 +2027,6 @@ static void intel_pstate_set_min_pstate(struct cpudata *cpu) intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); } -static void intel_pstate_max_within_limits(struct cpudata *cpu) -{ - int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio); - - update_turbo_state(); - intel_pstate_set_pstate(cpu, pstate); -} - static void intel_pstate_get_cpu_pstates(struct cpudata *cpu) { int perf_ctl_max_phys = pstate_funcs.get_max_physical(cpu->cpu); @@ -2608,12 +2600,15 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy) intel_pstate_update_perf_limits(cpu, policy->min, policy->max); if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE) { + int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio); + /* * NOHZ_FULL CPUs need this as the governor callback may not * be invoked on them. */ intel_pstate_clear_update_util_hook(policy->cpu); - intel_pstate_max_within_limits(cpu); + update_turbo_state(); + intel_pstate_set_pstate(cpu, pstate); } else { intel_pstate_set_update_util_hook(policy->cpu); } -- 2.50.1