From nobody Thu Apr 9 08:11:01 2026 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [160.30.148.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F5D52E285C for ; Tue, 10 Mar 2026 06:16:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=160.30.148.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773123369; cv=none; b=Wy8Pyd79GQigezwJhd6JN4sbtPlGpfE31B5mhQTLgiCwLvcj12W2lo8CtfxcYIhMi29sBQngBeyOhNHKGMGyu/Ge13MjdbS0BFWi1imbIp9kPCZ8Qa3eT/I//UAFr8bjJqoq0aJGm9MfazuvPHYgJ78OTvALELNgGT5utwLS+68= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773123369; c=relaxed/simple; bh=u3NH18NEX3jdc1+7mlWdWEzuJ4OxQqsvW2IrUFw9kN4=; h=Message-ID:In-Reply-To:References:Date:Mime-Version:From:To:Cc: Subject:Content-Type; b=ZdC1YnufjyM48ygPHB2F+jL75FEdOGmA35uEBw52Y0RxEnF0XaTSywydhUOudFr8PGAk7I6QVrFYvTbK+yzlJqoqfkEbR5i3VXlvMox/lz1WPLHGtcbVbtYv37kPrGeWr5haB3izXwMDwHC4Fr6VzvKSD8fhKLz9DQkytdg6hZQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn; spf=pass smtp.mailfrom=zte.com.cn; arc=none smtp.client-ip=160.30.148.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zte.com.cn Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4fVNtF5kPpz8Xs6y; Tue, 10 Mar 2026 14:16:05 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.99.176]) by mse-fl1.zte.com.cn with SMTP id 62A6FwKW065083; Tue, 10 Mar 2026 14:15:58 +0800 (+08) (envelope-from liu.xuemei1@zte.com.cn) Received: from mapi (xaxapp05[null]) by mapi (Zmail) with MAPI id mid32; Tue, 10 Mar 2026 14:16:00 +0800 (CST) X-Zmail-TransId: 2afc69afb7207e7-b4382 X-Mailer: Zmail v1.0 Message-ID: <20260310141600411Fu8H8-GXOOgKISU48Tjgx@zte.com.cn> In-Reply-To: <20260310141349432DBRJJclgnBHYWu8it0geX@zte.com.cn> References: 20260310141349432DBRJJclgnBHYWu8it0geX@zte.com.cn Date: Tue, 10 Mar 2026 14:16:00 +0800 (CST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 From: To: , , , , , , , , , , Cc: , , Subject: =?UTF-8?B?W1BBVENIIHYyIDEvMl0gaXJxY2hpcC9yaXNjdi1hcGxpYzogRG8gbm90IGNsZWFyIEFDUEkgZGVwZW5kZW5jaWVzIG9uIHByb2JlIGZhaWx1cmU=?= X-MAIL: mse-fl1.zte.com.cn 62A6FwKW065083 X-TLS: YES X-SPF-DOMAIN: zte.com.cn X-ENVELOPE-SENDER: liu.xuemei1@zte.com.cn X-SPF: None X-SOURCE-IP: 10.5.228.132 unknown Tue, 10 Mar 2026 14:16:05 +0800 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 69AFB725.000/4fVNtF5kPpz8Xs6y Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jessica Liu The aplic_probe() function calls acpi_dev_clear_dependencies() unconditionally at the end, even when the preceding setup (MSI or direct mode) has failed. This is incorrect because if the device failed to probe, it should not be considered as active and should not clear dependencies for other devices waiting on it. Fix this by returning immediately when the setup fails, skipping the ACPI dependency cleanup. Also, explicitly return 0 on success instead of relying on the value of 'rc' to make the success path clear. Fixes: 5122e380c23b ("irqchip/riscv-aplic: Add ACPI support") Signed-off-by: Jessica Liu --- drivers/irqchip/irq-riscv-aplic-main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-riscv-aplic-main.c b/drivers/irqchip/irq-r= iscv-aplic-main.c index 4495ca26abf5..8775f188ea4f 100644 --- a/drivers/irqchip/irq-riscv-aplic-main.c +++ b/drivers/irqchip/irq-riscv-aplic-main.c @@ -372,18 +372,21 @@ static int aplic_probe(struct platform_device *pdev) rc =3D aplic_msi_setup(dev, regs); else rc =3D aplic_direct_setup(dev, regs); - if (rc) + + if (rc) { dev_err_probe(dev, rc, "failed to setup APLIC in %s mode\n", msi_mode ? "MSI" : "direct"); - else - register_syscore(&aplic_syscore); + return rc; + } + + register_syscore(&aplic_syscore); #ifdef CONFIG_ACPI if (!acpi_disabled) acpi_dev_clear_dependencies(ACPI_COMPANION(dev)); #endif - return rc; + return 0; } static const struct of_device_id aplic_match[] =3D { --=20 2.27.0 From nobody Thu Apr 9 08:11:01 2026 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [160.30.148.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E01A2E285C for ; Tue, 10 Mar 2026 06:17:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=160.30.148.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773123469; cv=none; b=CGt3gE2QvOGZZuGHaDRDwSwfSaTMqebAkD7Q1Gq+URSt8/md1yNRVXOKJcYbrGqmxzo+Y9L5e2Dbgy6dANICI3SkFYRdDwGLtzepR85yPHjx0xD+2ip2m1fARpk0gFuMK9BhoSpb8vJjwRHVCuGlx8g1Fl36UU9V7+avCGXTItw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773123469; c=relaxed/simple; bh=s64XjjdxpTSqXnMQxT6l+MaZBiQeFWEpgdsg0HffG/A=; h=Message-ID:In-Reply-To:References:Date:Mime-Version:From:To:Cc: Subject:Content-Type; b=nlOK/VbMyb4GN/B7a6fAAFJ5EYOlwshJkc2b3NplfrBHuGKiskoR9QewwqxSj2HAnxPTa131X5eQYV/zhP2ZQJNxblWxxzKIDBLe6Wfcf8Yeo9DJJTdHah7f17m2chwqmFZjWW2nR/qlNYSztLlRXeSNtHpSdE2G+ziMrsg+8JM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn; spf=pass smtp.mailfrom=zte.com.cn; arc=none smtp.client-ip=160.30.148.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zte.com.cn Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4fVNwB3MQ7z8Xs6v; Tue, 10 Mar 2026 14:17:46 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.99.176]) by mse-fl2.zte.com.cn with SMTP id 62A6HT5x005013; Tue, 10 Mar 2026 14:17:29 +0800 (+08) (envelope-from liu.xuemei1@zte.com.cn) Received: from mapi (xaxapp04[null]) by mapi (Zmail) with MAPI id mid32; Tue, 10 Mar 2026 14:17:31 +0800 (CST) X-Zmail-TransId: 2afb69afb77b311-b4eab X-Mailer: Zmail v1.0 Message-ID: <20260310141731145xMwLsyvXl9Gw-m6A4VRYj@zte.com.cn> In-Reply-To: <20260310141349432DBRJJclgnBHYWu8it0geX@zte.com.cn> References: 20260310141349432DBRJJclgnBHYWu8it0geX@zte.com.cn Date: Tue, 10 Mar 2026 14:17:31 +0800 (CST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 From: To: , , , , , , , , , , Cc: , , Subject: =?UTF-8?B?W1BBVENIIHYyIDIvMl0gaXJxY2hpcC9yaXNjdi1hcGxpYzogUmVnaXN0ZXIgc3lzY29yZSBvcGVyYXRpb25zIG9ubHkgb25jZQ==?= X-MAIL: mse-fl2.zte.com.cn 62A6HT5x005013 X-TLS: YES X-SPF-DOMAIN: zte.com.cn X-ENVELOPE-SENDER: liu.xuemei1@zte.com.cn X-SPF: None X-SOURCE-IP: 10.5.228.133 unknown Tue, 10 Mar 2026 14:17:46 +0800 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 69AFB78A.000/4fVNwB3MQ7z8Xs6v Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jessica Liu 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: [ 1.188071] list_add double add: new=3Dffffffffb91461f0, prev=3Dffffffff= b91461f0, next=3Dffffffffb915c408. [ 1.189839] ------------[ cut here ]------------ [ 1.190080] kernel BUG at lib/list_debug.c:35! [ 1.190403] Kernel BUG [#1] [ 1.190438] Modules linked in: [ 1.191173] CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted 7.0.0-rc2+ = #1 PREEMPT(full) [ 1.191363] Hardware name: QEMU QEMU Virtual Machine, BIOS edk2-202402-2= 0.an23 02/14/2024 [ 1.191495] epc : __list_add_valid_or_report+0x60/0xc0 [ 1.192103] ra : __list_add_valid_or_report+0x60/0xc0 [ 1.192143] epc : ffffffffb7b5c8ca ra : ffffffffb7b5c8ca sp : ffffffc600= 103ad0 [ 1.192166] gp : ffffffffb91feb60 tp : ffffffd680a1eac0 t0 : 2000000000= 000000 [ 1.192188] t1 : 000000000000006c t2 : 206464615f747369 s0 : ffffffc600= 103b00 [ 1.192209] s1 : ffffffffb915c408 a0 : 0000000000000058 a1 : ffffffe23e= f7b0c0 [ 1.192229] a2 : 0000000000000010 a3 : 0000000000000000 a4 : 0000000000= 000000 [ 1.192249] a5 : 0000000000000000 a6 : c0000000ffffdfff a7 : ffffffffb9= 3da948 [ 1.192271] s2 : ffffffffb91461f0 s3 : ffffffffb91461f0 s4 : ffffffffb9= 15c408 [ 1.192292] s5 : ffffffd681254890 s6 : ffffffffb8c40410 s7 : ffffffffb8= 4361c8 [ 1.192313] s8 : 0000000000000000 s9 : 0000000000000000 s10: 0000000000= 000000 [ 1.192333] s11: 0000000000000000 t3 : ffffffffb93da9e7 t4 : ffffffffb9= 3da9e7 [ 1.192352] t5 : ffffffffb93da9e8 t6 : ffffffc6001038d8 ssp : 000000000= 0000000 [ 1.192373] status: 0000000200000120 badaddr: ffffffffb7b5c8ca cause: 00= 00000000000003 [ 1.192508] [] __list_add_valid_or_report+0x60/0xc0 [ 1.192606] [] register_syscore+0x3e/0x70 [ 1.192630] [] aplic_probe+0xc6/0x112 [ 1.192649] [] platform_probe+0x46/0x76 [ 1.192669] [] call_driver_probe+0x1a/0x108 [ 1.192687] [] really_probe+0x82/0x288 [ 1.192707] [] __driver_probe_device+0x6c/0x11e [ 1.192727] [] driver_probe_device+0x2c/0xa0 [ 1.192746] [] __driver_attach+0xce/0x1ee [ 1.192763] [] bus_for_each_dev+0x5a/0xa6 [ 1.192781] [] driver_attach+0x1a/0x22 [ 1.192798] [] bus_add_driver+0x10e/0x1fc [ 1.192817] [] driver_register+0x3e/0xd8 [ 1.192837] [] __platform_driver_register+0x1c/0x24 [ 1.192887] [] aplic_driver_init+0x1a/0x22 [ 1.192909] [] do_one_initcall+0x36/0x2b4 [ 1.192935] [] do_initcalls+0xfe/0x12c [ 1.192958] [] kernel_init_freeable+0x15c/0x1c8 [ 1.192979] [] kernel_init+0x20/0x152 [ 1.193001] [] ret_from_fork_kernel+0x12/0x1f6 [ 1.193020] [] ret_from_fork_kernel_asm+0x16/0x18 [ 1.193190] Code: 86a6 85aa 4517 00fc 0513 7765 8097 ffaa 80e7 9940 (900= 2) 854a [ 1.193665] ---[ end trace 0000000000000000 ]--- [ 1.194254] Kernel panic - not syncing: Fatal exception in interrupt [ 1.194627] SMP: stopping secondary CPUs [ 1.195436] Kernel Offset: 0x37600000 from 0xffffffff80000000 Fix by registering syscore operations only once, using a static variable aplic_syscore_registered to track registration. Fixes: 95a8ddde3660 ("irqchip/riscv-aplic: Preserve APLIC states across sus= pend/resume") Signed-off-by: Jessica Liu --- drivers/irqchip/irq-riscv-aplic-main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-riscv-aplic-main.c b/drivers/irqchip/irq-r= iscv-aplic-main.c index 8775f188ea4f..9f53979b6962 100644 --- a/drivers/irqchip/irq-riscv-aplic-main.c +++ b/drivers/irqchip/irq-riscv-aplic-main.c @@ -116,6 +116,16 @@ static struct syscore aplic_syscore =3D { .ops =3D &aplic_syscore_ops, }; +static bool aplic_syscore_registered __ro_after_init; + +static void aplic_syscore_init(void) +{ + if (!aplic_syscore_registered) { + register_syscore(&aplic_syscore); + aplic_syscore_registered =3D true; + } +} + static int aplic_pm_notifier(struct notifier_block *nb, unsigned long acti= on, void *data) { struct aplic_priv *priv =3D container_of(nb, struct aplic_priv, genpd_nb); @@ -379,7 +389,7 @@ static int aplic_probe(struct platform_device *pdev) return rc; } - register_syscore(&aplic_syscore); + aplic_syscore_init(); #ifdef CONFIG_ACPI if (!acpi_disabled) --=20 2.27.0