]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
irqchip/riscv-aplic: Register syscore operations only once
authorJessica Liu <liu.xuemei1@zte.com.cn>
Tue, 10 Mar 2026 06:17:31 +0000 (14:17 +0800)
committerThomas Gleixner <tglx@kernel.org>
Tue, 10 Mar 2026 17:42:34 +0000 (18:42 +0100)
commitb330fbfd34d7624bec62b99ad88dba2614326a19
tree5d5136f7c6fe4a46c619bb932c03a360b465648b
parent620b6ded72a7f0f77be6ec44d0462bb85729ab7a
irqchip/riscv-aplic: Register syscore operations only once

Since commit 95a8ddde3660 ("irqchip/riscv-aplic: Preserve APLIC
states across suspend/resume"), when multiple NUMA nodes exist
and AIA is not configured as "none", aplic_probe() is called
multiple times. This leads to register_syscore(&aplic_syscore)
being invoked repeatedly, causing the following Oops:

 list_add double add: new=ffffffffb91461f0, prev=ffffffffb91461f0, next=ffffffffb915c408.
 [<ffffffffb7b5c8ca>] __list_add_valid_or_report+0x60/0xc0
 [<ffffffffb7cc3236>] register_syscore+0x3e/0x70
 [<ffffffffb7b8d61c>] aplic_probe+0xc6/0x112

Fix this by registering syscore operations only once, using a static
variable aplic_syscore_registered to track registration.

[ tglx: Trim backtrace properly ]

Fixes: 95a8ddde3660 ("irqchip/riscv-aplic: Preserve APLIC states across suspend/resume")
Signed-off-by: Jessica Liu <liu.xuemei1@zte.com.cn>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260310141731145xMwLsyvXl9Gw-m6A4VRYj@zte.com.cn
drivers/irqchip/irq-riscv-aplic-main.c