[PATCH 1/4] irqchip/riscv-imsic: Handle non-atomic MSI updates for device
Thomas Gleixner
tglx at linutronix.de
Sun Dec 8 12:14:55 PST 2024
On Sun, Dec 08 2024 at 20:37, Anup Patel wrote:
> +
> + tvec = vec->local_id == mvec->local_id ?
> + NULL : &lpriv->vectors[mvec->local_id];
> + if (tvec && __imsic_id_read_clear_pending(tvec->local_id)) {
As I told you before:
I don't see a way how that can work remote with the IMSIC either even if
you can easily access the pending state of the remote CPU:
CPU0 CPU1 Device
set_affinity()
write_msg(tmp)
write(addr); // CPU1
write(data); // vector 0x20
raise IRQ (CPU1, vector 0x20)
handle vector 0x20
(other device)
check_pending(CPU1, 0x20) == false -> Interrupt is lost
There is no guarantee that set_affinity() runs on the original target
CPU (CPU 1). Your scheme only works, when CPU1 vector 0x20 is not used
by some other device. If it's used, you lost as CPU1 will consume the
vector and your pending check is not seeing anything.
x86 ensures CPU locality by deferring the affinity move to the next
device interrupt on the original target CPU (CPU1 in the above
example). See CONFIG_GENERIC_IRQ_PENDING.
The interrupt domains which are not affected (remap) set the
IRQ_MOVE_PCNTXT flag to avoid that dance and don't use that affinity
setter code path at all.
Thanks,
tglx
More information about the linux-riscv
mailing list