diff mbox

[4/4] drm/radeon: fix userptr return value checking

Message ID 1430147077-5116-4-git-send-email-deathsimple@vodafone.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christian König April 27, 2015, 3:04 p.m. UTC
From: Christian König <christian.koenig@amd.com>

Otherwise we print false warning from time to time.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
CC: stable@vger.kernel.org
---
 drivers/gpu/drm/radeon/radeon_mn.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Alex Deucher April 27, 2015, 4:06 p.m. UTC | #1
On Mon, Apr 27, 2015 at 11:04 AM, Christian König
<deathsimple@vodafone.de> wrote:
> From: Christian König <christian.koenig@amd.com>
>
> Otherwise we print false warning from time to time.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
> CC: stable@vger.kernel.org

Applied the series to my 4.1 fixes tree.  I had to make minor changes
to 4/4 so that it would apply:
http://cgit.freedesktop.org/~agd5f/linux/log/?h=drm-fixes-4.1-wip

Alex


> ---
>  drivers/gpu/drm/radeon/radeon_mn.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_mn.c b/drivers/gpu/drm/radeon/radeon_mn.c
> index 572b4db..30e6207 100644
> --- a/drivers/gpu/drm/radeon/radeon_mn.c
> +++ b/drivers/gpu/drm/radeon/radeon_mn.c
> @@ -122,26 +122,26 @@ static void radeon_mn_invalidate_range_start(struct mmu_notifier *mn,
>         it = interval_tree_iter_first(&rmn->objects, start, end);
>         while (it) {
>                 struct radeon_bo *bo;
> -               int r;
> +               long r;
>
>                 bo = container_of(it, struct radeon_bo, mn_it);
>                 it = interval_tree_iter_next(it, start, end);
>
>                 r = radeon_bo_reserve(bo, true);
>                 if (r) {
> -                       DRM_ERROR("(%d) failed to reserve user bo\n", r);
> +                       DRM_ERROR("(%ld) failed to reserve user bo\n", r);
>                         continue;
>                 }
>
>                 r = reservation_object_wait_timeout_rcu(bo->tbo.resv, true,
>                         false, MAX_SCHEDULE_TIMEOUT);
> -               if (r)
> -                       DRM_ERROR("(%d) failed to wait for user bo\n", r);
> +               if (r <= 0)
> +                       DRM_ERROR("(%ld) failed to wait for user bo\n", r);
>
>                 radeon_ttm_placement_from_domain(bo, RADEON_GEM_DOMAIN_CPU);
>                 r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false);
>                 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);
>         }
> --
> 1.9.1
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_mn.c b/drivers/gpu/drm/radeon/radeon_mn.c
index 572b4db..30e6207 100644
--- a/drivers/gpu/drm/radeon/radeon_mn.c
+++ b/drivers/gpu/drm/radeon/radeon_mn.c
@@ -122,26 +122,26 @@  static void radeon_mn_invalidate_range_start(struct mmu_notifier *mn,
 	it = interval_tree_iter_first(&rmn->objects, start, end);
 	while (it) {
 		struct radeon_bo *bo;
-		int r;
+		long r;
 
 		bo = container_of(it, struct radeon_bo, mn_it);
 		it = interval_tree_iter_next(it, start, end);
 
 		r = radeon_bo_reserve(bo, true);
 		if (r) {
-			DRM_ERROR("(%d) failed to reserve user bo\n", r);
+			DRM_ERROR("(%ld) failed to reserve user bo\n", r);
 			continue;
 		}
 
 		r = reservation_object_wait_timeout_rcu(bo->tbo.resv, true,
 			false, MAX_SCHEDULE_TIMEOUT);
-		if (r)
-			DRM_ERROR("(%d) failed to wait for user bo\n", r);
+		if (r <= 0)
+			DRM_ERROR("(%ld) failed to wait for user bo\n", r);
 
 		radeon_ttm_placement_from_domain(bo, RADEON_GEM_DOMAIN_CPU);
 		r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false);
 		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);
 	}