[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <875xnuq6dc.ffs@tglx>
Date: Sun, 08 Dec 2024 21:14:55 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Anup Patel <apatel@...tanamicro.com>
Cc: Marc Zyngier <maz@...nel.org>, Shawn Guo <shawnguo@...nel.org>, Sascha
Hauer <s.hauer@...gutronix.de>, Pengutronix Kernel Team
<kernel@...gutronix.de>, Andrew Lunn <andrew@...n.ch>, Gregory Clement
<gregory.clement@...tlin.com>, Sebastian Hesselbarth
<sebastian.hesselbarth@...il.com>, Palmer Dabbelt <palmer@...belt.com>,
Paul Walmsley <paul.walmsley@...ive.com>, Atish Patra
<atishp@...shpatra.org>, Andrew Jones <ajones@...tanamicro.com>, Sunil V L
<sunilvl@...tanamicro.com>, Anup Patel <anup@...infault.org>,
linux-riscv@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, imx@...ts.linux.dev, Anup Patel
<apatel@...tanamicro.com>
Subject: Re: [PATCH 1/4] irqchip/riscv-imsic: Handle non-atomic MSI updates
for device
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
Powered by blists - more mailing lists