Commit 85dfc1d6 authored by Jingwen Chen's avatar Jingwen Chen Committed by Alex Deucher
Browse files

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: default avatarJingwen Chen <Jingwen.Chen2@amd.com>
Reviewed-by: default avatarHorace Chen <horace.chen@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 91e16017
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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