Commit acb05f0a authored by xinhui pan's avatar xinhui pan Committed by Alex Deucher

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: default avatarxinhui pan <xinhui.pan@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 21a249ca
...@@ -333,11 +333,12 @@ static ssize_t amdgpu_ras_debugfs_ctrl_write(struct file *f, const char __user * ...@@ -333,11 +333,12 @@ static ssize_t amdgpu_ras_debugfs_ctrl_write(struct file *f, const char __user *
case 2: case 2:
ret = amdgpu_ras_reserve_vram(adev, ret = amdgpu_ras_reserve_vram(adev,
data.inject.address, PAGE_SIZE, &bo); data.inject.address, PAGE_SIZE, &bo);
/* This address might be used already on failure. In fact we can if (ret) {
* perform an injection in such case. /* address was offset, now it is absolute.*/
*/ data.inject.address += adev->gmc.vram_start;
if (ret) if (data.inject.address > adev->gmc.vram_end)
break; break;
} else
data.inject.address = amdgpu_bo_gpu_offset(bo); data.inject.address = amdgpu_bo_gpu_offset(bo);
ret = amdgpu_ras_error_inject(adev, &data.inject); ret = amdgpu_ras_error_inject(adev, &data.inject);
amdgpu_ras_release_vram(adev, &bo); amdgpu_ras_release_vram(adev, &bo);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment