mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Abel Vesa <abel.vesa@oss.qualcomm.com>
To: Ulf Hansson <ulfh@kernel.org>, "Rafael J. Wysocki" <rafael@kernel.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org,
	Abel Vesa <abel.vesa@oss.qualcomm.com>
Subject: [PATCH 4/4] pmdomain: qcom: rpmpd: Let genpd enforce the boot performance floor
Date: Tue, 13 Oct 2026 15:48:42 +0300	[thread overview]
Message-ID: <20261013-genpd-boot-performance-floor-v1-4-a765dc83e6d7@oss.qualcomm.com> (raw)
In-Reply-To: <20261013-genpd-boot-performance-floor-v1-0-a765dc83e6d7@oss.qualcomm.com>

RPMPD clamps corner votes to max_state until its sync_state() callback
runs, without exposing this boot constraint to genpd. The separate enable
vote is not covered by the clamp: rpmpd_power_off() can withdraw it before
the provider's sync_state() callback has run.

Set GENPD_FLAG_POWER_UNKNOWN and use max_state as boot_performance_state.
Let genpd enforce the performance floor and retain consumer-enabled
domains while boot protection is active. Remove the local corner clamp
so genpd accounts for the floor in parent-domain performance aggregation.

Keep state_synced to include the supplied corner in sleep votes for
active-only domains until the provider's sync_state() callback runs,
including when translating an enabled peer's vote. Retain the existing
callback to reconcile corner votes for domains left software-OFF in
genpd.

Assisted-by: LLM
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
---
 drivers/pmdomain/qcom/rpmpd.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/pmdomain/qcom/rpmpd.c b/drivers/pmdomain/qcom/rpmpd.c
index 5f55fc791131..302a5f3a021a 100644
--- a/drivers/pmdomain/qcom/rpmpd.c
+++ b/drivers/pmdomain/qcom/rpmpd.c
@@ -992,7 +992,7 @@ static void to_active_sleep(struct rpmpd *pd, unsigned int corner,
 {
 	*active = corner;
 
-	if (pd->active_only)
+	if (pd->active_only && pd->state_synced)
 		*sleep = 0;
 	else
 		*sleep = *active;
@@ -1006,11 +1006,7 @@ static int rpmpd_aggregate_corner(struct rpmpd *pd)
 	unsigned int this_active_corner = 0, this_sleep_corner = 0;
 	unsigned int peer_active_corner = 0, peer_sleep_corner = 0;
 
-	/* Clamp to the highest corner/level if sync_state isn't done yet */
-	if (!pd->state_synced)
-		this_active_corner = this_sleep_corner = pd->max_state;
-	else
-		to_active_sleep(pd, pd->corner, &this_active_corner, &this_sleep_corner);
+	to_active_sleep(pd, pd->corner, &this_active_corner, &this_sleep_corner);
 
 	if (peer && peer->enabled)
 		to_active_sleep(peer, peer->corner, &peer_active_corner,
@@ -1122,10 +1118,12 @@ static int rpmpd_probe(struct platform_device *pdev)
 		}
 
 		rpmpds[i]->max_state = desc->max_state;
+		rpmpds[i]->pd.boot_performance_state = desc->max_state;
 		rpmpds[i]->pd.power_off = rpmpd_power_off;
 		rpmpds[i]->pd.power_on = rpmpd_power_on;
 		rpmpds[i]->pd.set_performance_state = rpmpd_set_performance;
-		rpmpds[i]->pd.flags = GENPD_FLAG_ACTIVE_WAKEUP;
+		rpmpds[i]->pd.flags = GENPD_FLAG_ACTIVE_WAKEUP |
+				      GENPD_FLAG_POWER_UNKNOWN;
 		pm_genpd_init(&rpmpds[i]->pd, NULL, true);
 
 		data->domains[i] = &rpmpds[i]->pd;

-- 
2.54.0


      parent reply	other threads:[~2026-10-13 12:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 12:48 [PATCH 0/4] pmdomain: Preserve boot performance constraints until sync_state Abel Vesa
2026-10-13 12:48 ` [PATCH 1/4] pmdomain: core: Support a boot performance floor " Abel Vesa
2026-10-13 12:48 ` [PATCH 2/4] pmdomain: core: Prepare boot performance floors before system suspend Abel Vesa
2026-10-13 12:48 ` [PATCH 3/4] pmdomain: qcom: rpmhpd: Let genpd enforce the boot performance floor Abel Vesa
2026-10-13 12:48 ` Abel Vesa [this message]

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=20261013-genpd-boot-performance-floor-v1-4-a765dc83e6d7@oss.qualcomm.com \
    --to=abel.vesa@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=ulfh@kernel.org \
    /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®