]> Git Repo - linux.git/commitdiff
irqchip/sifive-plic: Fix syscore registration for multi-socket systems
authorAnup Patel <[email protected]>
Wed, 25 Oct 2023 14:28:20 +0000 (19:58 +0530)
committerThomas Gleixner <[email protected]>
Fri, 27 Oct 2023 08:09:15 +0000 (10:09 +0200)
Multi-socket systems have a separate PLIC in each socket, so __plic_init()
is invoked for each PLIC. __plic_init() registers syscore operations, which
obviously fails on the second invocation.

Move it into the already existing condition for installing the CPU hotplug
state so it is only invoked once when the first PLIC is initialized.

[ tglx: Massaged changelog ]

Fixes: e80f0b6a2cf3 ("irqchip/irq-sifive-plic: Add syscore callbacks for hibernation")
Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
drivers/irqchip/irq-sifive-plic.c

index e1484905b7bdbcb92e83ea4c88496c92dfdd199f..5b7bc4fd9517c8972680ad7a503eebf2ca47a518 100644 (file)
@@ -532,17 +532,18 @@ done:
        }
 
        /*
-        * We can have multiple PLIC instances so setup cpuhp state only
-        * when context handler for current/boot CPU is present.
+        * We can have multiple PLIC instances so setup cpuhp state
+        * and register syscore operations only when context handler
+        * for current/boot CPU is present.
         */
        handler = this_cpu_ptr(&plic_handlers);
        if (handler->present && !plic_cpuhp_setup_done) {
                cpuhp_setup_state(CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING,
                                  "irqchip/sifive/plic:starting",
                                  plic_starting_cpu, plic_dying_cpu);
+               register_syscore_ops(&plic_irq_syscore_ops);
                plic_cpuhp_setup_done = true;
        }
-       register_syscore_ops(&plic_irq_syscore_ops);
 
        pr_info("%pOFP: mapped %d interrupts with %d handlers for"
                " %d contexts.\n", node, nr_irqs, nr_handlers, nr_contexts);
This page took 0.05919 seconds and 4 git commands to generate.