aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2116-drm-amdgpu-Do-error-injection-even-vram-reserve-fail.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2116-drm-amdgpu-Do-error-injection-even-vram-reserve-fail.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2116-drm-amdgpu-Do-error-injection-even-vram-reserve-fail.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2116-drm-amdgpu-Do-error-injection-even-vram-reserve-fail.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2116-drm-amdgpu-Do-error-injection-even-vram-reserve-fail.patch
new file mode 100644
index 00000000..af9e95f6
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2116-drm-amdgpu-Do-error-injection-even-vram-reserve-fail.patch
@@ -0,0 +1,42 @@
+From 85d2a6d3f5169ac71bbb3734ea327f426e6a2435 Mon Sep 17 00:00:00 2001
+From: xinhui pan <xinhui.pan@amd.com>
+Date: Fri, 14 Jun 2019 16:06:10 +0800
+Subject: [PATCH 2116/2940] drm/amdgpu: Do error injection even vram reserve
+ fails
+
+As long as the address is mapped with vram, we can do an error
+injection.
+
+Signed-off-by: xinhui pan <xinhui.pan@amd.com>
+Acked-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+index 7efc4e07665d..614116c7036a 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+@@ -333,12 +333,13 @@ static ssize_t amdgpu_ras_debugfs_ctrl_write(struct file *f, const char __user *
+ case 2:
+ ret = amdgpu_ras_reserve_vram(adev,
+ data.inject.address, PAGE_SIZE, &bo);
+- /* This address might be used already on failure. In fact we can
+- * perform an injection in such case.
+- */
+- if (ret)
+- break;
+- data.inject.address = amdgpu_bo_gpu_offset(bo);
++ if (ret) {
++ /* address was offset, now it is absolute.*/
++ data.inject.address += adev->gmc.vram_start;
++ if (data.inject.address > adev->gmc.vram_end)
++ break;
++ } else
++ data.inject.address = amdgpu_bo_gpu_offset(bo);
+ ret = amdgpu_ras_error_inject(adev, &data.inject);
+ amdgpu_ras_release_vram(adev, &bo);
+ break;
+--
+2.17.1
+