Linux Power Management development
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Hector Martin <marcan@marcan.st>, Sven Peter <sven@svenpeter.dev>,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Lifeng Zheng <zhenglifeng1@huawei.com>,
	asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 08/15] cpufreq: apple: Set .set_boost directly
Date: Fri, 24 Jan 2025 14:28:12 +0530	[thread overview]
Message-ID: <417fcceae52d5173cc2606dcaafe9886fd4cfeb3.1737707712.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1737707712.git.viresh.kumar@linaro.org>

The boost feature can be controlled at two levels currently, driver
level (applies to all policies) and per-policy.

Currently the driver enables driver level boost support from the
per-policy ->init() callback, which isn't really efficient as that gets
called for each policy and then there is online/offline path too where
this gets done unnecessarily.

Instead set the .set_boost field directly and always enable the boost
support. If a policy doesn't support boost feature, the core will not
enable it for that policy.

Keep the initial state of driver level boost to disabled and let the
user enable it if required as ideally the boost frequencies must be used
only when really required.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/apple-soc-cpufreq.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/cpufreq/apple-soc-cpufreq.c b/drivers/cpufreq/apple-soc-cpufreq.c
index 6ff604a0fe79..4994c86feb57 100644
--- a/drivers/cpufreq/apple-soc-cpufreq.c
+++ b/drivers/cpufreq/apple-soc-cpufreq.c
@@ -310,15 +310,6 @@ static int apple_soc_cpufreq_init(struct cpufreq_policy *policy)
 	policy->fast_switch_possible = true;
 	policy->suspend_freq = freq_table[0].frequency;
 
-	if (policy_has_boost_freq(policy)) {
-		ret = cpufreq_enable_boost_support();
-		if (ret) {
-			dev_warn(cpu_dev, "failed to enable boost: %d\n", ret);
-		} else {
-			apple_soc_cpufreq_driver.boost_enabled = true;
-		}
-	}
-
 	return 0;
 
 out_free_cpufreq_table:
@@ -353,6 +344,7 @@ static struct cpufreq_driver apple_soc_cpufreq_driver = {
 	.target_index	= apple_soc_cpufreq_set_target,
 	.fast_switch	= apple_soc_cpufreq_fast_switch,
 	.register_em	= cpufreq_register_em_with_opp,
+	.set_boost	= cpufreq_boost_set_sw,
 	.suspend	= cpufreq_generic_suspend,
 };
 
-- 
2.31.1.272.g89b43f80a514


  parent reply	other threads:[~2025-01-24  8:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-24  8:58 [PATCH 00/15] cpufreq: simplify boost handling Viresh Kumar
2025-01-24  8:58 ` [PATCH 01/15] cpufreq: staticize cpufreq_boost_trigger_state() Viresh Kumar
2025-01-24  8:58 ` [PATCH 02/15] cpufreq: Export cpufreq_boost_set_sw() Viresh Kumar
2025-01-24  8:58 ` [PATCH 03/15] cpufreq: Introduce policy->boost_supported flag Viresh Kumar
2025-01-24  8:58 ` [PATCH 04/15] cpufreq: acpi: Set policy->boost_supported Viresh Kumar
2025-01-24  8:58 ` [PATCH 05/15] cpufreq: amd: " Viresh Kumar
2025-01-30  9:15   ` Dhananjay Ugwekar
2025-01-24  8:58 ` [PATCH 06/15] cpufreq: cppc: " Viresh Kumar
2025-02-06  3:58   ` zhenglifeng (A)
2025-02-06  5:27     ` Viresh Kumar
2025-02-06  6:27   ` zhenglifeng (A)
2025-01-24  8:58 ` [PATCH 07/15] cpufreq: Restrict enabling boost on policies with no boost frequencies Viresh Kumar
2025-01-24  8:58 ` Viresh Kumar [this message]
2025-01-24  8:58 ` [PATCH 09/15] cpufreq: loongson: Set .set_boost directly Viresh Kumar
2025-01-24  8:58 ` [PATCH 10/15] cpufreq: powernv: " Viresh Kumar
2025-01-24  8:58 ` [PATCH 11/15] cpufreq: scmi: " Viresh Kumar
2025-01-28 11:27   ` Sudeep Holla
2025-01-24  8:58 ` [PATCH 12/15] cpufreq: dt: " Viresh Kumar
2025-01-24  8:58 ` [PATCH 13/15] cpufreq: qcom: " Viresh Kumar
2025-01-24  8:58 ` [PATCH 14/15] cpufreq: staticize policy_has_boost_freq() Viresh Kumar
2025-01-24  8:58 ` [PATCH 15/15] cpufreq: Remove cpufreq_enable_boost_support() Viresh Kumar
2025-01-24 11:05 ` [PATCH 00/15] cpufreq: simplify boost handling Rafael J. Wysocki
2025-01-27  3:32   ` Viresh Kumar

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=417fcceae52d5173cc2606dcaafe9886fd4cfeb3.1737707712.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=alyssa@rosenzweig.io \
    --cc=asahi@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=rafael@kernel.org \
    --cc=sven@svenpeter.dev \
    --cc=vincent.guittot@linaro.org \
    --cc=zhenglifeng1@huawei.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