Skip to content

Commit 47f7826

Browse files
BuzzBumbleBeealexdeucher
authored andcommitted
drm/radeon: fix scatter-gather mapping with user pages
Calls to dma_map_sg may return less segments / entries than requested if they fall on page bounderies. The old implementation did not support this use case. Fixes: be62dbf ("iommu/amd: Convert AMD iommu driver to the dma-iommu api") Bug: https://bugzilla.kernel.org/show_bug.cgi?id=206461 Bug: https://bugzilla.kernel.org/show_bug.cgi?id=206895 Bug: https://gitlab.freedesktop.org/drm/amd/issues/1056 Signed-off-by: Shane Francis <[email protected]> Reviewed-by: Michael J. Ruhl <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Cc: [email protected]
1 parent 0199172 commit 47f7826

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/radeon/radeon_ttm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ static int radeon_ttm_tt_pin_userptr(struct ttm_tt *ttm)
528528

529529
r = -ENOMEM;
530530
nents = dma_map_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
531-
if (nents != ttm->sg->nents)
531+
if (nents == 0)
532532
goto release_sg;
533533

534534
drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,

0 commit comments

Comments
 (0)