Skip to content

Commit 6c032c3

Browse files
Lin.Caoalexdeucher
authored andcommitted
drm/amdgpu: Fix vram recover doesn't work after whole GPU reset (v2)
v1: Vmbo->shadow is used to back vram bo up when vram lost. So that we should set shadow as vmbo->shadow to recover vmbo->bo v2: Modify if(vmbo->shadow) shadow = vmbo->shadow as if(!vmbo->shadow) continue; Fixes: e18aaea ("drm/amdgpu: move shadow_list to amdgpu_bo_vm") Reviewed-by: Christian König <[email protected]> Signed-off-by: Lin.Cao <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent 720b472 commit 6c032c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4512,7 +4512,11 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev)
45124512
dev_info(adev->dev, "recover vram bo from shadow start\n");
45134513
mutex_lock(&adev->shadow_list_lock);
45144514
list_for_each_entry(vmbo, &adev->shadow_list, shadow_list) {
4515-
shadow = &vmbo->bo;
4515+
/* If vm is compute context or adev is APU, shadow will be NULL */
4516+
if (!vmbo->shadow)
4517+
continue;
4518+
shadow = vmbo->shadow;
4519+
45164520
/* No need to recover an evicted BO */
45174521
if (shadow->tbo.resource->mem_type != TTM_PL_TT ||
45184522
shadow->tbo.resource->start == AMDGPU_BO_INVALID_OFFSET ||

0 commit comments

Comments
 (0)