Skip to content

Commit eb34a0b

Browse files
author
Ulf Hansson
committed
cpuidle: riscv-sbi: Drop redundant sync_state support
The recent updates to the genpd core, can entirely manage the sync_state support for the cpuidle-riscv-sbi-domain. More precisely, genpd prevents our ->power_off() callback from being invoked, until all of our consumers are ready for it. Let's therefore drop the sync_state support for the cpuidle-riscv-sbi-domain as it has become redundant. 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: Rahul Pathak <rpathak@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Link: https://lore.kernel.org/r/20250701114733.636510-25-ulf.hansson@linaro.org
1 parent 039d2b0 commit eb34a0b

1 file changed

Lines changed: 1 addition & 21 deletions

File tree

drivers/cpuidle/cpuidle-riscv-sbi.c

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ static DEFINE_PER_CPU_READ_MOSTLY(struct sbi_cpuidle_data, sbi_cpuidle_data);
4444
static DEFINE_PER_CPU(struct sbi_domain_state, domain_state);
4545
static bool sbi_cpuidle_use_osi;
4646
static bool sbi_cpuidle_use_cpuhp;
47-
static bool sbi_cpuidle_pd_allow_domain_state;
4847

4948
static inline void sbi_set_domain_state(u32 state)
5049
{
@@ -345,20 +344,6 @@ static int sbi_cpuidle_init_cpu(struct device *dev, int cpu)
345344
return ret;
346345
}
347346

348-
static void sbi_cpuidle_domain_sync_state(struct device *dev)
349-
{
350-
struct sbi_pd_provider *pd_provider;
351-
352-
/*
353-
* All devices have now been attached/probed to the PM domain
354-
* topology, hence it's fine to allow domain states to be picked.
355-
*/
356-
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);
360-
}
361-
362347
#ifdef CONFIG_DT_IDLE_GENPD
363348

364349
static int sbi_cpuidle_pd_power_off(struct generic_pm_domain *pd)
@@ -369,9 +354,6 @@ static int sbi_cpuidle_pd_power_off(struct generic_pm_domain *pd)
369354
if (!state->data)
370355
return 0;
371356

372-
if (!sbi_cpuidle_pd_allow_domain_state)
373-
return -EBUSY;
374-
375357
/* OSI mode is enabled, set the corresponding domain state. */
376358
pd_state = state->data;
377359
sbi_set_domain_state(*pd_state);
@@ -401,8 +383,7 @@ static int sbi_pd_init(struct device_node *np)
401383
if (!pd_provider)
402384
goto free_pd;
403385

404-
pd->flags |= GENPD_FLAG_IRQ_SAFE | GENPD_FLAG_CPU_DOMAIN |
405-
GENPD_FLAG_NO_SYNC_STATE;
386+
pd->flags |= GENPD_FLAG_IRQ_SAFE | GENPD_FLAG_CPU_DOMAIN;
406387

407388
/* Allow power off when OSI is available. */
408389
if (sbi_cpuidle_use_osi)
@@ -570,7 +551,6 @@ static struct platform_driver sbi_cpuidle_driver = {
570551
.probe = sbi_cpuidle_probe,
571552
.driver = {
572553
.name = "sbi-cpuidle",
573-
.sync_state = sbi_cpuidle_domain_sync_state,
574554
},
575555
};
576556

0 commit comments

Comments
 (0)