diff options
author | monk.liu <monk.liu@amd.com> | 2015-08-12 17:56:52 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-08-17 16:51:18 -0400 |
commit | a8f5bf0b220c28b1b600a5ff3cae0b53c5c2079b (patch) | |
tree | 3c28ba201e8292a315029ed229128679d2da5825 /drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c | |
parent | 281b42230175608dec0cd8dab9908250e7aa36a9 (diff) | |
download | blackbird-op-linux-a8f5bf0b220c28b1b600a5ff3cae0b53c5c2079b.tar.gz blackbird-op-linux-a8f5bf0b220c28b1b600a5ff3cae0b53c5c2079b.zip |
drm/amdgpu: fix type mismatch error
remaining timeout returned by amdgpu_fence_wait_any can be larger than
max int value, thus the truncated 32 bit value in r ends up being
negative while its original long value is positive.
Signed-off-by: monk.liu <monk.liu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <jammy.zhou@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c index c5b17262529d..d6398cf45f24 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c @@ -318,6 +318,7 @@ int amdgpu_sa_bo_new(struct amdgpu_device *adev, struct amdgpu_fence *fences[AMDGPU_MAX_RINGS]; unsigned tries[AMDGPU_MAX_RINGS]; int i, r; + signed long t; BUG_ON(align > sa_manager->align); BUG_ON(size > sa_manager->size); @@ -351,8 +352,8 @@ int amdgpu_sa_bo_new(struct amdgpu_device *adev, } while (amdgpu_sa_bo_next_hole(sa_manager, fences, tries)); spin_unlock(&sa_manager->wq.lock); - r = amdgpu_fence_wait_any(adev, fences, false, MAX_SCHEDULE_TIMEOUT); - r = (r > 0) ? 0 : r; + t = amdgpu_fence_wait_any(adev, fences, false, MAX_SCHEDULE_TIMEOUT); + r = (t > 0) ? 0 : t; spin_lock(&sa_manager->wq.lock); /* if we have nothing to wait for block */ if (r == -ENOENT) { |