Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

smp/hotplug: Undo tglxs brainfart

The attempt to prevent overwriting an active state resulted in a
disaster which effectively disables all dynamically allocated hotplug
states.

Cleanup the mess.

Fixes: dc280d936239 ("cpu/hotplug: Prevent overwriting of callbacks")
Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Thomas Gleixner and committed by
Linus Torvalds
b9d9d691 b4b8664d

+8 -1
+8 -1
kernel/cpu.c
··· 1471 1471 bool multi_instance) 1472 1472 { 1473 1473 int cpu, ret = 0; 1474 + bool dynstate; 1474 1475 1475 1476 if (cpuhp_cb_check(state) || !name) 1476 1477 return -EINVAL; ··· 1480 1479 1481 1480 ret = cpuhp_store_callbacks(state, name, startup, teardown, 1482 1481 multi_instance); 1482 + 1483 + dynstate = state == CPUHP_AP_ONLINE_DYN; 1484 + if (ret > 0 && dynstate) { 1485 + state = ret; 1486 + ret = 0; 1487 + } 1483 1488 1484 1489 if (ret || !invoke || !startup) 1485 1490 goto out; ··· 1515 1508 * If the requested state is CPUHP_AP_ONLINE_DYN, return the 1516 1509 * dynamically allocated state in case of success. 1517 1510 */ 1518 - if (!ret && state == CPUHP_AP_ONLINE_DYN) 1511 + if (!ret && dynstate) 1519 1512 return state; 1520 1513 return ret; 1521 1514 }