Skip to content

Commit 3ffea9a

Browse files
committed
Merge tag 'smp_urgent_for_v6.10_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull smp fixes from Borislav Petkov: - Fix "nosmp" and "maxcpus=0" after the parallel CPU bringup work went in and broke them - Make sure CPU hotplug dynamic prepare states are actually executed * tag 'smp_urgent_for_v6.10_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: cpu: Fix broken cmdline "nosmp" and "maxcpus=0" cpu/hotplug: Fix dynstate assignment in __cpuhp_setup_state_cpuslocked()
2 parents 4e41216 + 6ef8eb5 commit 3ffea9a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

kernel/cpu.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,6 +1859,9 @@ static inline bool cpuhp_bringup_cpus_parallel(unsigned int ncpus) { return fals
18591859

18601860
void __init bringup_nonboot_cpus(unsigned int max_cpus)
18611861
{
1862+
if (!max_cpus)
1863+
return;
1864+
18621865
/* Try parallel bringup optimization if enabled */
18631866
if (cpuhp_bringup_cpus_parallel(max_cpus))
18641867
return;
@@ -2446,7 +2449,7 @@ EXPORT_SYMBOL_GPL(__cpuhp_state_add_instance);
24462449
* The caller needs to hold cpus read locked while calling this function.
24472450
* Return:
24482451
* On success:
2449-
* Positive state number if @state is CPUHP_AP_ONLINE_DYN;
2452+
* Positive state number if @state is CPUHP_AP_ONLINE_DYN or CPUHP_BP_PREPARE_DYN;
24502453
* 0 for all other states
24512454
* On failure: proper (negative) error code
24522455
*/
@@ -2469,7 +2472,7 @@ int __cpuhp_setup_state_cpuslocked(enum cpuhp_state state,
24692472
ret = cpuhp_store_callbacks(state, name, startup, teardown,
24702473
multi_instance);
24712474

2472-
dynstate = state == CPUHP_AP_ONLINE_DYN;
2475+
dynstate = state == CPUHP_AP_ONLINE_DYN || state == CPUHP_BP_PREPARE_DYN;
24732476
if (ret > 0 && dynstate) {
24742477
state = ret;
24752478
ret = 0;
@@ -2500,8 +2503,8 @@ int __cpuhp_setup_state_cpuslocked(enum cpuhp_state state,
25002503
out:
25012504
mutex_unlock(&cpuhp_state_mutex);
25022505
/*
2503-
* If the requested state is CPUHP_AP_ONLINE_DYN, return the
2504-
* dynamically allocated state in case of success.
2506+
* If the requested state is CPUHP_AP_ONLINE_DYN or CPUHP_BP_PREPARE_DYN,
2507+
* return the dynamically allocated state in case of success.
25052508
*/
25062509
if (!ret && dynstate)
25072510
return state;

0 commit comments

Comments
 (0)