drm/nouveau/instmem/gk20a: add write barrier when releasing DMA object
authorAlexandre Courbot <acourbot@nvidia.com>
Thu, 3 Mar 2016 07:38:12 +0000 (16:38 +0900)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 14 Mar 2016 00:13:34 +0000 (10:13 +1000)
When using the DMA-API for instmem, we may obtain a write-combined
mapping. For such cases, add a write barrier in
gk20a_instobj_release_dma() to make sure that all writes have reached
memory at this time.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c

index 4c20fec64d96a0a6238be33e4d05b560e5179337..6b8f2a19b2d96b66d67915a4a91281294a3b848f 100644 (file)
@@ -228,6 +228,8 @@ gk20a_instobj_release_dma(struct nvkm_memory *memory)
        struct gk20a_instmem *imem = node->imem;
        struct nvkm_ltc *ltc = imem->base.subdev.device->ltc;
 
+       /* in case we got a write-combined mapping */
+       wmb();
        nvkm_ltc_invalidate(ltc);
 }