]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
nouveau: fw: sync dma after setup is called.
authorDave Airlie <airlied@redhat.com>
Tue, 12 Nov 2024 19:57:03 +0000 (05:57 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 14 Nov 2024 01:50:01 +0000 (11:50 +1000)
When this code moved to non-coherent allocator the sync was put too
early for some firmwares which called the setup function, move the
sync down after the setup function.

Reported-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
Tested-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Fixes: 9b340aeb26d5 ("nouveau/firmware: use dma non-coherent allocator")
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241114004603.3095485-1-airlied@gmail.com
drivers/gpu/drm/nouveau/nvkm/falcon/fw.c

index a1c8545f1249a1ac669ea95b1dfe2afc4dd5a8eb..cac6d64ab67d1ded596f6690b5e0ce58239b2bab 100644 (file)
@@ -89,11 +89,6 @@ nvkm_falcon_fw_boot(struct nvkm_falcon_fw *fw, struct nvkm_subdev *user,
                nvkm_falcon_fw_dtor_sigs(fw);
        }
 
-       /* after last write to the img, sync dma mappings */
-       dma_sync_single_for_device(fw->fw.device->dev,
-                                  fw->fw.phys,
-                                  sg_dma_len(&fw->fw.mem.sgl),
-                                  DMA_TO_DEVICE);
 
        FLCNFW_DBG(fw, "resetting");
        fw->func->reset(fw);
@@ -105,6 +100,12 @@ nvkm_falcon_fw_boot(struct nvkm_falcon_fw *fw, struct nvkm_subdev *user,
                        goto done;
        }
 
+       /* after last write to the img, sync dma mappings */
+       dma_sync_single_for_device(fw->fw.device->dev,
+                                  fw->fw.phys,
+                                  sg_dma_len(&fw->fw.mem.sgl),
+                                  DMA_TO_DEVICE);
+
        ret = fw->func->load(fw);
        if (ret)
                goto done;