Skip to content

Commit 90922a2

Browse files
Shanker DonthineniMarc Zyngier
authored andcommitted
irqchip/gicv3-its: Add workaround for QDF2400 ITS erratum 0065
On Qualcomm Datacenter Technologies QDF2400 SoCs, the ITS hardware implementation uses 16Bytes for Interrupt Translation Entry (ITE), but reports an incorrect value of 8Bytes in GITS_TYPER.ITTE_size. It might cause kernel memory corruption depending on the number of MSI(x) that are configured and the amount of memory that has been allocated for ITEs in its_create_device(). This patch fixes the potential memory corruption by setting the correct ITE size to 16Bytes. Cc: [email protected] Signed-off-by: Shanker Donthineni <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent b3e2284 commit 90922a2

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

Documentation/arm64/silicon-errata.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,4 @@ stable kernels.
6868
| | | | |
6969
| Qualcomm Tech. | Falkor v1 | E1003 | QCOM_FALKOR_ERRATUM_1003 |
7070
| Qualcomm Tech. | Falkor v1 | E1009 | QCOM_FALKOR_ERRATUM_1009 |
71+
| Qualcomm Tech. | QDF2400 ITS | E0065 | QCOM_QDF2400_ERRATUM_0065 |

arch/arm64/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,16 @@ config QCOM_FALKOR_ERRATUM_1009
508508

509509
If unsure, say Y.
510510

511+
config QCOM_QDF2400_ERRATUM_0065
512+
bool "QDF2400 E0065: Incorrect GITS_TYPER.ITT_Entry_size"
513+
default y
514+
help
515+
On Qualcomm Datacenter Technologies QDF2400 SoC, ITS hardware reports
516+
ITE size incorrectly. The GITS_TYPER.ITT_Entry_size field should have
517+
been indicated as 16Bytes (0xf), not 8Bytes (0x7).
518+
519+
If unsure, say Y.
520+
511521
endmenu
512522

513523

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,6 +1601,14 @@ static void __maybe_unused its_enable_quirk_cavium_23144(void *data)
16011601
its->flags |= ITS_FLAGS_WORKAROUND_CAVIUM_23144;
16021602
}
16031603

1604+
static void __maybe_unused its_enable_quirk_qdf2400_e0065(void *data)
1605+
{
1606+
struct its_node *its = data;
1607+
1608+
/* On QDF2400, the size of the ITE is 16Bytes */
1609+
its->ite_size = 16;
1610+
}
1611+
16041612
static const struct gic_quirk its_quirks[] = {
16051613
#ifdef CONFIG_CAVIUM_ERRATUM_22375
16061614
{
@@ -1617,6 +1625,14 @@ static const struct gic_quirk its_quirks[] = {
16171625
.mask = 0xffff0fff,
16181626
.init = its_enable_quirk_cavium_23144,
16191627
},
1628+
#endif
1629+
#ifdef CONFIG_QCOM_QDF2400_ERRATUM_0065
1630+
{
1631+
.desc = "ITS: QDF2400 erratum 0065",
1632+
.iidr = 0x00001070, /* QDF2400 ITS rev 1.x */
1633+
.mask = 0xffffffff,
1634+
.init = its_enable_quirk_qdf2400_e0065,
1635+
},
16201636
#endif
16211637
{
16221638
}

0 commit comments

Comments
 (0)