Skip to content

Commit af416cd

Browse files
Jessica LiuThomas Gleixner
authored andcommitted
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: 95a8ddd ("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
1 parent 7aaa804 commit af416cd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/irqchip/irq-riscv-aplic-main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static void aplic_pm_remove(void *data)
150150
struct device *dev = priv->dev;
151151

152152
list_del(&priv->head);
153-
if (dev->pm_domain)
153+
if (dev->pm_domain && dev->of_node)
154154
dev_pm_genpd_remove_notifier(dev);
155155
}
156156

@@ -165,7 +165,7 @@ static int aplic_pm_add(struct device *dev, struct aplic_priv *priv)
165165

166166
priv->saved_hw_regs.srcs = srcs;
167167
list_add(&priv->head, &aplics);
168-
if (dev->pm_domain) {
168+
if (dev->pm_domain && dev->of_node) {
169169
priv->genpd_nb.notifier_call = aplic_pm_notifier;
170170
ret = dev_pm_genpd_add_notifier(dev, &priv->genpd_nb);
171171
if (ret)

0 commit comments

Comments
 (0)