Skip to contentSkip to conversation

amd/amdgpu/sriov use resume for smc recover under sriov

PATCH Zhang, Jack (Jian) 1 participant 1 message Dec 27, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

-----Original Message-----
From: Jack Zhang <[email protected]>
Sent: Friday, December 27, 2019 2:57 PM
To: [email protected]
Cc: Zhang, Jack (Jian) <[email protected]>
Subject: [PATCH 2/2] amd/amdgpu/sriov use resume for smc recover under sriov

Under sriov and pp_onevf mode,
1.take resume function for smc recover to avoid potential memory leak.

2.add return condition inside smc resume function for sriov_pp_onevf_mode and pm_enabled param.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++++-  drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 6 ++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -1
index 6a4b142..547fa3e 100644
@@ -2458,7 +2458,11 @@ static int amdgpu_device_ip_reinit_late_sriov(struct amdgpu_device *adev)
 				block->status.hw)
 				continue;
 
-			r = block->version->funcs->hw_init(adev);
+			if (block->version->type == AMD_IP_BLOCK_TYPE_SMC)
+				r = block->version->funcs->resume(adev);
+			else
+				r = block->version->funcs->hw_init(adev);
+
 			DRM_INFO("RE-INIT-late: %s %s\n", block->version->funcs->name, r?"failed":"succeeded");
 			if (r)
 				return r;
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +6 -0
index 42c0a6d..7cad358 100644
@@ -1416,6 +1416,12 @@ static int smu_resume(void *handle)
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 	struct smu_context *smu = &adev->smu;
 
+	if (amdgpu_sriov_vf(adev)&& !amdgpu_sriov_is_pp_one_vf(adev))
+		return 0;
+
+	if (!smu->pm_enabled)
+		return 0;
+
 	pr_info("SMU is resuming...\n");
 
 	ret = smu_start_smc_engine(smu);

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx