diff options
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/1728-amdgpu_device_recover_vram-always-failed-if-only-one.patch')
-rw-r--r-- | common/recipes-kernel/linux/linux-yocto-4.19.8/1728-amdgpu_device_recover_vram-always-failed-if-only-one.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/1728-amdgpu_device_recover_vram-always-failed-if-only-one.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/1728-amdgpu_device_recover_vram-always-failed-if-only-one.patch new file mode 100644 index 00000000..1ae5da22 --- /dev/null +++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/1728-amdgpu_device_recover_vram-always-failed-if-only-one.patch @@ -0,0 +1,59 @@ +From fbb27998ecbec5f4f03990cdfc88176d67383b2d Mon Sep 17 00:00:00 2001 +From: wentalou <Wentao.Lou@amd.com> +Date: Tue, 2 Apr 2019 17:13:05 +0800 +Subject: [PATCH 1728/2940] amdgpu_device_recover_vram always failed if only + one node in shadow_list +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +amdgpu_bo_restore_shadow would assign zero to r if succeeded. +r would remain zero if there is only one node in shadow_list. +current code would always return failure when r <= 0. +restart the timeout for each wait was a rather problematic bug as well. +The value of tmo SHOULD be changed, otherwise we wait tmo jiffies on each loop. + +Change-Id: I7e836ec7ab6cd0f069aac24f88e454e906637541 +Signed-off-by: Wentao Lou <Wentao.Lou@amd.com> +Reviewed-by: Christian König <christian.koenig@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 13 +++++++++---- + 1 file 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 566b14f4c63f..20e2cc8d7a04 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +@@ -3240,11 +3240,16 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev) + break; + + if (fence) { +- r = dma_fence_wait_timeout(fence, false, tmo); ++ tmo = dma_fence_wait_timeout(fence, false, tmo); + dma_fence_put(fence); + fence = next; +- if (r <= 0) ++ if (tmo == 0) { ++ r = -ETIMEDOUT; + break; ++ } else if (tmo < 0) { ++ r = tmo; ++ break; ++ } + } else { + fence = next; + } +@@ -3255,8 +3260,8 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev) + tmo = dma_fence_wait_timeout(fence, false, tmo); + dma_fence_put(fence); + +- if (r <= 0 || tmo <= 0) { +- DRM_ERROR("recover vram bo from shadow failed\n"); ++ if (r < 0 || tmo <= 0) { ++ DRM_ERROR("recover vram bo from shadow failed, r is %ld, tmo is %ld\n", r, tmo); + return -EIO; + } + +-- +2.17.1 + |