Skip to content

Commit a42a7bb

Browse files
committed
Merge tag 'irq-urgent-2020-03-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fix from Thomas Gleixner: "A single commit to handle an erratum in Cavium ThunderX to prevent access to GIC registers which are broken in the implementation" * tag 'irq-urgent-2020-03-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/gic-v3: Workaround Cavium erratum 38539 when reading GICD_TYPER2
2 parents 34d5a4b + 92c2275 commit a42a7bb

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

Documentation/arm64/silicon-errata.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ stable kernels.
110110
+----------------+-----------------+-----------------+-----------------------------+
111111
| Cavium | ThunderX GICv3 | #23154 | CAVIUM_ERRATUM_23154 |
112112
+----------------+-----------------+-----------------+-----------------------------+
113+
| Cavium | ThunderX GICv3 | #38539 | N/A |
114+
+----------------+-----------------+-----------------+-----------------------------+
113115
| Cavium | ThunderX Core | #27456 | CAVIUM_ERRATUM_27456 |
114116
+----------------+-----------------+-----------------+-----------------------------+
115117
| Cavium | ThunderX Core | #30115 | CAVIUM_ERRATUM_30115 |

drivers/irqchip/irq-gic-v3.c

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#define GICD_INT_NMI_PRI (GICD_INT_DEF_PRI & ~0x80)
3535

3636
#define FLAGS_WORKAROUND_GICR_WAKER_MSM8996 (1ULL << 0)
37+
#define FLAGS_WORKAROUND_CAVIUM_ERRATUM_38539 (1ULL << 1)
3738

3839
struct redist_region {
3940
void __iomem *redist_base;
@@ -1464,6 +1465,15 @@ static bool gic_enable_quirk_msm8996(void *data)
14641465
return true;
14651466
}
14661467

1468+
static bool gic_enable_quirk_cavium_38539(void *data)
1469+
{
1470+
struct gic_chip_data *d = data;
1471+
1472+
d->flags |= FLAGS_WORKAROUND_CAVIUM_ERRATUM_38539;
1473+
1474+
return true;
1475+
}
1476+
14671477
static bool gic_enable_quirk_hip06_07(void *data)
14681478
{
14691479
struct gic_chip_data *d = data;
@@ -1502,6 +1512,19 @@ static const struct gic_quirk gic_quirks[] = {
15021512
.mask = 0xffffffff,
15031513
.init = gic_enable_quirk_hip06_07,
15041514
},
1515+
{
1516+
/*
1517+
* Reserved register accesses generate a Synchronous
1518+
* External Abort. This erratum applies to:
1519+
* - ThunderX: CN88xx
1520+
* - OCTEON TX: CN83xx, CN81xx
1521+
* - OCTEON TX2: CN93xx, CN96xx, CN98xx, CNF95xx*
1522+
*/
1523+
.desc = "GICv3: Cavium erratum 38539",
1524+
.iidr = 0xa000034c,
1525+
.mask = 0xe8f00fff,
1526+
.init = gic_enable_quirk_cavium_38539,
1527+
},
15051528
{
15061529
}
15071530
};
@@ -1577,7 +1600,12 @@ static int __init gic_init_bases(void __iomem *dist_base,
15771600
pr_info("%d SPIs implemented\n", GIC_LINE_NR - 32);
15781601
pr_info("%d Extended SPIs implemented\n", GIC_ESPI_NR);
15791602

1580-
gic_data.rdists.gicd_typer2 = readl_relaxed(gic_data.dist_base + GICD_TYPER2);
1603+
/*
1604+
* ThunderX1 explodes on reading GICD_TYPER2, in violation of the
1605+
* architecture spec (which says that reserved registers are RES0).
1606+
*/
1607+
if (!(gic_data.flags & FLAGS_WORKAROUND_CAVIUM_ERRATUM_38539))
1608+
gic_data.rdists.gicd_typer2 = readl_relaxed(gic_data.dist_base + GICD_TYPER2);
15811609

15821610
gic_data.domain = irq_domain_create_tree(handle, &gic_irq_domain_ops,
15831611
&gic_data);

0 commit comments

Comments
 (0)