Thread (8 messages) 8 messages, 2 authors, 2026-02-04
STALE141d
Revisions (6)
  1. v7 [diff vs current]
  2. v7 [diff vs current]
  3. v9 [diff vs current]
  4. v10 [diff vs current]
  5. v11 current
  6. v12 [diff vs current]

[PATCH v11 3/4] irqchip/loongarch-avec.c: return IRQ_SET_MASK_OK_DONE when keep affinity

From: Tianyang Zhang <hidden>
Date: 2026-02-03 12:45:51
Also in: lkml, loongarch
Subsystem: irqchip drivers, loongarch, the rest · Maintainers: Thomas Gleixner, Huacai Chen, Linus Torvalds

Interrupt redirection support requires a new redirect-domain, which will
appear as a child domain of avecintc. For each interrupt source, avecintc-domain
only provides the CPU/interrupt vector, while redirect-domain provides other
operations to synchronize interrupt affinity information among multiple cores.

When modifying the affinity of an interrupt associated with redirect-domain,
if the avecintc domain detects that the actual interrupt affinity has not changed,
then redirect-domain does not need to perform any operations.

To achieve the above purpose, when it is detected in avecintc_set_affinity()
that the current affinity remains valid, the return value is modified to
IRQ_SET_MASK_OK_DONE.

However, this introduces some compatibility issues, such as the new return
value causing msi_domain_set_affinity() to no longer perform irq_chip_write_msi_msg().
  1) When redirect exist in the system, the msg_address and msg_data no longer
change after the allocation phase, so it does not actually require updating the
MSI message info.
  2) When only avecintc exists in the system, the irq_domain_activate_irq
interface will be responsible for the initial configuration of the MSI message,
which is unconditional. After that, if unnecessary, no modification to the MSI
message is alse correctly.

Signed-off-by: Tianyang Zhang <redacted>
---
 drivers/irqchip/irq-loongarch-avec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-loongarch-avec.c b/drivers/irqchip/irq-loongarch-avec.c
index 70aa34439370..7bdf3f678db4 100644
--- a/drivers/irqchip/irq-loongarch-avec.c
+++ b/drivers/irqchip/irq-loongarch-avec.c
@@ -99,7 +99,7 @@ static int avecintc_set_affinity(struct irq_data *data, const struct cpumask *de
 			return -EBUSY;
 
 		if (cpu_online(adata->cpu) && cpumask_test_cpu(adata->cpu, dest))
-			return 0;
+			return IRQ_SET_MASK_OK_DONE;
 
 		cpumask_and(&intersect_mask, dest, cpu_online_mask);
 
-- 
2.41.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help