All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/pm: fix the return value of pm message
@ 2021-01-12 10:25 Huang Rui
  2021-01-12 10:28 ` Du, Xiaojian
  2021-01-13  1:45 ` Feng, Kenneth
  0 siblings, 2 replies; 4+ messages in thread
From: Huang Rui @ 2021-01-12 10:25 UTC (permalink / raw)
  To: amd-gfx
  Cc: Xiaojian Du, Huang Rui, Aaron Liu, Xiaomeng Hou, Alex Deucher, Evan Quan

0 should be right driver return value, 0x1 is the right firmware
return value. So switch to 0 at last.

Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
index d7d86fd79e1f..41d5c65a2f21 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
@@ -149,6 +149,7 @@ int smu_cmn_send_smc_msg_with_param(struct smu_context *smu,
 	if (read_arg)
 		smu_cmn_read_arg(smu, read_arg);
 
+	ret = 0; /* 0 as driver return value */
 out:
 	mutex_unlock(&smu->message_lock);
 	return ret;
-- 
2.25.1

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH] drm/amd/pm: fix the return value of pm message
  2021-01-12 10:25 [PATCH] drm/amd/pm: fix the return value of pm message Huang Rui
@ 2021-01-12 10:28 ` Du, Xiaojian
  2021-01-13  1:45 ` Feng, Kenneth
  1 sibling, 0 replies; 4+ messages in thread
From: Du, Xiaojian @ 2021-01-12 10:28 UTC (permalink / raw)
  To: Huang, Ray, amd-gfx
  Cc: Deucher, Alexander, Hou, Xiaomeng (Matthew), Liu, Aaron, Quan, Evan

[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: Xiaojian Du <xiaojian.du@amd.com>

-----Original Message-----
From: Huang, Ray <Ray.Huang@amd.com>
Sent: 2021年1月12日 18:25
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Liu, Aaron <Aaron.Liu@amd.com>; Du, Xiaojian <Xiaojian.Du@amd.com>; Hou, Xiaomeng (Matthew) <Xiaomeng.Hou@amd.com>; Quan, Evan <Evan.Quan@amd.com>; Huang, Ray <Ray.Huang@amd.com>
Subject: [PATCH] drm/amd/pm: fix the return value of pm message

0 should be right driver return value, 0x1 is the right firmware return value. So switch to 0 at last.

Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
index d7d86fd79e1f..41d5c65a2f21 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
@@ -149,6 +149,7 @@ int smu_cmn_send_smc_msg_with_param(struct smu_context *smu,
 if (read_arg)
 smu_cmn_read_arg(smu, read_arg);

+ret = 0; /* 0 as driver return value */
 out:
 mutex_unlock(&smu->message_lock);
 return ret;
--
2.25.1

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH] drm/amd/pm: fix the return value of pm message
  2021-01-12 10:25 [PATCH] drm/amd/pm: fix the return value of pm message Huang Rui
  2021-01-12 10:28 ` Du, Xiaojian
@ 2021-01-13  1:45 ` Feng, Kenneth
  2021-01-13  1:55   ` Huang Rui
  1 sibling, 1 reply; 4+ messages in thread
From: Feng, Kenneth @ 2021-01-13  1:45 UTC (permalink / raw)
  To: Huang, Ray, amd-gfx
  Cc: Hou, Xiaomeng (Matthew),
	Du, Xiaojian, Liu, Aaron, Huang, Ray, Deucher, Alexander, Quan,
	Evan

[AMD Official Use Only - Internal Distribution Only]

This can fix the problem of the below commit.
But I'm not sure what is the real purpose of the below commit. Or can we revert it?
Thanks.
commit 72a33b4b7433780df5334f9cfb23ff51669431a0
Author: Huang Rui <ray.huang@amd.com>
Date:   Fri Jan 8 16:27:15 2021 +0800

    drm/amd/pm: enhance the real response for smu message (v2)

    The user prefers to know the real response value from C2PMSG 90 register
    which is written by firmware not -EIO.

    v2: return C2PMSG 90 value

    Signed-off-by: Huang Rui <ray.huang@amd.com>
    Reviewed-by: Evan Quan <evan.quan@amd.com>

Best Regards
Kenneth

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Huang Rui
Sent: Tuesday, January 12, 2021 6:25 PM
To: amd-gfx@lists.freedesktop.org
Cc: Du, Xiaojian <Xiaojian.Du@amd.com>; Huang, Ray <Ray.Huang@amd.com>; Liu, Aaron <Aaron.Liu@amd.com>; Hou, Xiaomeng (Matthew) <Xiaomeng.Hou@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Quan, Evan <Evan.Quan@amd.com>
Subject: [PATCH] drm/amd/pm: fix the return value of pm message

[CAUTION: External Email]

0 should be right driver return value, 0x1 is the right firmware return value. So switch to 0 at last.

Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
index d7d86fd79e1f..41d5c65a2f21 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
@@ -149,6 +149,7 @@ int smu_cmn_send_smc_msg_with_param(struct smu_context *smu,
        if (read_arg)
                smu_cmn_read_arg(smu, read_arg);

+       ret = 0; /* 0 as driver return value */
 out:
        mutex_unlock(&smu->message_lock);
        return ret;
--
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=04%7C01%7CKenneth.Feng%40amd.com%7Ccb87272dd89a4b4a6bef08d8b6e463fc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637460439339749600%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Hzm73NA1Y%2FSS3plnWpZ%2BcOxyIvEnySRBTTUV5%2FV6Lxo%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/pm: fix the return value of pm message
  2021-01-13  1:45 ` Feng, Kenneth
@ 2021-01-13  1:55   ` Huang Rui
  0 siblings, 0 replies; 4+ messages in thread
From: Huang Rui @ 2021-01-13  1:55 UTC (permalink / raw)
  To: Feng, Kenneth
  Cc: Du, Xiaojian, Liu, Aaron, amd-gfx, Hou, Xiaomeng (Matthew),
	Deucher, Alexander, Quan, Evan

On Wed, Jan 13, 2021 at 09:45:31AM +0800, Feng, Kenneth wrote:
> [AMD Official Use Only - Internal Distribution Only]
> 
> This can fix the problem of the below commit.
> But I'm not sure what is the real purpose of the below commit. Or can we revert it?

We perfer to print firmware return values like below:

#define SMC_Status_BUSY                0x0
#define SMC_Result_OK                  0x1
#define SMC_Result_Failed              0xFF
#define SMC_Result_UnknownCmd          0xFE
#define SMC_Result_CmdRejectedPrereq   0xFD
#define SMC_Result_CmdRejectedBusy     0xFC

dev_err(adev->dev, "failed send message: %10s (%d) \tparam: 0x%08x response %#x\n",
        smu_get_message_name(smu, msg),
        index, param, ret);

-EIO is not very useful on debugging.

Thanks,
Ray

> Thanks.
> commit 72a33b4b7433780df5334f9cfb23ff51669431a0
> Author: Huang Rui <ray.huang@amd.com>
> Date:   Fri Jan 8 16:27:15 2021 +0800
> 
>     drm/amd/pm: enhance the real response for smu message (v2)
> 
>     The user prefers to know the real response value from C2PMSG 90 register
>     which is written by firmware not -EIO.
> 
>     v2: return C2PMSG 90 value
> 
>     Signed-off-by: Huang Rui <ray.huang@amd.com>
>     Reviewed-by: Evan Quan <evan.quan@amd.com>
> 
> Best Regards
> Kenneth
> 
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Huang Rui
> Sent: Tuesday, January 12, 2021 6:25 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Du, Xiaojian <Xiaojian.Du@amd.com>; Huang, Ray <Ray.Huang@amd.com>; Liu, Aaron <Aaron.Liu@amd.com>; Hou, Xiaomeng (Matthew) <Xiaomeng.Hou@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Quan, Evan <Evan.Quan@amd.com>
> Subject: [PATCH] drm/amd/pm: fix the return value of pm message
> 
> [CAUTION: External Email]
> 
> 0 should be right driver return value, 0x1 is the right firmware return value. So switch to 0 at last.
> 
> Signed-off-by: Huang Rui <ray.huang@amd.com>
> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
> index d7d86fd79e1f..41d5c65a2f21 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
> @@ -149,6 +149,7 @@ int smu_cmn_send_smc_msg_with_param(struct smu_context *smu,
>         if (read_arg)
>                 smu_cmn_read_arg(smu, read_arg);
> 
> +       ret = 0; /* 0 as driver return value */
>  out:
>         mutex_unlock(&smu->message_lock);
>         return ret;
> --
> 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=04%7C01%7CKenneth.Feng%40amd.com%7Ccb87272dd89a4b4a6bef08d8b6e463fc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637460439339749600%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Hzm73NA1Y%2FSS3plnWpZ%2BcOxyIvEnySRBTTUV5%2FV6Lxo%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-13  1:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12 10:25 [PATCH] drm/amd/pm: fix the return value of pm message Huang Rui
2021-01-12 10:28 ` Du, Xiaojian
2021-01-13  1:45 ` Feng, Kenneth
2021-01-13  1:55   ` Huang Rui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.