Skip to content

Commit 7bf8df6

Browse files
committed
Merge tag 'drm-fixes-2020-03-27' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Pretty quiet: some minor sg mapping fixes for 3 drivers, and a single oops fix for the scheduler. I'm hoping nobody tries to send me a fixes pull today but I'll keep an eye out of the weekend. radeon/amdgpu/dma-buf: - sg list fixes scheduler: - oops fix" * tag 'drm-fixes-2020-03-27' of git://anongit.freedesktop.org/drm/drm: drm/scheduler: fix rare NULL ptr race drm/radeon: fix scatter-gather mapping with user pages drm/amdgpu: fix scatter-gather mapping with user pages drm/prime: use dma length macro when mapping sg
2 parents f3e6942 + c4b979e commit 7bf8df6

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ static int amdgpu_ttm_tt_pin_userptr(struct ttm_tt *ttm)
974974
/* Map SG to device */
975975
r = -ENOMEM;
976976
nents = dma_map_sg(adev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
977-
if (nents != ttm->sg->nents)
977+
if (nents == 0)
978978
goto release_sg;
979979

980980
/* convert SG to linear array of pages and dma addresses */

drivers/gpu/drm/drm_prime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **pages,
967967

968968
index = 0;
969969
for_each_sg(sgt->sgl, sg, sgt->nents, count) {
970-
len = sg->length;
970+
len = sg_dma_len(sg);
971971
page = sg_page(sg);
972972
addr = sg_dma_address(sg);
973973

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,

drivers/gpu/drm/scheduler/sched_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,9 @@ static void drm_sched_process_job(struct dma_fence *f, struct dma_fence_cb *cb)
661661

662662
trace_drm_sched_process_job(s_fence);
663663

664+
dma_fence_get(&s_fence->finished);
664665
drm_sched_fence_finished(s_fence);
666+
dma_fence_put(&s_fence->finished);
665667
wake_up_interruptible(&sched->wake_up_worker);
666668
}
667669

0 commit comments

Comments
 (0)