All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Rui <ray.huang@amd.com>
To: "Feng, Kenneth" <Kenneth.Feng@amd.com>
Cc: "Du, Xiaojian" <Xiaojian.Du@amd.com>,
	"Liu, Aaron" <Aaron.Liu@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"Hou, Xiaomeng \(Matthew\)" <Xiaomeng.Hou@amd.com>,
	"Deucher, Alexander" <Alexander.Deucher@amd.com>,
	"Quan, Evan" <Evan.Quan@amd.com>
Subject: Re: [PATCH] drm/amd/pm: fix the return value of pm message
Date: Wed, 13 Jan 2021 09:55:22 +0800	[thread overview]
Message-ID: <20210113015522.GA135893@hr-amd> (raw)
In-Reply-To: <BYAPR12MB364043FB791CA966A139ECEC8EA90@BYAPR12MB3640.namprd12.prod.outlook.com>

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

      reply	other threads:[~2021-01-13  1:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210113015522.GA135893@hr-amd \
    --to=ray.huang@amd.com \
    --cc=Aaron.Liu@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Evan.Quan@amd.com \
    --cc=Kenneth.Feng@amd.com \
    --cc=Xiaojian.Du@amd.com \
    --cc=Xiaomeng.Hou@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.