Skip to contentSkip to conversation

amd/amdgpu/sriov tdr enablement with pp_onevf_mode

PATCH In review Jack Zhang 2 participants 2 messages Jan 2, 2020

Subsystems (2)
lore
Share & tools
lore

Jack Zhang

author
#0 lore raw

PATCH 2/2 amd/amdgpu/sriov tdr enablement with pp_onevf_mode

Under sriov and pp_onevf mode,
1.take resume instead of hw_init 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 bdd9502..f003e9a 100644
@@ -2462,7 +2462,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 fa17265..2e4a8d2 100644
@@ -1420,6 +1420,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);
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Acked-by on v1 2/2
#1 lore raw
Quoted 62 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Jack Zhang
Sent: Thursday, January 2, 2020 1:51 PM
To: [email protected]
Cc: Zhang, Jack (Jian) <[email protected]>
Subject: [PATCH 2/2] amd/amdgpu/sriov tdr enablement with pp_onevf_mode

Under sriov and pp_onevf mode,
1.take resume instead of hw_init 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 bdd9502..f003e9a 100644
@@ -2462,7 +2462,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");
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
 			if (r)
 				return r;
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +6 -1
index fa17265..2e4a8d2 100644
@@ -1420,6 +1420,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

Quoted 9 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.free
desktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7Cevan.quan%40amd.com%7C510c8150ee8c4c48b2 d808d78f47cc1e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637 135410904680615&amp;sdata=xmMYgHzXPQGykGDvTGvPrZX2W5yfOS3nOkNh AF%2FQYQY%3D&amp;reserved=0

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