AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Rui <ray.huang@amd.com>
To: "Hou, Xiaomeng (Matthew)" <Xiaomeng.Hou@amd.com>
Cc: "Wang, Kevin\(Yang\)" <Kevin1.Wang@amd.com>,
	"Lazar, Lijo" <Lijo.Lazar@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v2 2/2] drm/amd/pm: inform SMU RLC status thus enable/disable DPM feature for vangogh
Date: Wed, 9 Dec 2020 21:13:52 +0800	[thread overview]
Message-ID: <20201209131352.GA1245060@hr-amd> (raw)
In-Reply-To: <20201209124938.11680-2-Xiaomeng.Hou@amd.com>

On Wed, Dec 09, 2020 at 08:49:38PM +0800, Hou, Xiaomeng (Matthew) wrote:
> RLC is halted when system suspend/shutdown. However, due to DPM enabled, PMFW is
> unaware of RLC being halted and will continue sending messages, which would
> eventually cause an ACPI hang. Use the system_feature_control interface to
> notify SMU the status of RLC thus enable/disable DPM feature.
> 
> Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
> Change-Id: I2f1a7de23df7315a7b220ba6d0a4bcaa75c93fea
> ---
>  .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c    | 17 ++++++++++++++++-
>  .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h    |  4 ++++
>  2 files changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> index ddaa6a705fa6..fb16d94b4031 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> @@ -64,7 +64,7 @@ static struct cmn2asic_msg_mapping vangogh_message_map[SMU_MSG_MAX_COUNT] = {
>  	MSG_MAP(PowerUpIspByTile,               PPSMC_MSG_PowerUpIspByTile,		0),
>  	MSG_MAP(PowerDownVcn,                   PPSMC_MSG_PowerDownVcn,			0),
>  	MSG_MAP(PowerUpVcn,                     PPSMC_MSG_PowerUpVcn,			0),
> -	MSG_MAP(Spare,                          PPSMC_MSG_spare,				0),
> +	MSG_MAP(RlcPowerNotify,                 PPSMC_MSG_RlcPowerNotify,		0),
>  	MSG_MAP(SetHardMinVcn,                  PPSMC_MSG_SetHardMinVcn,		0),
>  	MSG_MAP(SetSoftMinGfxclk,               PPSMC_MSG_SetSoftMinGfxclk,		0),
>  	MSG_MAP(ActiveProcessNotify,            PPSMC_MSG_ActiveProcessNotify,		0),
> @@ -722,6 +722,20 @@ static int vangogh_set_fine_grain_gfx_freq_parameters(struct smu_context *smu)
>  	return 0;
>  }
>  
> +static int vangogh_system_features_control(struct smu_context *smu, bool en)
> +{
> +	int ret = 0;
> +
> +	if (en)
> +		ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_RlcPowerNotify,
> +								RLC_STATUS_NORMAL, NULL);
> +	else
> +		ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_RlcPowerNotify,
> +								RLC_STATUS_OFF, NULL);

I think we can simplify the codes as below:

return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_RlcPowerNotify,
                                       en ? RLC_STATUS_NORMAL : RLC_STATUS_OFF, NULL);

With that update, series are Reviewed-by: Huang Rui <ray.huang@amd.com>

> +
> +	return ret;
> +}
> +
>  static const struct pptable_funcs vangogh_ppt_funcs = {
>  
>  	.check_fw_status = smu_v11_0_check_fw_status,
> @@ -750,6 +764,7 @@ static const struct pptable_funcs vangogh_ppt_funcs = {
>  	.print_clk_levels = vangogh_print_fine_grain_clk,
>  	.set_default_dpm_table = vangogh_set_default_dpm_tables,
>  	.set_fine_grain_gfx_freq_parameters = vangogh_set_fine_grain_gfx_freq_parameters,
> +	.system_features_control = vangogh_system_features_control,
>  };
>  
>  void vangogh_set_ppt_funcs(struct smu_context *smu)
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h
> index 8756766296cd..eab455493076 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h
> @@ -32,4 +32,8 @@ extern void vangogh_set_ppt_funcs(struct smu_context *smu);
>  #define VANGOGH_UMD_PSTATE_SOCCLK       678
>  #define VANGOGH_UMD_PSTATE_FCLK         800
>  
> +/* RLC Power Status */
> +#define RLC_STATUS_OFF          0
> +#define RLC_STATUS_NORMAL       1
> +
>  #endif
> -- 
> 2.17.1
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      parent reply	other threads:[~2020-12-09 13:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09 12:49 [PATCH v2 1/2] drm/amd/pm: update the smu v11.5 smc header for vangogh Xiaomeng Hou
2020-12-09 12:49 ` [PATCH v2 2/2] drm/amd/pm: inform SMU RLC status thus enable/disable DPM feature " Xiaomeng Hou
2020-12-09 12:59   ` Lazar, Lijo
2020-12-09 13:13   ` 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=20201209131352.GA1245060@hr-amd \
    --to=ray.huang@amd.com \
    --cc=Kevin1.Wang@amd.com \
    --cc=Lijo.Lazar@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox