Skip to content

Commit ee766b0

Browse files
author
Ulf Hansson
committed
cpuidle: riscv-sbi: Opt-out from genpd's common ->sync_state() support
The riscv-sbi-domain implements its own specific ->sync_state() callback. Let's set the GENPD_FLAG_NO_SYNC_STATE to inform genpd about it. Moreover, let's call of_genpd_sync_state() to make sure genpd tries to power off unused PM domains. Cc: Anup Patel <anup@brainfault.org> Cc: linux-riscv@lists.infradead.org Tested-by: Hiago De Franco <hiago.franco@toradex.com> # Colibri iMX8X Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> # TI AM62A,Xilinx ZynqMP ZCU106 Reviewed-by: Anup Patel <anup@brainfault.org> Reviewed-by: Rahul Pathak <rpathak@ventanamicro.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Link: https://lore.kernel.org/r/20250701114733.636510-12-ulf.hansson@linaro.org
1 parent 7cfa380 commit ee766b0

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/cpuidle/cpuidle-riscv-sbi.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,16 @@ static int sbi_cpuidle_init_cpu(struct device *dev, int cpu)
347347

348348
static void sbi_cpuidle_domain_sync_state(struct device *dev)
349349
{
350+
struct sbi_pd_provider *pd_provider;
351+
350352
/*
351353
* All devices have now been attached/probed to the PM domain
352354
* topology, hence it's fine to allow domain states to be picked.
353355
*/
354356
sbi_cpuidle_pd_allow_domain_state = true;
357+
358+
list_for_each_entry(pd_provider, &sbi_pd_providers, link)
359+
of_genpd_sync_state(pd_provider->node);
355360
}
356361

357362
#ifdef CONFIG_DT_IDLE_GENPD
@@ -396,7 +401,8 @@ static int sbi_pd_init(struct device_node *np)
396401
if (!pd_provider)
397402
goto free_pd;
398403

399-
pd->flags |= GENPD_FLAG_IRQ_SAFE | GENPD_FLAG_CPU_DOMAIN;
404+
pd->flags |= GENPD_FLAG_IRQ_SAFE | GENPD_FLAG_CPU_DOMAIN |
405+
GENPD_FLAG_NO_SYNC_STATE;
400406

401407
/* Allow power off when OSI is available. */
402408
if (sbi_cpuidle_use_osi)

0 commit comments

Comments
 (0)