Skip to content

Commit f99b926

Browse files
avpatelKAGA-KOKO
authored andcommitted
irqchip/sifive-plic: Fix syscore registration for multi-socket systems
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: e80f0b6 ("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]
1 parent 08d4c17 commit f99b926

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/irqchip/irq-sifive-plic.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -532,17 +532,18 @@ static int __init __plic_init(struct device_node *node,
532532
}
533533

534534
/*
535-
* We can have multiple PLIC instances so setup cpuhp state only
536-
* when context handler for current/boot CPU is present.
535+
* We can have multiple PLIC instances so setup cpuhp state
536+
* and register syscore operations only when context handler
537+
* for current/boot CPU is present.
537538
*/
538539
handler = this_cpu_ptr(&plic_handlers);
539540
if (handler->present && !plic_cpuhp_setup_done) {
540541
cpuhp_setup_state(CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING,
541542
"irqchip/sifive/plic:starting",
542543
plic_starting_cpu, plic_dying_cpu);
544+
register_syscore_ops(&plic_irq_syscore_ops);
543545
plic_cpuhp_setup_done = true;
544546
}
545-
register_syscore_ops(&plic_irq_syscore_ops);
546547

547548
pr_info("%pOFP: mapped %d interrupts with %d handlers for"
548549
" %d contexts.\n", node, nr_irqs, nr_handlers, nr_contexts);

0 commit comments

Comments
 (0)