irqchip/riscv-imsic: Separate next and previous pointers in IMSIC vector
authorAnup Patel <apatel@ventanamicro.com>
Mon, 17 Feb 2025 08:56:53 +0000 (14:26 +0530)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 20 Feb 2025 14:19:26 +0000 (15:19 +0100)
commit0f67911e821c67ecfccc365a2103ce276a9a56fe
treeb01fcab6aea07b00b4e0a5c7d819d9ba51548921
parent58d868b67a9ac0db477f714939f21849db5f5178
irqchip/riscv-imsic: Separate next and previous pointers in IMSIC vector

Currently, there is only one "move" pointer in struct imsic_vector so
during vector movement the old vector points to the new vector and new
vector points to itself.

To support forced cleanup of the old vector, add separate "move_next" and
"move_prev" pointers to struct imsic_vector, where during vector movement
the "move_next" pointer of the old vector points to the new vector and the
"move_prev" pointer of the new vector points to the old vector.

Both "move_next" and "move_prev" pointers are cleared separately by
__imsic_local_sync() with a restriction that "move_prev" on the new
CPU is cleared only after the old CPU has cleared "move_next".

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250217085657.789309-8-apatel@ventanamicro.com
drivers/irqchip/irq-riscv-imsic-early.c
drivers/irqchip/irq-riscv-imsic-state.c
drivers/irqchip/irq-riscv-imsic-state.h