On 2013-7-3 19:15, Hanjun Guo wrote:
CPU logic online/offline was not implemented on arm64 which is essential for cpu hot-plug, so skeleton the logic cpu online/offline to make arm64 code compile when CONFIG_HOTPLUG_CPU was introduced.
It should be fully implemented at later date. Will discuss it with power management team in LCE13.
Test result: (FOR TEST ONLY! will lead to panic because of CPU logic online/offline was not implemented, but it shows that ACPI CPU hot-plug is working! if you don't trigger the hot-remove, the kernel will runs well :) )
root@genericarmv8:/sys/bus/acpi/devices# ls ACPI0004:00 ACPI0007:01 ACPI0007:03 device:00 ACPI0007:00 ACPI0007:02 LNXSYSTM:00 device:01
root@genericarmv8:/sys/bus/acpi/devices# cd ACPI0007:03 root@genericarmv8:/sys/bus/acpi/devices/ACPI0007:03# ls driver hid path sysdev uevent eject modalias subsystem thermal_cooling uid
We have a *eject* interface for cpu now, which can trigger a hot-remove request from OS!
root@genericarmv8:/sys/bus/acpi/devices/ACPI0007:03# echo 1 > eject root@genericarmv8:/sys/bus/acpi/devices/ACPI0007:03# entered __cpu_disable(), assume always success BUG: failure at kernel/cpu.c:321/_cpu_down()! Kernel panic - not syncing: BUG! CPU: 0 PID: 275 Comm: kworker/0:1 Not tainted 3.10.0-rc6+ #56 Workqueue: kacpi_hotplug acpi_os_execute_deferred Call trace: [<ffffffc00008724c>] dump_backtrace+0x0/0x12c [<ffffffc00008738c>] show_stack+0x14/0x1c [<ffffffc0003f2954>] dump_stack+0x20/0x28 [<ffffffc0003ef7fc>] panic+0xe8/0x214 [<ffffffc0003eab78>] cpu_down+0x0/0x40 [<ffffffc0003eab9c>] cpu_down+0x24/0x40 [<ffffffc0002c0520>] acpi_processor_remove+0x60/0x14c [<ffffffc0002847f8>] acpi_device_remove+0x78/0x98 [<ffffffc0002f5720>] __device_release_driver+0x50/0xa8 [<ffffffc0002f579c>] device_release_driver+0x24/0x38 [<ffffffc0002853c0>] acpi_bus_device_detach+0x4c/0x58 [<ffffffc000285414>] acpi_bus_trim+0x48/0x8c [<ffffffc0002859b8>] acpi_scan_hot_remove+0x80/0x1b4 [<ffffffc000285bf4>] acpi_bus_hot_remove_device+0x30/0x70 [<ffffffc000281664>] acpi_os_execute_deferred+0x2c/0x40 [<ffffffc0000ad474>] process_one_work+0x11c/0x340 [<ffffffc0000adaf8>] worker_thread+0x14c/0x38c [<ffffffc0000b3238>] kthread+0xb4/0xbc
From the dump trace, we can see that the ACPI CPU hot-plug driver
is working fine, so, when the CPU logic online/offline is ready, the physical CPU hot-plug for arm64 is ready too!