From nobody Thu Apr 9 10:33:16 2026 Received: from esa1.hc555-34.eu.iphmx.com (esa1.hc555-34.eu.iphmx.com [23.90.104.144]) (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 0CA9B31F9A9 for ; Wed, 11 Mar 2026 14:39:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=23.90.104.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773239948; cv=none; b=oEG4/yLf1nqpIZtts+f55bwMfmDoY1qKzBrQW0asw7LwEVaOouTchRIpC2NCRgqF1QBIsKQSDA+ozvk7uWxzCEe3UFbmTuWUuVyjyR1va9XlFuHYvGPPEz4tIOpWeQ+VymrCdm3sXMSGhTZ4e6h0fzfAcA3Y0IO4SevlmdL7fiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773239948; c=relaxed/simple; bh=2Q4lRreYXrbQLEk5poRcazVjqCd3Eq8mJOpK+7xvryY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nMlj6TrBUlDFd80kV8VOV6R0odqbyIre87dPzc0ivARLfi856yuopyaRzsqHBSrlVzUjfkxkCXZjEUlOl0gBal+NNyGnHkbVmBKzODDzcJ9cJqU7u0U0NxNzZ4aGSZK7VyMjUXnNsTsTeybDKDFHsETMxzCGFUUyZY/h2Cb8HN4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mobileye.com; spf=pass smtp.mailfrom=mobileye.com; dkim=fail (0-bit key) header.d=mobileye.com header.i=@mobileye.com header.b=HKIzx3ai reason="key not found in DNS"; arc=none smtp.client-ip=23.90.104.144 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mobileye.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mobileye.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=mobileye.com header.i=@mobileye.com header.b="HKIzx3ai" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mobileye.com; i=@mobileye.com; q=dns/txt; s=MoEyIP; t=1773239945; x=1804775945; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=2Q4lRreYXrbQLEk5poRcazVjqCd3Eq8mJOpK+7xvryY=; b=HKIzx3aibu5xrp8sOaRTugd02nUCjfHHmtIztWsDq82v99r3xVNa7hFB QtHGhtpN1MaiTRARg3H/q9zAxxOgMdMvK0U/f8Gcw3EFVFq8UrMhLxPbx mGQG1C1g2p/tJ9Z/9p/67ov8tdlFbrUt0zJP/5i6hpRoH1gzlUvoMkW6l VJ4bRAb2WCo3/vr3SZzwpPWWBC/eRL9MwKRwIDerCFApxd4xmcryGD+/3 0kzJc+Hs4jxMDXcwWDWKl2m9XMIj8+1Q5yIerryWFqQ40BRdM2znmSTN2 cZY7G0o/RPOkPbS0Fb0UPcSeY0Pw0X5C62KMUu2gSa8ifyoZW/d7scKI8 A==; X-CSE-ConnectionGUID: XiBnQTgkR1qwF0DDhVBwvA== X-CSE-MsgGUID: 0H3vebvLRHi/CxXtxGLkkg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from unknown (HELO ces04_data.me-crop.lan) ([146.255.191.134]) by esa1.hc555-34.eu.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2026 16:37:53 +0200 X-CSE-ConnectionGUID: PN3dHWWWShm/pJENbpQy+A== X-CSE-MsgGUID: sstmYQVjQhqz/vVW3j9OwA== Received: from unknown (HELO epgd071.me-corp.lan) ([10.154.54.3]) by ces04_data.me-crop.lan with SMTP; 11 Mar 2026 16:40:49 +0200 Received: by epgd071.me-corp.lan (sSMTP sendmail emulation); Wed, 11 Mar 2026 16:37:52 +0200 From: Vladimir Kondratiev To: Nick Hu , Anup Patel , Thomas Gleixner , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Vladimir Kondratiev Subject: [PATCH] irqchip/riscv-aplic: fix PM for multi-aplic system Date: Wed, 11 Mar 2026 16:37:49 +0200 Message-ID: <20260311143749.4058818-1-vladimir.kondratiev@mobileye.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The aplic_syscore is a singleton and should be registered once. If it is registered from the driver probe, register_syscore() called multiple times for the system having multiple aplic instances. This results in double registration of the same syscore. Warning triggered: [ 0.553569] ------------[ cut here ]------------ [ 0.553572] list_add double add: new=3Dffffffff81314a68, prev=3Dffffffff= 81314a68, next=3Dffffffff8131f588. [ 0.553643] WARNING: lib/list_debug.c:35 at __list_add_valid_or_report+0= x4e/0xe8, CPU#23: swapper/0/1 [ 0.553660] Modules linked in: [ 0.553668] CPU: 23 UID: 0 PID: 1 Comm: swapper/0 Not tainted 7.0.0-rc1 = #2 PREEMPT_RT [ 0.553675] Hardware name: EyeQ7 evaluation board (DT) [ 0.553679] epc : __list_add_valid_or_report+0x4e/0xe8 [ 0.553685] ra : __list_add_valid_or_report+0x4e/0xe8 [ 0.553691] epc : ffffffff80443e72 ra : ffffffff80443e72 sp : ffffffc600= 0dbaf0 [ 0.553696] gp : ffffffff81391b48 tp : ffffffd6007d9b00 t0 : ffffffd9ef= bc4318 [ 0.553700] t1 : 0000000000000004 t2 : 2d2d2d2d2d2d2d2d s0 : ffffffc600= 0dbb20 [ 0.553704] s1 : ffffffff8131f588 a0 : 0000000000000058 a1 : ffffffff80= 089b9a [ 0.553708] a2 : ffffffd9effab4d0 a3 : 0000000000000000 a4 : 0000000000= 000000 [ 0.553711] a5 : 0000000000000000 a6 : ffffffff80da4889 a7 : ffffffffff= ffffff [ 0.553715] s2 : ffffffff8131f558 s3 : ffffffff81314a68 s4 : ffffffff81= 31f588 [ 0.553719] s5 : ffffffff81367d40 s6 : ffffffff80a00db8 s7 : ffffffff80= a00d78 [ 0.553722] s8 : ffffffff80e4ac38 s9 : ffffffff80a1c430 s10: 0000000000= 000008 [ 0.553726] s11: ffffffff808000c4 t3 : 0000000000000002 t4 : ffffffd9ef= ca3bfc [ 0.553730] t5 : ffffffd9efca3bd8 t6 : ffffffc6000db828 ssp : 000000000= 0000000 [ 0.553734] status: 0000000200000120 badaddr: ffffffff80443e72 cause: 00= 00000000000003 [ 0.553738] [] __list_add_valid_or_report+0x4e/0xe8 [ 0.553745] [] register_syscore+0x3a/0x6c [ 0.553754] [] aplic_probe+0xd8/0xe8 [ 0.553765] [] platform_probe+0x3e/0x7c [ 0.553772] [] really_probe+0x98/0x34a [ 0.553779] [] __driver_probe_device+0xaa/0xf6 [ 0.553785] [] driver_probe_device+0x36/0xc4 [ 0.553791] [] __driver_attach+0x108/0x1ec [ 0.553797] [] bus_for_each_dev+0x58/0xa4 [ 0.553803] [] driver_attach+0x1a/0x22 [ 0.553809] [] bus_add_driver+0xe2/0x204 [ 0.553814] [] driver_register+0x3e/0xd8 [ 0.553820] [] __platform_driver_register+0x1e/0x26 [ 0.553827] [] aplic_driver_init+0x1a/0x22 [ 0.553837] [] do_one_initcall+0x44/0x286 [ 0.553843] [] kernel_init_freeable+0x262/0x2e8 [ 0.553853] [] kernel_init+0x28/0x14c [ 0.553863] [] ret_from_fork_kernel+0x1a/0x15c [ 0.553870] [] ret_from_fork_kernel_asm+0x16/0x18 [ 0.553877] ---[ end trace 0000000000000000 ]--- Move syscore registration to the driver init Fixes: 95a8ddde3660 ("irqchip/riscv-aplic: Preserve APLIC states across sus= pend/resume") Signed-off-by: Vladimir Kondratiev --- drivers/irqchip/irq-riscv-aplic-main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-riscv-aplic-main.c b/drivers/irqchip/irq-r= iscv-aplic-main.c index 8fe4dc5cfdae..12d22b9d65cb 100644 --- a/drivers/irqchip/irq-riscv-aplic-main.c +++ b/drivers/irqchip/irq-riscv-aplic-main.c @@ -376,8 +376,6 @@ static int aplic_probe(struct platform_device *pdev) if (rc) dev_err_probe(dev, rc, "failed to setup APLIC in %s mode\n", msi_mode ? "MSI" : "direct"); - else - register_syscore(&aplic_syscore); =20 #ifdef CONFIG_ACPI if (!acpi_disabled) @@ -400,4 +398,10 @@ static struct platform_driver aplic_driver =3D { }, .probe =3D aplic_probe, }; -builtin_platform_driver(aplic_driver); + +static int __init aplic_driver_init(void) +{ + register_syscore(&aplic_syscore); + return platform_driver_register(&aplic_driver); +} +device_initcall(aplic_driver_init); base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f --=20 2.43.0