[PATCH V1 4/5] irqchip/loongson-eiointc: Fix registration of syscore_ops
From: Jianmin Lv
Date: Fri Mar 24 2023 - 02:09:15 EST
When support suspend/resume for loongson-eiointc, the syscore_ops is
registered twice in dual-bridges machines where there are two eiointc IRQ
domains. Repeated registration of an same syscore_ops broke syscore_ops_list.
Also, cpuhp_setup_state_nocalls is only needed to call for once. So the
patch will corret them.
Change-Id: I7a9060fa109baab5e9b155baa51f12e46633d304
Fixes: a90335c2dfb4 ("irqchip/loongson-eiointc: Add suspend/resume support")
Signed-off-by: Jianmin Lv <lvjianmin@xxxxxxxxxxx>
---
drivers/irqchip/irq-loongson-eiointc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c
index b165c27a3609..e7e1201e61f2 100644
--- a/drivers/irqchip/irq-loongson-eiointc.c
+++ b/drivers/irqchip/irq-loongson-eiointc.c
@@ -419,10 +419,12 @@ int __init eiointc_acpi_init(struct irq_domain *parent,
parent_irq = irq_create_mapping(parent, acpi_eiointc->cascade);
irq_set_chained_handler_and_data(parent_irq, eiointc_irq_dispatch, priv);
- register_syscore_ops(&eiointc_syscore_ops);
- cpuhp_setup_state_nocalls(CPUHP_AP_IRQ_LOONGARCH_STARTING,
+ if (nr_pics == 1) {
+ register_syscore_ops(&eiointc_syscore_ops);
+ cpuhp_setup_state_nocalls(CPUHP_AP_IRQ_LOONGARCH_STARTING,
"irqchip/loongarch/intc:starting",
eiointc_router_init, NULL);
+ }
if (cpu_has_flatmode)
node = cpu_to_node(node * CORES_PER_EIO_NODE);
--
2.31.1