Skip to content

Commit b4d81fa

Browse files
zhengyanMarc Zyngier
authored andcommitted
irqchip/gic-v3: Work around affinity issues on ASR8601
The ASR8601 SoC combines ARMv8.2 CPUs from ARM with a GIC-500, also from ARM. However, the two are incompatible as the former expose an affinity in the form of (cluster, core, thread), while the latter can only deal with (cluster, core). If nothing is done, the GIC simply cannot route interrupts to the CPUs. Implement a workaround that shifts the affinity down by a level, ensuring the delivery of interrupts despite the implementation mismatch. Signed-off-by: zhengyan <zhengyan@asrmicro.com> [maz: rewrote commit message, reimplemented the workaround in a manageable way] Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent 3c65cbb commit b4d81fa

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Documentation/arm64/silicon-errata.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,7 @@ stable kernels.
214214
+----------------+-----------------+-----------------+-----------------------------+
215215
| Fujitsu | A64FX | E#010001 | FUJITSU_ERRATUM_010001 |
216216
+----------------+-----------------+-----------------+-----------------------------+
217+
218+
+----------------+-----------------+-----------------+-----------------------------+
219+
| ASR | ASR8601 | #8601001 | N/A |
220+
+----------------+-----------------+-----------------+-----------------------------+

drivers/irqchip/irq-gic-v3.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#define FLAGS_WORKAROUND_GICR_WAKER_MSM8996 (1ULL << 0)
4141
#define FLAGS_WORKAROUND_CAVIUM_ERRATUM_38539 (1ULL << 1)
4242
#define FLAGS_WORKAROUND_MTK_GICR_SAVE (1ULL << 2)
43+
#define FLAGS_WORKAROUND_ASR_ERRATUM_8601001 (1ULL << 3)
4344

4445
#define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1)
4546

@@ -661,6 +662,11 @@ static u64 gic_cpu_to_affinity(int cpu)
661662
u64 mpidr = cpu_logical_map(cpu);
662663
u64 aff;
663664

665+
/* ASR8601 needs to have its affinities shifted down... */
666+
if (unlikely(gic_data.flags & FLAGS_WORKAROUND_ASR_ERRATUM_8601001))
667+
mpidr = (MPIDR_AFFINITY_LEVEL(mpidr, 1) |
668+
(MPIDR_AFFINITY_LEVEL(mpidr, 2) << 8));
669+
664670
aff = ((u64)MPIDR_AFFINITY_LEVEL(mpidr, 3) << 32 |
665671
MPIDR_AFFINITY_LEVEL(mpidr, 2) << 16 |
666672
MPIDR_AFFINITY_LEVEL(mpidr, 1) << 8 |
@@ -1801,12 +1807,26 @@ static bool gic_enable_quirk_nvidia_t241(void *data)
18011807
return true;
18021808
}
18031809

1810+
static bool gic_enable_quirk_asr8601(void *data)
1811+
{
1812+
struct gic_chip_data *d = data;
1813+
1814+
d->flags |= FLAGS_WORKAROUND_ASR_ERRATUM_8601001;
1815+
1816+
return true;
1817+
}
1818+
18041819
static const struct gic_quirk gic_quirks[] = {
18051820
{
18061821
.desc = "GICv3: Qualcomm MSM8996 broken firmware",
18071822
.compatible = "qcom,msm8996-gic-v3",
18081823
.init = gic_enable_quirk_msm8996,
18091824
},
1825+
{
1826+
.desc = "GICv3: ASR erratum 8601001",
1827+
.compatible = "asr,asr8601-gic-v3",
1828+
.init = gic_enable_quirk_asr8601,
1829+
},
18101830
{
18111831
.desc = "GICv3: Mediatek Chromebook GICR save problem",
18121832
.property = "mediatek,broken-save-restore-fw",

0 commit comments

Comments
 (0)