irqchip/sifive-plic: Fix syscore registration for multi-socket systems
authorAnup Patel <apatel@ventanamicro.com>
Wed, 25 Oct 2023 14:28:20 +0000 (19:58 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:58:54 +0000 (11:58 +0100)
commit967608cc4ee231541927a50eb8060a4b255ce0b5
treef604660f2b35940e710a820385321973c0d00779
parentdaa5fa45350cb8667cd46a12b66743cc52845cb3
irqchip/sifive-plic: Fix syscore registration for multi-socket systems

[ Upstream commit f99b926f6543faeadba1b4524d8dc9c102489135 ]

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 <apatel@ventanamicro.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20231025142820.390238-4-apatel@ventanamicro.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/irqchip/irq-sifive-plic.c