From: Lucas Stach Date: Thu, 15 Sep 2016 11:06:43 +0000 (+0200) Subject: drm/etnaviv: space out IOVA layout for cmdbufs on MMUv2 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=7c971c62dd543a323a0cabc0c559caea1759f59f;p=linux.git drm/etnaviv: space out IOVA layout for cmdbufs on MMUv2 At least on the GC3000 the FE MMU is not properly flushing stale TLB entries. Make sure to map the cmdbufs with a big enough spacing in the IOVAs to not hit old/prefetched TLB entries when jumping to a newly mapped cmdbuf. Signed-off-by: Lucas Stach --- diff --git a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c index 304c0b4a9d582..d3796ed8d8c5b 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c @@ -342,7 +342,12 @@ u32 etnaviv_iommu_get_cmdbuf_va(struct etnaviv_gpu *gpu, mutex_unlock(&mmu->lock); return 0; } - mmu->last_iova = buf->vram_node.start + buf->size; + /* + * At least on GC3000 the FE MMU doesn't properly flush old TLB + * entries. Make sure to space the command buffers out in a way + * that the FE MMU prefetch won't load invalid entries. + */ + mmu->last_iova = buf->vram_node.start + buf->size + SZ_64K; gpu->mmu->need_flush = true; mutex_unlock(&mmu->lock);