irqchip: gic: Fix core ID calculation when topology is read from DT
authorTomasz Figa <[email protected]>
Thu, 17 Jul 2014 15:23:44 +0000 (17:23 +0200)
committerJason Cooper <[email protected]>
Fri, 18 Jul 2014 13:13:41 +0000 (13:13 +0000)
commit29e697b11853d3f83b1864ae385abdad4aa2c361
tree74a9accacfe0ae96dec2a3e315ed1e70600738fb
parent144cb08864ed44be52d8634ac69cd98e5efcf527
irqchip: gic: Fix core ID calculation when topology is read from DT

Certain GIC implementation, namely those found on earlier, single
cluster, Exynos SoCs, have registers mapped without per-CPU banking,
which means that the driver needs to use different offset for each CPU.

Currently the driver calculates the offset by multiplying value returned
by cpu_logical_map() by CPU offset parsed from DT. This is correct when
CPU topology is not specified in DT and aforementioned function returns
core ID alone. However when DT contains CPU topology, the function
changes to return cluster ID as well, which is non-zero on mentioned
SoCs and so breaks the calculation in GIC driver.

This patch fixes this by masking out cluster ID in CPU offset
calculation so that only core ID is considered. Multi-cluster Exynos
SoCs already have banked GIC implementations, so this simple fix should
be enough.

Reported-by: Lorenzo Pieralisi <[email protected]>
Reported-by: Bartlomiej Zolnierkiewicz <[email protected]>
Signed-off-by: Tomasz Figa <[email protected]>
Fixes: db0d4db22a78d ("ARM: gic: allow GIC to support non-banked setups")
Cc: <[email protected]> # v3.3+
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Jason Cooper <[email protected]>
drivers/irqchip/irq-gic.c