[PATCH 05/14] cpuidle, cpu/hotplug: Update name & callbacks to match their hotplug states

From: Srivatsa S. Bhat (Microsoft)

Date: Thu Dec 03 2026 - 14:18:40 EST


The PSCI and RISC-V SBI idle drivers register their hotplug callbacks at
CPUHP_AP_CPU_PM_STARTING, but both state names end in ':online'.
This state belongs to the STARTING section, whose callbacks run with
interrupts disabled, not to the ONLINE section.

Change both suffixes to ':starting', following the naming convention
documented in Documentation/core-api/cpu_hotplug.rst.

Also, rename the registered CPU hotplug startup and teardown callbacks
to match the states that they are associated with.

No functional change intended, except for the update to the name string,
which gets reflected in sysfs output and instrumentation.

Fixes: 9c6ceecb6541 ("cpuidle: psci: Support CPU hotplug for the hierarchical model")
Fixes: 6abf32f1d9c5 ("cpuidle: Add RISC-V SBI CPU idle driver")
Signed-off-by: Srivatsa S. Bhat (Microsoft) <srivatsa@xxxxxxxxxxxxx>
---
drivers/cpuidle/cpuidle-psci.c | 10 +++++-----
drivers/cpuidle/cpuidle-riscv-sbi.c | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c
index 3c48876aef85..fbb349a53591 100644
--- a/drivers/cpuidle/cpuidle-psci.c
+++ b/drivers/cpuidle/cpuidle-psci.c
@@ -119,7 +119,7 @@ static int psci_enter_s2idle_domain_idle_state(struct cpuidle_device *dev,
return __psci_enter_domain_idle_state(dev, drv, idx, true);
}

-static int psci_idle_cpuhp_up(unsigned int cpu)
+static int psci_idle_cpu_starting(unsigned int cpu)
{
struct device *pd_dev = __this_cpu_read(psci_cpuidle_data.dev);

@@ -133,7 +133,7 @@ static int psci_idle_cpuhp_up(unsigned int cpu)
return 0;
}

-static int psci_idle_cpuhp_down(unsigned int cpu)
+static int psci_idle_cpu_dying(unsigned int cpu)
{
struct device *pd_dev = __this_cpu_read(psci_cpuidle_data.dev);

@@ -208,9 +208,9 @@ static void psci_idle_init_cpuhp(void)
int err;

err = cpuhp_setup_state_nocalls(CPUHP_AP_CPU_PM_STARTING,
- "cpuidle/psci:online",
- psci_idle_cpuhp_up,
- psci_idle_cpuhp_down);
+ "cpuidle/psci:starting",
+ psci_idle_cpu_starting,
+ psci_idle_cpu_dying);
if (err)
pr_warn("Failed %d while setup cpuhp state\n", err);
}
diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.c b/drivers/cpuidle/cpuidle-riscv-sbi.c
index eacffd4c02fe..94e9c54ebdd6 100644
--- a/drivers/cpuidle/cpuidle-riscv-sbi.c
+++ b/drivers/cpuidle/cpuidle-riscv-sbi.c
@@ -144,7 +144,7 @@ static int sbi_enter_s2idle_domain_idle_state(struct cpuidle_device *dev,
return __sbi_enter_domain_idle_state(dev, drv, idx, true);
}

-static int sbi_cpuidle_cpuhp_up(unsigned int cpu)
+static int sbi_cpuidle_cpu_starting(unsigned int cpu)
{
struct device *pd_dev = __this_cpu_read(sbi_cpuidle_data.dev);

@@ -154,7 +154,7 @@ static int sbi_cpuidle_cpuhp_up(unsigned int cpu)
return 0;
}

-static int sbi_cpuidle_cpuhp_down(unsigned int cpu)
+static int sbi_cpuidle_cpu_dying(unsigned int cpu)
{
struct device *pd_dev = __this_cpu_read(sbi_cpuidle_data.dev);

@@ -175,9 +175,9 @@ static void sbi_idle_init_cpuhp(void)
return;

err = cpuhp_setup_state_nocalls(CPUHP_AP_CPU_PM_STARTING,
- "cpuidle/sbi:online",
- sbi_cpuidle_cpuhp_up,
- sbi_cpuidle_cpuhp_down);
+ "cpuidle/sbi:starting",
+ sbi_cpuidle_cpu_starting,
+ sbi_cpuidle_cpu_dying);
if (err)
pr_warn("Failed %d while setup cpuhp state\n", err);
}

--
2.43.0