public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irqchip/riscv-aplic: Register syscore operations only once
@ 2026-03-09  8:11 liu.xuemei1
  2026-03-09  9:17 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: liu.xuemei1 @ 2026-03-09  8:11 UTC (permalink / raw)
  To: anup, tglx, pjw, palmer, aou, alex, liujingqi, cyan.yang, nick.hu,
	yongxuan.wang
  Cc: linux-riscv, linux-kernel

From: Jessica Liu <liu.xuemei1@zte.com.cn>

We can have multiple APLIC instances so setup global state
and resgister syscore operations only once.

Fixes: 95a8ddde3660 ("irqchip/riscv-aplic: Preserve APLIC states across suspend/resume")
Signed-off-by: Jessica Liu <liu.xuemei1@zte.com.cn>
---
 drivers/irqchip/irq-riscv-aplic-main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-riscv-aplic-main.c b/drivers/irqchip/irq-riscv-aplic-main.c
index 4495ca26abf5..8299e0da6577 100644
--- a/drivers/irqchip/irq-riscv-aplic-main.c
+++ b/drivers/irqchip/irq-riscv-aplic-main.c
@@ -20,6 +20,7 @@
 #include "irq-riscv-aplic-main.h"

 static LIST_HEAD(aplics);
+static bool aplic_global_setup_done __ro_after_init;

 static void aplic_restore_states(struct aplic_priv *priv)
 {
@@ -375,8 +376,10 @@ 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
+	else if (!aplic_global_setup_done) {
 		register_syscore(&aplic_syscore);
+		aplic_global_setup_done = true;
+	}

 #ifdef CONFIG_ACPI
 	if (!acpi_disabled)
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-09  9:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09  8:11 [PATCH] irqchip/riscv-aplic: Register syscore operations only once liu.xuemei1
2026-03-09  9:17 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox