diff options
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_mn.c | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_ttm.c | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_mn.c b/drivers/gpu/drm/radeon/radeon_mn.c index a69bd441dd2d..572b4dbec186 100644 --- a/drivers/gpu/drm/radeon/radeon_mn.c +++ b/drivers/gpu/drm/radeon/radeon_mn.c | |||
@@ -122,7 +122,6 @@ static void radeon_mn_invalidate_range_start(struct mmu_notifier *mn, | |||
122 | it = interval_tree_iter_first(&rmn->objects, start, end); | 122 | it = interval_tree_iter_first(&rmn->objects, start, end); |
123 | while (it) { | 123 | while (it) { |
124 | struct radeon_bo *bo; | 124 | struct radeon_bo *bo; |
125 | struct fence *fence; | ||
126 | int r; | 125 | int r; |
127 | 126 | ||
128 | bo = container_of(it, struct radeon_bo, mn_it); | 127 | bo = container_of(it, struct radeon_bo, mn_it); |
@@ -134,12 +133,10 @@ static void radeon_mn_invalidate_range_start(struct mmu_notifier *mn, | |||
134 | continue; | 133 | continue; |
135 | } | 134 | } |
136 | 135 | ||
137 | fence = reservation_object_get_excl(bo->tbo.resv); | 136 | r = reservation_object_wait_timeout_rcu(bo->tbo.resv, true, |
138 | if (fence) { | 137 | false, MAX_SCHEDULE_TIMEOUT); |
139 | r = radeon_fence_wait((struct radeon_fence *)fence, false); | 138 | if (r) |
140 | if (r) | 139 | DRM_ERROR("(%d) failed to wait for user bo\n", r); |
141 | DRM_ERROR("(%d) failed to wait for user bo\n", r); | ||
142 | } | ||
143 | 140 | ||
144 | radeon_ttm_placement_from_domain(bo, RADEON_GEM_DOMAIN_CPU); | 141 | radeon_ttm_placement_from_domain(bo, RADEON_GEM_DOMAIN_CPU); |
145 | r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false); | 142 | r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false); |
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index d02aa1d0f588..b292aca0f342 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c | |||
@@ -598,6 +598,10 @@ static void radeon_ttm_tt_unpin_userptr(struct ttm_tt *ttm) | |||
598 | enum dma_data_direction direction = write ? | 598 | enum dma_data_direction direction = write ? |
599 | DMA_BIDIRECTIONAL : DMA_TO_DEVICE; | 599 | DMA_BIDIRECTIONAL : DMA_TO_DEVICE; |
600 | 600 | ||
601 | /* double check that we don't free the table twice */ | ||
602 | if (!ttm->sg->sgl) | ||
603 | return; | ||
604 | |||
601 | /* free the sg table and pages again */ | 605 | /* free the sg table and pages again */ |
602 | dma_unmap_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction); | 606 | dma_unmap_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction); |
603 | 607 | ||