]> www.infradead.org Git - users/jedix/linux-maple.git/commit
irqchip/riscv-imsic: Special handling for non-atomic device MSI update
authorAnup Patel <apatel@ventanamicro.com>
Mon, 17 Feb 2025 08:56:56 +0000 (14:26 +0530)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 20 Feb 2025 14:19:27 +0000 (15:19 +0100)
commit896f8e436f9951fa9ef68dab0a3d399ec3a6e1d7
tree6a5578f9b8de89eeb34cda34d6d8ae5c6ef1ce56
parent0bd55080ba9e3c16719f75006fd85b932c85f2f4
irqchip/riscv-imsic: Special handling for non-atomic device MSI update

Devices, which have a non-atomic MSI update, might see an intermediate
state when changing the target IMSIC vector from one CPU to another.

To avoid losing interrupts due to this intermediate state, do the following
just like x86 APIC:

 1) First write a temporary IMSIC vector to the device which has the same
    MSI address as the old IMSIC vector and MSI data pointing to the new
    IMSIC vector.

 2) Next write the new IMSIC vector to the device.

Based on the above, the __imsic_local_sync() must check pending status of
both old MSI data and new MSI data on the old CPU. In addition, the
movement of IMSIC vector for non-atomic device MSI update must be done in
interrupt context using IRQCHIP_MOVE_DEFERRED.

Implememnt the logic and enforce the chip flag for PCI/MSI[X].

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