[PATCH 15/16] irqchip/gic-v3: fail T241 quirk if alias ioremap fails
From: Haofeng Li
Date: Tue Jul 14 2026 - 09:33:44 EST
From: Haofeng Li <lihaofeng@xxxxxxxxxx>
NVIDIA T241 GICD alias setup only warns about a failed ioremap, then
enables gic_nvidia_t241_erratum. Later accesses through the missing
alias can dereference NULL.
If any alias cannot be mapped, report which chip failed, unmap all
aliases created so far, and return without enabling the erratum static
key.
Fixes: 35727af2b15d ("irqchip/gicv3: Workaround for NVIDIA erratum T241-FABRIC-4")
Signed-off-by: Haofeng Li <lihaofeng@xxxxxxxxxx>
---
drivers/irqchip/irq-gic-v3.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 99444a1b2ffa..a8a395a98c09 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -1840,7 +1840,16 @@ static bool gic_enable_quirk_nvidia_t241(void *data)
phys = gic_data.dist_phys_base + T241_CHIP_GICDA_OFFSET;
phys |= FIELD_PREP(T241_CHIPN_MASK, i);
t241_dist_base_alias[i] = ioremap(phys, SZ_64K);
- WARN_ON_ONCE(!t241_dist_base_alias[i]);
+ if (!t241_dist_base_alias[i]) {
+ pr_err("Failed to map NVIDIA T241 GICD alias for chip %u\n", i);
+ while (i--) {
+ if (t241_dist_base_alias[i]) {
+ iounmap(t241_dist_base_alias[i]);
+ t241_dist_base_alias[i] = NULL;
+ }
+ }
+ return false;
+ }
}
}
static_branch_enable(&gic_nvidia_t241_erratum);
--
2.25.1