]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
LoongArch: Use the __weak version of arch_unregister_cpu()
authorJames Morse <james.morse@arm.com>
Tue, 21 Nov 2023 13:45:22 +0000 (13:45 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Dec 2023 03:41:50 +0000 (12:41 +0900)
LoongArch provides its own arch_unregister_cpu(). This clears the
hotpluggable flag, then unregisters the CPU.

It isn't necessary to clear the hotpluggable flag when unregistering
a cpu. unregister_cpu() writes NULL to the percpu cpu_sys_devices
pointer, meaning cpu_is_hotpluggable() will return false, as
get_cpu_device() has returned NULL.

Remove arch_unregister_cpu() and use the __weak version.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/E1r5R46-00Ct0A-GJ@rmk-PC.armlinux.org.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/loongarch/kernel/topology.c

index 7dfb46c68f58254c019ac7fcc9ca577f849cb5a5..866c2c9ef6ab2a3d935639fbce44f9aad1a767d8 100644 (file)
@@ -18,12 +18,4 @@ int arch_register_cpu(int cpu)
        c->hotpluggable = !io_master(cpu);
        return register_cpu(c, cpu);
 }
-
-void arch_unregister_cpu(int cpu)
-{
-       struct cpu *c = &per_cpu(cpu_devices, cpu);
-
-       c->hotpluggable = 0;
-       unregister_cpu(c);
-}
 #endif