diff options
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index ac0d646a7b74..5d8b30fd4534 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
| @@ -3173,11 +3173,16 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev) | |||
| 3173 | break; | 3173 | break; |
| 3174 | 3174 | ||
| 3175 | if (fence) { | 3175 | if (fence) { |
| 3176 | r = dma_fence_wait_timeout(fence, false, tmo); | 3176 | tmo = dma_fence_wait_timeout(fence, false, tmo); |
| 3177 | dma_fence_put(fence); | 3177 | dma_fence_put(fence); |
| 3178 | fence = next; | 3178 | fence = next; |
| 3179 | if (r <= 0) | 3179 | if (tmo == 0) { |
| 3180 | r = -ETIMEDOUT; | ||
| 3180 | break; | 3181 | break; |
| 3182 | } else if (tmo < 0) { | ||
| 3183 | r = tmo; | ||
| 3184 | break; | ||
| 3185 | } | ||
| 3181 | } else { | 3186 | } else { |
| 3182 | fence = next; | 3187 | fence = next; |
| 3183 | } | 3188 | } |
| @@ -3188,8 +3193,8 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev) | |||
| 3188 | tmo = dma_fence_wait_timeout(fence, false, tmo); | 3193 | tmo = dma_fence_wait_timeout(fence, false, tmo); |
| 3189 | dma_fence_put(fence); | 3194 | dma_fence_put(fence); |
| 3190 | 3195 | ||
| 3191 | if (r <= 0 || tmo <= 0) { | 3196 | if (r < 0 || tmo <= 0) { |
| 3192 | DRM_ERROR("recover vram bo from shadow failed\n"); | 3197 | DRM_ERROR("recover vram bo from shadow failed, r is %ld, tmo is %ld\n", r, tmo); |
| 3193 | return -EIO; | 3198 | return -EIO; |
| 3194 | } | 3199 | } |
| 3195 | 3200 | ||
