Not sure whether there have any case that need to deal with that situation if 
some msg not found except the set mp1 state message. If handle it in 
smu_cmn_send_smc_msg_with_param all the message not found will be skipped.
And the logic return index == -EACCES ? 0 : index; only skipped the bad return 
value that the msg was found but not valid in vf mode. If the message not 
found, it will still return an bad valid.

Regards,
Likun

-----邮件原件-----
发件人: Chen, Jiansong (Simon) 
发送时间: 2020年7月21日 15:06
收件人: Gao, Likun <likun....@amd.com>; amd-gfx@lists.freedesktop.org
抄送: Gao, Likun <likun....@amd.com>; Quan, Evan <evan.q...@amd.com>; Sheng, 
Wenhui <wenhui.sh...@amd.com>; Zhang, Hawking <hawking.zh...@amd.com>
主题: RE: [PATCH] drm/amd/powerplay: skip invalid msg when smu set mp1 state

[AMD Official Use Only - Internal Distribution Only]

Then why we don't handle it directly in smu_cmn_send_smc_msg_with_param where 
is more near to the source of the problem.
And there is similar logic already.
if (index < 0)
return index == -EACCES ? 0 : index;

Regards,
Jiansong
-----Original Message-----
From: amd-gfx <amd-gfx-boun...@lists.freedesktop.org> On Behalf Of Likun Gao
Sent: Tuesday, July 21, 2020 2:30 PM
To: amd-gfx@lists.freedesktop.org
Cc: Gao, Likun <likun....@amd.com>; Quan, Evan <evan.q...@amd.com>; Sheng, 
Wenhui <wenhui.sh...@amd.com>; Zhang, Hawking <hawking.zh...@amd.com>
Subject: [PATCH] drm/amd/powerplay: skip invalid msg when smu set mp1 state

From: Likun Gao <likun....@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....@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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CJiansong.Chen%40amd.com%7C307b4326530d4a8afb5c08d82d3f877c%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637309098198014944&amp;sdata=mnZFtst8g4yxqOjYeoAmFuQvVn8Y7j4tpf%2FPLvaTCt8%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to