Skip to content

Commit 46a29dd

Browse files
committed
Merge tag 'irq_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fix from Borislav Petkov: - Flush the translation service tables to prevent unpredictable behavior on non-coherent GIC devices * tag 'irq_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/gic-v3-its: Flush ITS tables correctly in non-coherent GIC designs
2 parents cd557bc + d3badb1 commit 46a29dd

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2379,12 +2379,12 @@ static int its_setup_baser(struct its_node *its, struct its_baser *baser,
23792379
break;
23802380
}
23812381

2382+
if (!shr)
2383+
gic_flush_dcache_to_poc(base, PAGE_ORDER_TO_SIZE(order));
2384+
23822385
its_write_baser(its, baser, val);
23832386
tmp = baser->val;
23842387

2385-
if (its->flags & ITS_FLAGS_FORCE_NON_SHAREABLE)
2386-
tmp &= ~GITS_BASER_SHAREABILITY_MASK;
2387-
23882388
if ((val ^ tmp) & GITS_BASER_SHAREABILITY_MASK) {
23892389
/*
23902390
* Shareability didn't stick. Just use
@@ -2394,10 +2394,9 @@ static int its_setup_baser(struct its_node *its, struct its_baser *baser,
23942394
* non-cacheable as well.
23952395
*/
23962396
shr = tmp & GITS_BASER_SHAREABILITY_MASK;
2397-
if (!shr) {
2397+
if (!shr)
23982398
cache = GITS_BASER_nC;
2399-
gic_flush_dcache_to_poc(base, PAGE_ORDER_TO_SIZE(order));
2400-
}
2399+
24012400
goto retry_baser;
24022401
}
24032402

@@ -2609,6 +2608,11 @@ static int its_alloc_tables(struct its_node *its)
26092608
/* erratum 24313: ignore memory access type */
26102609
cache = GITS_BASER_nCnB;
26112610

2611+
if (its->flags & ITS_FLAGS_FORCE_NON_SHAREABLE) {
2612+
cache = GITS_BASER_nC;
2613+
shr = 0;
2614+
}
2615+
26122616
for (i = 0; i < GITS_BASER_NR_REGS; i++) {
26132617
struct its_baser *baser = its->tables + i;
26142618
u64 val = its_read_baser(its, baser);

0 commit comments

Comments
 (0)