Commit 3ffea9a7 authored by Linus Torvalds's avatar Linus Torvalds

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()
parents 4e412160 6ef8eb51
...@@ -1859,6 +1859,9 @@ static inline bool cpuhp_bringup_cpus_parallel(unsigned int ncpus) { return fals ...@@ -1859,6 +1859,9 @@ static inline bool cpuhp_bringup_cpus_parallel(unsigned int ncpus) { return fals
void __init bringup_nonboot_cpus(unsigned int max_cpus) void __init bringup_nonboot_cpus(unsigned int max_cpus)
{ {
if (!max_cpus)
return;
/* Try parallel bringup optimization if enabled */ /* Try parallel bringup optimization if enabled */
if (cpuhp_bringup_cpus_parallel(max_cpus)) if (cpuhp_bringup_cpus_parallel(max_cpus))
return; return;
...@@ -2446,7 +2449,7 @@ EXPORT_SYMBOL_GPL(__cpuhp_state_add_instance); ...@@ -2446,7 +2449,7 @@ EXPORT_SYMBOL_GPL(__cpuhp_state_add_instance);
* The caller needs to hold cpus read locked while calling this function. * The caller needs to hold cpus read locked while calling this function.
* Return: * Return:
* On success: * On success:
* Positive state number if @state is CPUHP_AP_ONLINE_DYN; * Positive state number if @state is CPUHP_AP_ONLINE_DYN or CPUHP_BP_PREPARE_DYN;
* 0 for all other states * 0 for all other states
* On failure: proper (negative) error code * On failure: proper (negative) error code
*/ */
...@@ -2469,7 +2472,7 @@ int __cpuhp_setup_state_cpuslocked(enum cpuhp_state state, ...@@ -2469,7 +2472,7 @@ int __cpuhp_setup_state_cpuslocked(enum cpuhp_state state,
ret = cpuhp_store_callbacks(state, name, startup, teardown, ret = cpuhp_store_callbacks(state, name, startup, teardown,
multi_instance); multi_instance);
dynstate = state == CPUHP_AP_ONLINE_DYN; dynstate = state == CPUHP_AP_ONLINE_DYN || state == CPUHP_BP_PREPARE_DYN;
if (ret > 0 && dynstate) { if (ret > 0 && dynstate) {
state = ret; state = ret;
ret = 0; ret = 0;
...@@ -2500,8 +2503,8 @@ int __cpuhp_setup_state_cpuslocked(enum cpuhp_state state, ...@@ -2500,8 +2503,8 @@ int __cpuhp_setup_state_cpuslocked(enum cpuhp_state state,
out: out:
mutex_unlock(&cpuhp_state_mutex); mutex_unlock(&cpuhp_state_mutex);
/* /*
* If the requested state is CPUHP_AP_ONLINE_DYN, return the * If the requested state is CPUHP_AP_ONLINE_DYN or CPUHP_BP_PREPARE_DYN,
* dynamically allocated state in case of success. * return the dynamically allocated state in case of success.
*/ */
if (!ret && dynstate) if (!ret && dynstate)
return state; return state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment