Commit 9fb2bcf9 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/radeon: fix userptr return value checking (v2)

Otherwise we print false warning from time to time.

v2: agd5f: rebase
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarJack Xiao <Jack.Xiao@amd.com>
CC: stable@vger.kernel.org
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c29c0876
...@@ -135,7 +135,7 @@ static void radeon_mn_invalidate_range_start(struct mmu_notifier *mn, ...@@ -135,7 +135,7 @@ static void radeon_mn_invalidate_range_start(struct mmu_notifier *mn,
while (it) { while (it) {
struct radeon_mn_node *node; struct radeon_mn_node *node;
struct radeon_bo *bo; struct radeon_bo *bo;
int r; long r;
node = container_of(it, struct radeon_mn_node, it); node = container_of(it, struct radeon_mn_node, it);
it = interval_tree_iter_next(it, start, end); it = interval_tree_iter_next(it, start, end);
...@@ -144,19 +144,19 @@ static void radeon_mn_invalidate_range_start(struct mmu_notifier *mn, ...@@ -144,19 +144,19 @@ static void radeon_mn_invalidate_range_start(struct mmu_notifier *mn,
r = radeon_bo_reserve(bo, true); r = radeon_bo_reserve(bo, true);
if (r) { if (r) {
DRM_ERROR("(%d) failed to reserve user bo\n", r); DRM_ERROR("(%ld) failed to reserve user bo\n", r);
continue; continue;
} }
r = reservation_object_wait_timeout_rcu(bo->tbo.resv, r = reservation_object_wait_timeout_rcu(bo->tbo.resv,
true, false, MAX_SCHEDULE_TIMEOUT); true, false, MAX_SCHEDULE_TIMEOUT);
if (r) if (r <= 0)
DRM_ERROR("(%d) failed to wait for user bo\n", r); DRM_ERROR("(%ld) failed to wait for user bo\n", r);
radeon_ttm_placement_from_domain(bo, RADEON_GEM_DOMAIN_CPU); radeon_ttm_placement_from_domain(bo, RADEON_GEM_DOMAIN_CPU);
r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false); r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false);
if (r) if (r)
DRM_ERROR("(%d) failed to validate user bo\n", r); DRM_ERROR("(%ld) failed to validate user bo\n", r);
radeon_bo_unreserve(bo); radeon_bo_unreserve(bo);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment