[PATCH v2 2/2] drm/amd/pm: inform SMU RLC status thus enable/disable DPM feature for vangogh

Huang Rui ray.huang at amd.com
Wed Dec 9 13:13:52 UTC 2020


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 at 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 at 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
> 


More information about the amd-gfx mailing list