RISC-V: Treat IPIs as normal Linux IRQs
authorAnup Patel <apatel@ventanamicro.com>
Tue, 28 Mar 2023 03:52:19 +0000 (09:22 +0530)
committerMarc Zyngier <maz@kernel.org>
Sat, 8 Apr 2023 10:26:24 +0000 (11:26 +0100)
commit832f15f42646812b096bc67c0eac439291a0db1f
treeef8ad0a6a4059884420af3c093f0f182ac6aff28
parent0c60a31ce62ca3e93550868fd699dfc4dfc4e795
RISC-V: Treat IPIs as normal Linux IRQs

Currently, the RISC-V kernel provides arch specific hooks (i.e.
struct riscv_ipi_ops) to register IPI handling methods. The stats
gathering of IPIs is also arch specific in the RISC-V kernel.

Other architectures (such as ARM, ARM64, and MIPS) have moved away
from custom arch specific IPI handling methods. Currently, these
architectures have Linux irqchip drivers providing a range of Linux
IRQ numbers to be used as IPIs and IPI triggering is done using
generic IPI APIs. This approach allows architectures to treat IPIs
as normal Linux IRQs and IPI stats gathering is done by the generic
Linux IRQ subsystem.

We extend the RISC-V IPI handling as-per above approach so that arch
specific IPI handling methods (struct riscv_ipi_ops) can be removed
and the IPI handling is done through the Linux IRQ subsystem.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230328035223.1480939-4-apatel@ventanamicro.com
13 files changed:
arch/riscv/Kconfig
arch/riscv/include/asm/sbi.h
arch/riscv/include/asm/smp.h
arch/riscv/kernel/Makefile
arch/riscv/kernel/cpu-hotplug.c
arch/riscv/kernel/irq.c
arch/riscv/kernel/sbi-ipi.c [new file with mode: 0644]
arch/riscv/kernel/sbi.c
arch/riscv/kernel/smp.c
arch/riscv/kernel/smpboot.c
drivers/clocksource/timer-clint.c
drivers/irqchip/Kconfig
drivers/irqchip/irq-riscv-intc.c