mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linux PM <linux-pm@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: [PATCH v2 6/6] cpufreq: intel_pstate: Move two functions closer to callers
Date: Fri, 19 Jun 2026 19:45:19 +0200	[thread overview]
Message-ID: <2044603.PYKUYFuaPT@rafael.j.wysocki> (raw)
In-Reply-To: <6005456.DvuYhMxLoT@rafael.j.wysocki>

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Move intel_pstate_set_pstate() and intel_pstate_set_min_pstate() that
are not used on systems with HWP enabled, closer to their first
callers.

No functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

v1 -> v2: New patch

---
 drivers/cpufreq/intel_pstate.c |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -2258,24 +2258,6 @@ static int hwp_get_cpu_scaling(int cpu)
 	return intel_pstate_cppc_get_scaling(cpu);
 }
 
-static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate)
-{
-	trace_cpu_frequency(pstate * cpu->pstate.scaling, cpu->cpu);
-	cpu->pstate.current_pstate = pstate;
-	/*
-	 * Generally, there is no guarantee that this code will always run on
-	 * the CPU being updated, so force the register update to run on the
-	 * right CPU.
-	 */
-	wrmsrq_on_cpu(cpu->cpu, MSR_IA32_PERF_CTL,
-		      pstate_funcs.get_val(cpu, pstate));
-}
-
-static void intel_pstate_set_min_pstate(struct cpudata *cpu)
-{
-	intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate);
-}
-
 static void intel_pstate_get_hwp_pstates(struct cpudata *cpu)
 {
 	int perf_ctl_max_phys = cpu->pstate.max_pstate_physical;
@@ -2869,6 +2851,19 @@ static void intel_pstate_update_perf_lim
 		 cpu->min_perf_ratio);
 }
 
+static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate)
+{
+	trace_cpu_frequency(pstate * cpu->pstate.scaling, cpu->cpu);
+	cpu->pstate.current_pstate = pstate;
+	/*
+	 * Generally, there is no guarantee that this code will always run on
+	 * the CPU being updated, so force the register update to run on the
+	 * right CPU.
+	 */
+	wrmsrq_on_cpu(cpu->cpu, MSR_IA32_PERF_CTL,
+		      pstate_funcs.get_val(cpu, pstate));
+}
+
 static int intel_pstate_set_policy(struct cpufreq_policy *policy)
 {
 	struct cpudata *cpu;
@@ -2956,6 +2951,11 @@ static int intel_pstate_verify_policy(st
 	return 0;
 }
 
+static void intel_pstate_set_min_pstate(struct cpudata *cpu)
+{
+	intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate);
+}
+
 static int intel_cpufreq_cpu_offline(struct cpufreq_policy *policy)
 {
 	struct cpudata *cpu = all_cpu_data[policy->cpu];




  parent reply	other threads:[~2026-06-19 17:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19 17:31 [PATCH v2 0/6] cpufreq: intel_pstate: Set cpuinfo_min_freq to a lower value with HWP enabled plus cleanups Rafael J. Wysocki
2026-06-19 17:32 ` [PATCH v2 1/6] cpufreq: intel_pstate: Fix setting minimum P-state at init time Rafael J. Wysocki
2026-06-19 17:35 ` [PATCH v2 2/6] cpufreq: intel_pstate: Introduce intel_pstate_update_freq_limits() Rafael J. Wysocki
2026-06-19 17:40 ` [PATCH v2 3/6] cpufreq: intel_pstate: Set initial scaling_min_freq value Rafael J. Wysocki
2026-06-19 17:42 ` [PATCH v2 4/6] cpufreq: intel_pstate: Consolidate frequency values computation Rafael J. Wysocki
2026-06-19 17:44 ` [PATCH v2 5/6] cpufreq: intel_pstate: Consolidate HWP P-states initialization Rafael J. Wysocki
2026-06-19 17:45 ` Rafael J. Wysocki [this message]
2026-06-21 21:50 ` [PATCH v2 0/6] cpufreq: intel_pstate: Set cpuinfo_min_freq to a lower value with HWP enabled plus cleanups srinivas pandruvada
2026-06-22 16:34   ` Rafael J. Wysocki
2026-06-21 23:34 ` Doug Smythies
2026-06-22 16:35   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2044603.PYKUYFuaPT@rafael.j.wysocki \
    --to=rafael@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®