diff options
| author | Ingo Molnar <mingo@kernel.org> | 2025-12-12 10:26:42 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2025-12-12 10:26:42 +0100 |
| commit | 899c86a50aa623fe6bf78127357f455bcd5e736e (patch) | |
| tree | 96fe48b9f3e7a1e977ff6708ab026a5189609304 | |
| parent | 70b61565479c837cde50a5bc7253749de6a5efc9 (diff) | |
| parent | c94291914b200e10c72cef23c8e4c67eb4fdbcd9 (diff) | |
| download | tip-899c86a50aa623fe6bf78127357f455bcd5e736e.tar.gz | |
Merge branch into tip/master: 'smp/urgent'
# New commits in smp/urgent:
c94291914b20 ("cpu: Make atomic hotplug callbacks run with interrupts disabled on UP")
Signed-off-by: Ingo Molnar <mingo@kernel.org>
| -rw-r--r-- | kernel/cpu.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index b674fdf96208be..8df2d773fe3b52 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -249,6 +249,14 @@ err: return ret; } +/* + * The former STARTING/DYING states, ran with IRQs disabled and must not fail. + */ +static bool cpuhp_is_atomic_state(enum cpuhp_state state) +{ + return CPUHP_AP_IDLE_DEAD <= state && state < CPUHP_AP_ONLINE; +} + #ifdef CONFIG_SMP static bool cpuhp_is_ap_state(enum cpuhp_state state) { @@ -271,14 +279,6 @@ static inline void complete_ap_thread(struct cpuhp_cpu_state *st, bool bringup) complete(done); } -/* - * The former STARTING/DYING states, ran with IRQs disabled and must not fail. - */ -static bool cpuhp_is_atomic_state(enum cpuhp_state state) -{ - return CPUHP_AP_IDLE_DEAD <= state && state < CPUHP_AP_ONLINE; -} - /* Synchronization state management */ enum cpuhp_sync_state { SYNC_STATE_DEAD, @@ -2364,7 +2364,14 @@ static int cpuhp_issue_call(int cpu, enum cpuhp_state state, bool bringup, else ret = cpuhp_invoke_callback(cpu, state, bringup, node, NULL); #else - ret = cpuhp_invoke_callback(cpu, state, bringup, node, NULL); + if (cpuhp_is_atomic_state(state)) { + guard(irqsave)(); + ret = cpuhp_invoke_callback(cpu, state, bringup, node, NULL); + /* STARTING/DYING must not fail! */ + WARN_ON_ONCE(ret); + } else { + ret = cpuhp_invoke_callback(cpu, state, bringup, node, NULL); + } #endif BUG_ON(ret && !bringup); return ret; |
