Skip to content

Commit bab9f95

Browse files
apopplempe
authored andcommitted
powerpc/powernv/npu: Move tlb flush before launching ATSD
The nest MMU tlb flush needs to happen before the GPU translation shootdown is launched to avoid the GPU refilling its tlb with stale nmmu translations prior to the nmmu flush completing. Fixes: 1ab66d1 ("powerpc/powernv: Introduce address translation services for Nvlink2") Cc: [email protected] # v4.12+ Signed-off-by: Alistair Popple <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent de854e5 commit bab9f95

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arch/powerpc/platforms/powernv/npu-dma.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,12 @@ static void mmio_invalidate(struct npu_context *npu_context, int va,
545545
struct mmio_atsd_reg mmio_atsd_reg[NV_MAX_NPUS];
546546
unsigned long pid = npu_context->mm->context.id;
547547

548+
/*
549+
* Unfortunately the nest mmu does not support flushing specific
550+
* addresses so we have to flush the whole mm.
551+
*/
552+
flush_tlb_mm(npu_context->mm);
553+
548554
/*
549555
* Loop over all the NPUs this process is active on and launch
550556
* an invalidate.
@@ -576,12 +582,6 @@ static void mmio_invalidate(struct npu_context *npu_context, int va,
576582
}
577583
}
578584

579-
/*
580-
* Unfortunately the nest mmu does not support flushing specific
581-
* addresses so we have to flush the whole mm.
582-
*/
583-
flush_tlb_mm(npu_context->mm);
584-
585585
mmio_invalidate_wait(mmio_atsd_reg, flush);
586586
if (flush)
587587
/* Wait for the flush to complete */

0 commit comments

Comments
 (0)