Commit 910a1658 authored by Nathan Fontenot's avatar Nathan Fontenot Committed by Greg Kroah-Hartman

powerpc/numa: Do not update sysfs cpu registration from invalid context

commit dd023217 upstream.

The topology update code that updates the cpu node registration in sysfs
should not be called while in stop_machine(). The register/unregister
calls take a lock and may sleep.

This patch moves these calls outside of the call to stop_machine().
Signed-off-by: default avatarNathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0288917d
...@@ -1433,11 +1433,9 @@ static int update_cpu_topology(void *data) ...@@ -1433,11 +1433,9 @@ static int update_cpu_topology(void *data)
if (cpu != update->cpu) if (cpu != update->cpu)
continue; continue;
unregister_cpu_under_node(update->cpu, update->old_nid);
unmap_cpu_from_node(update->cpu); unmap_cpu_from_node(update->cpu);
map_cpu_to_node(update->cpu, update->new_nid); map_cpu_to_node(update->cpu, update->new_nid);
vdso_getcpu_init(); vdso_getcpu_init();
register_cpu_under_node(update->cpu, update->new_nid);
} }
return 0; return 0;
...@@ -1485,6 +1483,9 @@ int arch_update_cpu_topology(void) ...@@ -1485,6 +1483,9 @@ int arch_update_cpu_topology(void)
stop_machine(update_cpu_topology, &updates[0], &updated_cpus); stop_machine(update_cpu_topology, &updates[0], &updated_cpus);
for (ud = &updates[0]; ud; ud = ud->next) { for (ud = &updates[0]; ud; ud = ud->next) {
unregister_cpu_under_node(ud->cpu, ud->old_nid);
register_cpu_under_node(ud->cpu, ud->new_nid);
dev = get_cpu_device(ud->cpu); dev = get_cpu_device(ud->cpu);
if (dev) if (dev)
kobject_uevent(&dev->kobj, KOBJ_CHANGE); kobject_uevent(&dev->kobj, KOBJ_CHANGE);
......
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