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 4c20fec..6b8f2a1 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);
 }