[PATCH] drm/amd/powerplay: skip invalid msg when smu set mp1 state
Quan, Evan
Evan.Quan at amd.com
Thu Jul 23 03:44:53 UTC 2020
[AMD Official Use Only - Internal Distribution Only]
Reviewed-by: Evan Quan <evan.quan at amd.com>
-----Original Message-----
From: Gao, Likun <Likun.Gao at amd.com>
Sent: Tuesday, July 21, 2020 2:30 PM
To: amd-gfx at lists.freedesktop.org
Cc: Zhang, Hawking <Hawking.Zhang at amd.com>; Sheng, Wenhui <Wenhui.Sheng at amd.com>; Quan, Evan <Evan.Quan at amd.com>; Gao, Likun <Likun.Gao at amd.com>
Subject: [PATCH] drm/amd/powerplay: skip invalid msg when smu set mp1 state
From: Likun Gao <Likun.Gao at amd.com>
Some asic may not support for some message of set mp1 state.
If the return value of smu_send_smc_msg is -EINVAL, that means it failed
to send msg to smc as it can not map an valid message for the ASIC. And
with that case, smu_set_mp1_state should be skipped as those ASIC was in
fact do not support for that.
Signed-off-by: Likun Gao <Likun.Gao at amd.com>
Change-Id: I31b40b87532a1d7549b26155d4ec8145b5e3f101
---
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index b197dcaed064..237d8ab8b40d 100644
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
@@ -1590,6 +1590,9 @@ int smu_set_mp1_state(struct smu_context *smu,
}
ret = smu_send_smc_msg(smu, msg, NULL);
+/* some asics may not support those messages */
+if (ret == -EINVAL)
+ret = 0;
if (ret)
dev_err(smu->adev->dev, "[PrepareMp1] Failed!\n");
--
2.25.1
More information about the amd-gfx
mailing list