nvkm_firmware_mem_target currently uses the noncoherent aperture for all Tegra devices. On a DMA-coherent device the CPU can cache writes to the firmware image, and the DMA API does not clean those writes to memory. The GPU needs to use the coherent aperture to observe them.
Use the Tegra device's cpu_coherent flag to select the firmware aperture. PCI devices continue to use NVKM_MEM_TARGET_HOST. Signed-off-by: Mikko Perttunen <[email protected]> --- drivers/gpu/drm/nouveau/nvkm/core/firmware.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c index 0af01a0ec601..c9ed08c19fa5 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c @@ -169,7 +169,9 @@ nvkm_firmware_mem_page(struct nvkm_memory *memory) static enum nvkm_memory_target nvkm_firmware_mem_target(struct nvkm_memory *memory) { - if (nvkm_firmware_mem(memory)->device->func->tegra) + struct nvkm_device *device = nvkm_firmware_mem(memory)->device; + + if (device->func->tegra && !device->cpu_coherent) return NVKM_MEM_TARGET_NCOH; return NVKM_MEM_TARGET_HOST; -- 2.56.1
