Skip to content

Commit

Permalink
nouveau: fw: sync dma after setup is called.
Browse files Browse the repository at this point in the history
commit 21ec425eaf2cb7c0371f7683f81ad7d9679b6eb5 upstream.

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]>
Reviewed-by: Lyude Paul <[email protected]>
Fixes: 9b340aeb26d5 ("nouveau/firmware: use dma non-coherent allocator")
Cc: [email protected]
Signed-off-by: Dave Airlie <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
(cherry picked from commit 16abd7ce81e4fedd058035d4644b3882af16732d)
  • Loading branch information
airlied authored and opsiff committed Nov 23, 2024
1 parent b7d6fbd commit 620ba18
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/gpu/drm/nouveau/nvkm/falcon/fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 620ba18

Please sign in to comment.