Skip to content

Commit fa2dabe

Browse files
James Morsectmarinas
authored andcommitted
irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc()
gic_acpi_match_gicc() is only called via gic_acpi_count_gicr_regions(). It should only count the number of enabled redistributors, but it also tries to sanity check the GICC entry, currently returning an error if the Enabled bit is set, but the gicr_base_address is zero. Adding support for the online-capable bit to the sanity check will complicate it, for no benefit. The existing check implicitly depends on gic_acpi_count_gicr_regions() previous failing to find any GICR regions (as it is valid to have gicr_base_address of zero if the redistributors are described via a GICR entry). Instead of complicating the check, remove it. Failures that happen at this point cause the irqchip not to register, meaning no irqs can be requested. The kernel grinds to a panic() pretty quickly. Without the check, MADT tables that exhibit this problem are still caught by gic_populate_rdist(), which helpfully also prints what went wrong: | CPU4: mpidr 100 has no re-distributor! Signed-off-by: James Morse <[email protected]> Reviewed-by: Gavin Shan <[email protected]> Tested-by: Miguel Luis <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 2488444 commit fa2dabe

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

drivers/irqchip/irq-gic-v3.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,19 +2415,10 @@ static int __init gic_acpi_match_gicc(union acpi_subtable_headers *header,
24152415
* If GICC is enabled and has valid gicr base address, then it means
24162416
* GICR base is presented via GICC
24172417
*/
2418-
if (acpi_gicc_is_usable(gicc) && gicc->gicr_base_address) {
2418+
if (acpi_gicc_is_usable(gicc) && gicc->gicr_base_address)
24192419
acpi_data.enabled_rdists++;
2420-
return 0;
2421-
}
24222420

2423-
/*
2424-
* It's perfectly valid firmware can pass disabled GICC entry, driver
2425-
* should not treat as errors, skip the entry instead of probe fail.
2426-
*/
2427-
if (!acpi_gicc_is_usable(gicc))
2428-
return 0;
2429-
2430-
return -ENODEV;
2421+
return 0;
24312422
}
24322423

24332424
static int __init gic_acpi_count_gicr_regions(void)

0 commit comments

Comments
 (0)