* [PATCH] irqchip/riscv-aplic: Restrict genpd notifier to device tree only
@ 2026-03-31 1:30 liu.xuemei1
2026-03-31 8:13 ` [tip: irq/urgent] " tip-bot2 for Jessica Liu
2026-04-30 3:25 ` [PATCH] " patchwork-bot+linux-riscv
0 siblings, 2 replies; 3+ messages in thread
From: liu.xuemei1 @ 2026-03-31 1:30 UTC (permalink / raw)
To: anup, tglx, pjw, palmer, aou, alex, nick.hu, liujingqi,
yongxuan.wang
Cc: linux-riscv, linux-kernel
From: Jessica Liu <liu.xuemei1@zte.com.cn>
On ACPI systems, the aplic's pm_domain is set to
acpi_general_pm_domain, which provides its own power management
callbacks (e.g., runtime_suspend via acpi_subsys_runtime_suspend).
The aplic_pm_add() unconditionally calls dev_pm_genpd_add_notifier()
when dev->pm_domain is non‑NULL, leading to a comparison between
runtime_suspend and genpd_runtime_suspend. This results in the
following errors when ACPI is enabled:
[1.221416] riscv-aplic RSCV0002:00: failed to create APLIC context
[1.221973] riscv-aplic RSCV0002:00: error -ENODEV: failed to setup APLIC in MSI mode
Fix this by adding a check for dev->of_node before adding or removing
the genpd notifier, ensuring it is only used for device tree based
systems.
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 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-riscv-aplic-main.c b/drivers/irqchip/irq-riscv-aplic-main.c":
index 9f53979b6962..d9afb6ae98cf 100644
--- a/drivers/irqchip/irq-riscv-aplic-main.c
+++ b/drivers/irqchip/irq-riscv-aplic-main.c
@@ -150,7 +150,7 @@ static void aplic_pm_remove(void *data)
struct device *dev = priv->dev;
list_del(&priv->head);
- if (dev->pm_domain)
+ if (dev->pm_domain && dev->of_node)
dev_pm_genpd_remove_notifier(dev);
}
@@ -165,7 +165,7 @@ static int aplic_pm_add(struct device *dev, struct aplic_priv *priv)
priv->saved_hw_regs.srcs = srcs;
list_add(&priv->head, &aplics);
- if (dev->pm_domain) {
+ if (dev->pm_domain && dev->of_node) {
priv->genpd_nb.notifier_call = aplic_pm_notifier;
ret = dev_pm_genpd_add_notifier(dev, &priv->genpd_nb);
if (ret)
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [tip: irq/urgent] irqchip/riscv-aplic: Restrict genpd notifier to device tree only
2026-03-31 1:30 [PATCH] irqchip/riscv-aplic: Restrict genpd notifier to device tree only liu.xuemei1
@ 2026-03-31 8:13 ` tip-bot2 for Jessica Liu
2026-04-30 3:25 ` [PATCH] " patchwork-bot+linux-riscv
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Jessica Liu @ 2026-03-31 8:13 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Jessica Liu, Thomas Gleixner, x86, linux-kernel, maz
The following commit has been merged into the irq/urgent branch of tip:
Commit-ID: af416cd9b3fb9d17ac7f4cfa12d1ea83dfd0e4be
Gitweb: https://git.kernel.org/tip/af416cd9b3fb9d17ac7f4cfa12d1ea83dfd0e4be
Author: Jessica Liu <liu.xuemei1@zte.com.cn>
AuthorDate: Tue, 31 Mar 2026 09:30:29 +08:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Tue, 31 Mar 2026 10:11:29 +02:00
irqchip/riscv-aplic: Restrict genpd notifier to device tree only
On ACPI systems, the aplic's pm_domain is set to acpi_general_pm_domain,
which provides its own power management callbacks (e.g., runtime_suspend
via acpi_subsys_runtime_suspend).
aplic_pm_add() unconditionally calls dev_pm_genpd_add_notifier() when
dev->pm_domain is non‑NULL, leading to a comparison between runtime_suspend
and genpd_runtime_suspend. This results in the following errors when ACPI
is enabled:
riscv-aplic RSCV0002:00: failed to create APLIC context
riscv-aplic RSCV0002:00: error -ENODEV: failed to setup APLIC in MSI mode
Fix this by checking for dev->of_node before adding or removing the genpd
notifier, ensuring it is only used for device tree based systems.
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/20260331093029749vRpdH-0qoEqjS0Wnn9M4x@zte.com.cn
---
drivers/irqchip/irq-riscv-aplic-main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-riscv-aplic-main.c b/drivers/irqchip/irq-riscv-aplic-main.c
index 9f53979..d9afb6a 100644
--- a/drivers/irqchip/irq-riscv-aplic-main.c
+++ b/drivers/irqchip/irq-riscv-aplic-main.c
@@ -150,7 +150,7 @@ static void aplic_pm_remove(void *data)
struct device *dev = priv->dev;
list_del(&priv->head);
- if (dev->pm_domain)
+ if (dev->pm_domain && dev->of_node)
dev_pm_genpd_remove_notifier(dev);
}
@@ -165,7 +165,7 @@ static int aplic_pm_add(struct device *dev, struct aplic_priv *priv)
priv->saved_hw_regs.srcs = srcs;
list_add(&priv->head, &aplics);
- if (dev->pm_domain) {
+ if (dev->pm_domain && dev->of_node) {
priv->genpd_nb.notifier_call = aplic_pm_notifier;
ret = dev_pm_genpd_add_notifier(dev, &priv->genpd_nb);
if (ret)
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] irqchip/riscv-aplic: Restrict genpd notifier to device tree only
2026-03-31 1:30 [PATCH] irqchip/riscv-aplic: Restrict genpd notifier to device tree only liu.xuemei1
2026-03-31 8:13 ` [tip: irq/urgent] " tip-bot2 for Jessica Liu
@ 2026-04-30 3:25 ` patchwork-bot+linux-riscv
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-riscv @ 2026-04-30 3:25 UTC (permalink / raw)
To: liu.xuemei1
Cc: linux-riscv, anup, tglx, pjw, palmer, aou, alex, nick.hu,
liujingqi, yongxuan.wang, linux-kernel
Hello:
This patch was applied to riscv/linux.git (fixes)
by Thomas Gleixner <tglx@kernel.org>:
On Tue, 31 Mar 2026 09:30:29 +0800 (CST) you wrote:
> From: Jessica Liu <liu.xuemei1@zte.com.cn>
>
> On ACPI systems, the aplic's pm_domain is set to
> acpi_general_pm_domain, which provides its own power management
> callbacks (e.g., runtime_suspend via acpi_subsys_runtime_suspend).
> The aplic_pm_add() unconditionally calls dev_pm_genpd_add_notifier()
> when dev->pm_domain is non‑NULL, leading to a comparison between
> runtime_suspend and genpd_runtime_suspend. This results in the
> following errors when ACPI is enabled:
>
> [...]
Here is the summary with links:
- irqchip/riscv-aplic: Restrict genpd notifier to device tree only
https://git.kernel.org/riscv/c/af416cd9b3fb
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-30 3:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31 1:30 [PATCH] irqchip/riscv-aplic: Restrict genpd notifier to device tree only liu.xuemei1
2026-03-31 8:13 ` [tip: irq/urgent] " tip-bot2 for Jessica Liu
2026-04-30 3:25 ` [PATCH] " patchwork-bot+linux-riscv
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox