aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
diff options
context:
space:
mode:
authorxinhui pan <xinhui.pan@amd.com>2019-06-14 16:06:10 +0800
committerAlex Deucher <alexander.deucher@amd.com>2019-06-20 11:32:10 -0500
commitacb05f0a3f6261b330034e14e4d2c6b4bc896504 (patch)
tree3c13e3c8e664894858ade56b82f7e8d36f3c1d02 /drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
parentdrm/amdgpu: wait to fetch the vbios until after common init (diff)
downloadlinux-dev-acb05f0a3f6261b330034e14e4d2c6b4bc896504.tar.xz
linux-dev-acb05f0a3f6261b330034e14e4d2c6b4bc896504.zip
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> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c13
1 files 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;