mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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: e18aaea733
("drm/amdgpu: move shadow_list to amdgpu_bo_vm")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Lin.Cao <lincao12@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
This commit is contained in:
parent
720b47229a
commit
6c032c37ac
1 changed files with 5 additions and 1 deletions
|
@ -4512,7 +4512,11 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev)
|
||||||
dev_info(adev->dev, "recover vram bo from shadow start\n");
|
dev_info(adev->dev, "recover vram bo from shadow start\n");
|
||||||
mutex_lock(&adev->shadow_list_lock);
|
mutex_lock(&adev->shadow_list_lock);
|
||||||
list_for_each_entry(vmbo, &adev->shadow_list, shadow_list) {
|
list_for_each_entry(vmbo, &adev->shadow_list, shadow_list) {
|
||||||
shadow = &vmbo->bo;
|
/* If vm is compute context or adev is APU, shadow will be NULL */
|
||||||
|
if (!vmbo->shadow)
|
||||||
|
continue;
|
||||||
|
shadow = vmbo->shadow;
|
||||||
|
|
||||||
/* No need to recover an evicted BO */
|
/* No need to recover an evicted BO */
|
||||||
if (shadow->tbo.resource->mem_type != TTM_PL_TT ||
|
if (shadow->tbo.resource->mem_type != TTM_PL_TT ||
|
||||||
shadow->tbo.resource->start == AMDGPU_BO_INVALID_OFFSET ||
|
shadow->tbo.resource->start == AMDGPU_BO_INVALID_OFFSET ||
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue