Skip to contentSkip to conversation

drm/amdgpu: adjust ip block add sequence on aldebaran

PATCH In review Stanley.Yang 2 participants 3 messages Nov 29, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: adjust ip block add sequence on aldebaran

Reason:

{
    [  578.019986] amdgpu 0000:23:00.0: amdgpu: GPU reset begin!
    [  583.245566] amdgpu 0000:23:00.0: amdgpu: Failed to disable smu features.
    [  583.245621] amdgpu 0000:23:00.0: amdgpu: Fail to disable dpm features!
    [  583.245639] [drm:amdgpu_device_ip_suspend_phase2 [amdgpu]] *ERROR* suspend of IP block <smu> failed -62
    [  583.248504] [drm] free PSP TMR buffer
}

Adjust ip block suspend sequence on aldebaran, it can fix disable smu feature failure.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +7 -3
index 4e3669407518..dc1d88a31f91 100644
@@ -1309,7 +1309,9 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
 		}
 	}
 
-	if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)) {
+	/* move add smu block after add smda block for aldebaran */
+	if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) &&
+			(adev->ip_versions[MP1_HWIP][0] != IP_VERSION(13, 0 ,2))) {
 		r = amdgpu_discovery_set_smu_ip_blocks(adev);
 		if (r)
 			return r;
@@ -1327,8 +1329,10 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
 	if (r)
 		return r;
 
-	if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT &&
-	    !amdgpu_sriov_vf(adev)) {
+	if ((adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT &&
+	    !amdgpu_sriov_vf(adev)) ||
+		((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0 ,2)) &&
+		 likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP))) {
 		r = amdgpu_discovery_set_smu_ip_blocks(adev);
 		if (r)
 			return r;
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only]

Please fix a typo in code comments smda->sdma. And double check the code alignment before commit.

V2 is

Regards,
Hawking
-----Original Message-----
From: Stanley.Yang <[email protected]>
Sent: Monday, November 29, 2021 14:27
To: [email protected]; Zhang, Hawking <[email protected]>; Clements, John <[email protected]>; Zhou1, Tao <[email protected]>
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH Review 1/1] drm/amdgpu: adjust ip block add sequence on aldebaran

Reason:

{
    [  578.019986] amdgpu 0000:23:00.0: amdgpu: GPU reset begin!
    [  583.245566] amdgpu 0000:23:00.0: amdgpu: Failed to disable smu features.
    [  583.245621] amdgpu 0000:23:00.0: amdgpu: Fail to disable dpm features!
    [  583.245639] [drm:amdgpu_device_ip_suspend_phase2 [amdgpu]] *ERROR* suspend of IP block <smu> failed -62
    [  583.248504] [drm] free PSP TMR buffer } Adjust ip block suspend sequence on aldebaran, it can fix disable smu feature failure.
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +7 -3
index 4e3669407518..dc1d88a31f91 100644
@@ -1309,7 +1309,9 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
 		}
 	}
 
-	if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)) {
+	/* move add smu block after add smda block for aldebaran */
+	if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) &&
+			(adev->ip_versions[MP1_HWIP][0] != IP_VERSION(13, 0 ,2))) {
 		r = amdgpu_discovery_set_smu_ip_blocks(adev);
 		if (r)
 			return r;
@@ -1327,8 +1329,10 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
 	if (r)
 		return r;
 
-	if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT &&
-	    !amdgpu_sriov_vf(adev)) {
+	if ((adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT &&
+	    !amdgpu_sriov_vf(adev)) ||
+		((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0 ,2)) &&
+		 likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP))) {
 		r = amdgpu_discovery_set_smu_ip_blocks(adev);
 		if (r)
 			return r;

--
2.17.1

#2 lore raw

[AMD Official Use Only]

Thanks, will update before submit.

Regards,
Stanley

Quoted 84 lines

-----邮件原件-----
发件人: Zhang, Hawking <[email protected]>
发送时间: Monday, November 29, 2021 2:36 PM
收件人: Yang, Stanley <[email protected]>; amd- [email protected]; Clements, John <[email protected]>; Zhou1, Tao <[email protected]>
抄送: Yang, Stanley <[email protected]>
主题: RE: [PATCH Review 1/1] drm/amdgpu: adjust ip block add sequence on aldebaran

[AMD Official Use Only]

Please fix a typo in code comments smda->sdma. And double check the code alignment before commit.

V2 is

Regards,
Hawking
-----Original Message-----
From: Stanley.Yang <[email protected]>
Sent: Monday, November 29, 2021 14:27
To: [email protected]; Zhang, Hawking <[email protected]>; Clements, John <[email protected]>; Zhou1, Tao <[email protected]>
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH Review 1/1] drm/amdgpu: adjust ip block add sequence on aldebaran

Reason:

{
    [  578.019986] amdgpu 0000:23:00.0: amdgpu: GPU reset begin!
    [  583.245566] amdgpu 0000:23:00.0: amdgpu: Failed to disable smu
features.
    [  583.245621] amdgpu 0000:23:00.0: amdgpu: Fail to disable dpm features!
    [  583.245639] [drm:amdgpu_device_ip_suspend_phase2 [amdgpu]]
*ERROR* suspend of IP block <smu> failed -62
    [  583.248504] [drm] free PSP TMR buffer } Adjust ip block suspend

sequence on aldebaran, it can fix disable smu feature failure.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +2 -1
index 4e3669407518..dc1d88a31f91 100644
@@ -1309,7 +1309,9 @@ int amdgpu_discovery_set_ip_blocks(struct
 amdgpu_device *adev)
 		}
 	}
 
-	if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)) {
+	/* move add smu block after add smda block for aldebaran */
+	if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)

&&

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -0
+			(adev->ip_versions[MP1_HWIP][0] !=

IP_VERSION(13, 0 ,2))) {

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +3 -2
 		r = amdgpu_discovery_set_smu_ip_blocks(adev);
 		if (r)
 			return r;
@@ -1327,8 +1329,10 @@ int amdgpu_discovery_set_ip_blocks(struct
 amdgpu_device *adev)
 	if (r)
 		return r;
 
-	if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT &&
-	    !amdgpu_sriov_vf(adev)) {
+	if ((adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT &&
+	    !amdgpu_sriov_vf(adev)) ||
+		((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0 ,2))

&&

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -0
+		 likely(adev->firmware.load_type ==

AMDGPU_FW_LOAD_PSP))) {

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +0 -1
 		r = amdgpu_discovery_set_smu_ip_blocks(adev);
 		if (r)
 			return r;
--

2.17.1