Skip to contentSkip to conversation

drm/amd/pm: skip to set mp1 unload state in special case

PATCH In review Yang Wang 2 participants 2 messages Jun 10, 2022

Subsystems (3)
lore
Share & tools
lore

Yang Wang

author
#0 lore raw

PATCH 1/1 drm/amd/pm: skip to set mp1 unload state in special case

set mp1 unload state will cause the SMC FW can't accept any SMU message, skip to set mp1 unload state to avoid following case fail:
- runtime pm case.
- gpu reset case.

Fixes 826126d8f805 ("drm/amd/pm: fix driver reload SMC firmware fail issue for smu13")
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +6 -5
index 3d269d1c2749..fd79b213fab4 100644
@@ -1415,12 +1415,13 @@ static int smu_disable_dpms(struct smu_context *smu)
 	switch (adev->ip_versions[MP1_HWIP][0]) {
 	case IP_VERSION(13, 0, 0):
 	case IP_VERSION(13, 0, 7):
-		ret = smu_set_mp1_state(smu, PP_MP1_STATE_UNLOAD);
-		if (ret) {
-			dev_err(adev->dev, "Fail set mp1 state to UNLOAD!\n");
-			return ret;
+		if (!(adev->in_runpm || amdgpu_in_reset(adev))) {
+			ret = smu_set_mp1_state(smu, PP_MP1_STATE_UNLOAD);
+			if (ret) {
+				dev_err(adev->dev, "Fail set mp1 state to UNLOAD!\n");
+				return ret;
+			}
 		}
-
 		return 0;
 	default:
 		break;
Signature · 1 line
2.25.1
maintainer Reviewed-by Kenneth Feng on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

[AMD Official Use Only - General]

Best wishes
Kenneth Feng

发件人: amd-gfx <[email protected]> 代表 Yang Wang <[email protected]> 日期: 星期五, 2022年6月10日 11:52
收件人: [email protected] <[email protected]>
抄送: Feng, Kenneth <[email protected]>, Wang, Yang(Kevin) <[email protected]> 主题: [PATCH] drm/amd/pm: skip to set mp1 unload state in special case [CAUTION: External Email]

set mp1 unload state will cause the SMC FW can't accept any SMU message, skip to set mp1 unload state to avoid following case fail:
- runtime pm case.
- gpu reset case.

Fixes 826126d8f805 ("drm/amd/pm: fix driver reload SMC firmware fail issue for smu13")
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +6 -5
index 3d269d1c2749..fd79b213fab4 100644
@@ -1415,12 +1415,13 @@ static int smu_disable_dpms(struct smu_context *smu)
        switch (adev->ip_versions[MP1_HWIP][0]) {
        case IP_VERSION(13, 0, 0):
        case IP_VERSION(13, 0, 7):
-               ret = smu_set_mp1_state(smu, PP_MP1_STATE_UNLOAD);
-               if (ret) {
-                       dev_err(adev->dev, "Fail set mp1 state to UNLOAD!\n");
-                       return ret;
+               if (!(adev->in_runpm || amdgpu_in_reset(adev))) {
+                       ret = smu_set_mp1_state(smu, PP_MP1_STATE_UNLOAD);
+                       if (ret) {
+                               dev_err(adev->dev, "Fail set mp1 state to UNLOAD!\n");
+                               return ret;
+                       }
                }
-
                return 0;
        default:
                break;

--
2.25.1