Skip to contentSkip to conversation

instmem/gk20a: add write barrier when releasing DMA object

PATCH New Alexandre Courbot 1 participant 1 message Mar 3, 2016 Arm STM32

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 instmem/gk20a: add write barrier when releasing DMA object

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.

---
 drm/nouveau/nvkm/subdev/instmem/gk20a.c | 2 ++
 1 file changed, 2 insertions(+)
drm/nouveau/nvkm/subdev/instmem/gk20a.c +2 -0
index 4c20fec64d96..6b8f2a19b2d9 100644
@@ -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);
 }
 
Signature · 6 lines
2.7.2

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau