diff options
author | Jingwen Chen <Jingwen.Chen2@amd.com> | 2021-12-14 11:31:16 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-12-14 16:09:49 -0500 |
commit | 85dfc1d692c9434c37842e610be37cd4ae4e0081 (patch) | |
tree | 0aad423309e304ad3faa2fd4fcbc54819039ef4b /drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | |
parent | 91e16017b6d36c2b7358654ccce9f69b2448df20 (diff) | |
download | linux-85dfc1d692c9434c37842e610be37cd4ae4e0081.tar.bz2 |
drm/amd/amdgpu: fix psp tmr bo pin count leak in SRIOV
[Why]
psp tmr 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/amdgpu_psp.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 103bcadbc8b8..dee17a0e1187 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -2017,12 +2017,16 @@ static int psp_hw_start(struct psp_context *psp) return ret; } + if (amdgpu_sriov_vf(adev) && amdgpu_in_reset(adev)) + goto skip_pin_bo; + ret = psp_tmr_init(psp); if (ret) { DRM_ERROR("PSP tmr init failed!\n"); return ret; } +skip_pin_bo: /* * For ASICs with DF Cstate management centralized * to PMFW, TMR setup should be performed after PMFW |