All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] irqchip: fix mask alignment in gic-v2m
@ 2026-03-21 14:12 Javier Achirica
  2026-03-23 13:37 ` Marc Zyngier
  0 siblings, 1 reply; 3+ messages in thread
From: Javier Achirica @ 2026-03-21 14:12 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel; +Cc: maz, tglx

commit 2ef3886ce626dcdab0cbc452dbbebc19f57133d8 ("irqchip/gic-v2m: Handle
Multiple MSI base IRQ Alignment") introduced a regression in kernel 6.12.58
affecting PCIe devices using GICv2m MSI on a Qualcomm (arm64) platform.

It uses nr_irqs parameter to generate a mask to align the MSI base address,
but this mask isn't properly generated when nr_irqs isn't a power of two.
This bug was found while adding support for the TCL HH500V router in OpenWrt.

This patch fixes the issue, can be cleanly applied to the 6.12.x tree and,
with a small fuzz, to 7.0.x.

Signed-off-by: Javier Achirica <jachirica@gmail.com>
Cc: stable@vger.kernel.org
---
--- a/drivers/irqchip/irq-gic-v2m.c     2026-03-20 09:45:22.170192561 +0100
+++ b/drivers/irqchip/irq-gic-v2m.c     2026-03-20 09:45:26.284210783 +0100
@@ -158,7 +158,7 @@
        struct v2m_data *v2m = NULL, *tmp;
        int hwirq, i, err = 0;
        unsigned long offset;
-       unsigned long align_mask = nr_irqs - 1;
+       unsigned long align_mask = roundup_pow_of_two(nr_irqs) - 1;

        spin_lock(&v2m_lock);
        list_for_each_entry(tmp, &v2m_nodes, entry) {


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-24 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-21 14:12 [PATCH v1] irqchip: fix mask alignment in gic-v2m Javier Achirica
2026-03-23 13:37 ` Marc Zyngier
2026-03-24 15:08   ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.