diff options
author | James Morse <james.morse@arm.com> | 2022-07-07 17:36:25 +0100 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-01-08 12:37:47 +0000 |
commit | 86b81028dcdd42c1ad294b4a9f0544eaa42c8284 (patch) | |
tree | 1e0804c8871c0a36eaaa44bc91f91930d817c3c8 | |
parent | 9a404d7878e666e7e3af875684aec0b31f90d359 (diff) |
drivers: base: Implement weak arch_unregister_cpu()
Add arch_unregister_cpu() to allow the ACPI machinery to call
unregister_cpu(). This is enough for arm64, riscv and loongarch, but
needs to be overridden by x86 and ia64 who need to do more work.
CC: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
An open question remains from the RFC v2 posting: should we provide a
__weak stub for !HOTPLUG_CPU as well, since in later patches ACPI may
reference this if the compiler doesn't optimise as we expect?
Jonathan Cameron's feedback on this:
Make sense to fix this only if it's a real problem.
Changes since v1:
* Added CONFIG_HOTPLUG_CPU ifdeffery around unregister_cpu
Changes since RFC v2:
* Move earlier in the series
-rw-r--r-- | drivers/base/cpu.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 22625695f310..d32f7937f954 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -531,7 +531,14 @@ int __weak arch_register_cpu(int cpu) { return register_cpu(&per_cpu(cpu_devices, cpu), cpu); } -#endif + +#ifdef CONFIG_HOTPLUG_CPU +void __weak arch_unregister_cpu(int num) +{ + unregister_cpu(&per_cpu(cpu_devices, num)); +} +#endif /* CONFIG_HOTPLUG_CPU */ +#endif /* CONFIG_GENERIC_CPU_DEVICES */ static void __init cpu_dev_register_generic(void) { |