]> Git Repo - J-linux.git/commitdiff
irqchip/gic-v3: Fix GIC_LINE_NR accessor
authorZenghui Yu <[email protected]>
Wed, 18 Sep 2019 06:57:30 +0000 (06:57 +0000)
committerMarc Zyngier <[email protected]>
Wed, 18 Sep 2019 10:42:23 +0000 (11:42 +0100)
As per GIC spec, ITLinesNumber indicates the maximum SPI INTID that
the GIC implementation supports. And the maximum SPI INTID an
implementation might support is 1019 (field value 11111).

max(GICD_TYPER_SPIS(...), 1020) is not what we actually want for
GIC_LINE_NR. Fix it to min(GICD_TYPER_SPIS(...), 1020).

Signed-off-by: Zenghui Yu <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
drivers/irqchip/irq-gic-v3.c

index 422664ac5f533b4c69f15933059945eb0c59994e..1edc99335a946dbbac46ce86b5db3d93095b455f 100644 (file)
@@ -59,7 +59,7 @@ static struct gic_chip_data gic_data __read_mostly;
 static DEFINE_STATIC_KEY_TRUE(supports_deactivate_key);
 
 #define GIC_ID_NR      (1U << GICD_TYPER_ID_BITS(gic_data.rdists.gicd_typer))
-#define GIC_LINE_NR    max(GICD_TYPER_SPIS(gic_data.rdists.gicd_typer), 1020U)
+#define GIC_LINE_NR    min(GICD_TYPER_SPIS(gic_data.rdists.gicd_typer), 1020U)
 #define GIC_ESPI_NR    GICD_TYPER_ESPIS(gic_data.rdists.gicd_typer)
 
 /*
This page took 0.05158 seconds and 4 git commands to generate.