nouveau: fw: sync dma after setup is called.
Subsystems (3)
Dave Airlie
maintainerPATCH 1/1 nouveau: fw: sync dma after setup is called.
From: Dave Airlie <[email protected]>
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 <[email protected]>
Tested-by Diogo Ivo <[email protected]>
Fixes 9b340aeb26d5 ("nouveau/firmware: use dma non-coherent allocator")
Signed-off-by Dave Airlie <[email protected]>
--- drivers/gpu/drm/nouveau/nvkm/falcon/fw.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/nouveau/nvkm/falcon/fw.c +6 -5
@@ -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;
Signature · 1 line
2.47.0
Quoted 11 lines · Dave Airlie
From: Dave Airlie <[email protected]>
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 <[email protected]>Tested-by Diogo Ivo <[email protected]>Fixes 9b340aeb26d5 ("nouveau/firmware: use dma non-coherent allocator")Signed-off-by Dave Airlie <[email protected]>
Reviewed-by Ben Skeggs <[email protected]>
Quoted 33 lines
--- drivers/gpu/drm/nouveau/nvkm/falcon/fw.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)drivers/gpu/drm/nouveau/nvkm/falcon/fw.c +6
-5@@ -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;
Danilo Krummrich
maintainerQuoted 7 lines · Dave Airlie
From: Dave Airlie <[email protected]>
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 <[email protected]>
Do you have a link of where this issue has been reported?
Quoted 37 lines
Tested-by Diogo Ivo <[email protected]>Fixes 9b340aeb26d5 ("nouveau/firmware: use dma non-coherent allocator")Signed-off-by Dave Airlie <[email protected]>--- drivers/gpu/drm/nouveau/nvkm/falcon/fw.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)drivers/gpu/drm/nouveau/nvkm/falcon/fw.c +6
-5@@ -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;