Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Jessica Liu and committed by
Thomas Gleixner
b330fbfd 620b6ded

+11 -1
+11 -1
drivers/irqchip/irq-riscv-aplic-main.c
··· 116 116 .ops = &aplic_syscore_ops, 117 117 }; 118 118 119 + static bool aplic_syscore_registered __ro_after_init; 120 + 121 + static void aplic_syscore_init(void) 122 + { 123 + if (!aplic_syscore_registered) { 124 + register_syscore(&aplic_syscore); 125 + aplic_syscore_registered = true; 126 + } 127 + } 128 + 119 129 static int aplic_pm_notifier(struct notifier_block *nb, unsigned long action, void *data) 120 130 { 121 131 struct aplic_priv *priv = container_of(nb, struct aplic_priv, genpd_nb); ··· 389 379 return rc; 390 380 } 391 381 392 - register_syscore(&aplic_syscore); 382 + aplic_syscore_init(); 393 383 394 384 #ifdef CONFIG_ACPI 395 385 if (!acpi_disabled)