[PATCH v3 06/14] irqchip/gic-v5: Use linear DT and ITT when L2 covers all IDs

From: Sascha Bischoff

Date: Wed Nov 18 2026 - 12:36:29 EST


The DT and ITT level selector incorrectly chooses a two-level table
when the selected L2 table has exactly enough entries to cover the
full ID space. There are no L1 index bits in this case. ITT allocation
correctly rejects the layout and device registration fails; the DT
path instead allocates an unnecessary one-entry L1 table.

Select a linear DT or ITT when the L2 width equals the ID width.

Fixes: 57d72196dfc85 ("irqchip/gic-v5: Add GICv5 ITS support")
Signed-off-by: Sascha Bischoff <sascha.bischoff@xxxxxxx>
Acked-by: Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
---
drivers/irqchip/irq-gic-v5-its.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-gic-v5-its.c b/drivers/irqchip/irq-gic-v5-its.c
index 88d18822a1ff4..5f9fa80ea6aa6 100644
--- a/drivers/irqchip/irq-gic-v5-its.c
+++ b/drivers/irqchip/irq-gic-v5-its.c
@@ -337,7 +337,7 @@ static bool gicv5_its_l2sz_two_level(bool devtab, u32 its_idr1, u8 id_bits, u8 *

l2_bits = gicv5_its_l2sz_to_l2_bits(l2_sz);

- if (l2_bits > id_bits)
+ if (l2_bits >= id_bits)
return false;

*sz = l2_sz;

--
2.34.1