mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] irqchip/riscv-aplic: Process pending affinity changes on EOI
@ 2026-11-04 14:21 Troy Mitchell
  0 siblings, 0 replies; only message in thread
From: Troy Mitchell @ 2026-11-04 14:21 UTC (permalink / raw)
  To: Anup Patel, Thomas Gleixner, Radu Rendec, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti
  Cc: Anup Patel, linux-riscv, linux-kernel, Troy Mitchell

IMSIC rejects an affinity change with -EBUSY while a previous vector
move is still in flight, and the IRQ core then records the new mask as
pending. The change is meant to be applied by irq_move_irq() in the
IMSIC irq_ack callback, but APLIC MSI interrupts are handled by
handle_fasteoi_irq(), which does not call irq_ack.

The pending change is therefore never applied. While it is pending,
later affinity changes only update the pending mask, so the interrupt
stays on its old CPU.

Call the parent's irq_ack from the EOI callback, before retriggering
level sources so that they fire at the updated target.

Fixes: 58d868b67a9a ("RISC-V: Select CONFIG_GENERIC_PENDING_IRQ")
Signed-off-by: Troy Mitchell <troy.mitchell@linux.dev>
---
 drivers/irqchip/irq-riscv-aplic-msi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-riscv-aplic-msi.c b/drivers/irqchip/irq-riscv-aplic-msi.c
index fb8d1838609f..a10cc1fb50c2 100644
--- a/drivers/irqchip/irq-riscv-aplic-msi.c
+++ b/drivers/irqchip/irq-riscv-aplic-msi.c
@@ -57,9 +57,12 @@ static void aplic_msi_irq_retrigger_level(struct irq_data *d)
 static void aplic_msi_irq_eoi(struct irq_data *d)
 {
 	/*
-	 * EOI handling is required only for level-triggered interrupts
-	 * when APLIC is in MSI mode.
+	 * The fasteoi flow does not call irq_ack. Let the IMSIC parent
+	 * process affinity moves deferred while its previous vector move
+	 * was still in flight. Both edge and level sources need this.
 	 */
+	irq_chip_ack_parent(d);
+
 	aplic_msi_irq_retrigger_level(d);
 }
 

---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20260909-aplic-affinity-fix-80a4b30bd03e

Best regards,
--  
Troy Mitchell <troy.mitchell@linux.dev>


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-04 14:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 14:21 [PATCH] irqchip/riscv-aplic: Process pending affinity changes on EOI Troy Mitchell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®