summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
diff options
context:
space:
mode:
authorJingwen Chen <Jingwen.Chen2@amd.com>2021-12-14 11:50:39 +0800
committerAlex Deucher <alexander.deucher@amd.com>2021-12-14 16:10:00 -0500
commit948e7ce01413b71395723aaf846015062aea3a43 (patch)
treef8e5fbde1b28f1d3b9eb194eb198afc29d373d77 /drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
parent85dfc1d692c9434c37842e610be37cd4ae4e0081 (diff)
downloadlinux-948e7ce01413b71395723aaf846015062aea3a43.tar.bz2
drm/amd/amdgpu: fix gmc bo pin count leak in SRIOV
[Why] gmc bo will be pinned during loading amdgpu and reset in SRIOV while only unpinned in unload amdgpu [How] add amdgpu_in_reset and sriov judgement to skip pin bo v2: fix wrong judgement Signed-off-by: Jingwen Chen <Jingwen.Chen2@amd.com> Reviewed-by: Horace Chen <horace.chen@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index c7492db3e189..a5471923b3f6 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -1717,10 +1717,14 @@ static int gmc_v9_0_gart_enable(struct amdgpu_device *adev)
return -EINVAL;
}
+ if (amdgpu_sriov_vf(adev) && amdgpu_in_reset(adev))
+ goto skip_pin_bo;
+
r = amdgpu_gart_table_vram_pin(adev);
if (r)
return r;
+skip_pin_bo:
r = adev->gfxhub.funcs->gart_enable(adev);
if (r)
return r;