]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/pm: inform SMU RLC status thus enable/disable DPM feature for vangogh
authorXiaomeng Hou <Xiaomeng.Hou@amd.com>
Tue, 1 Dec 2020 10:33:33 +0000 (18:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 10 Dec 2020 21:41:50 +0000 (16:41 -0500)
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 (Normal/OFF) thus enable/disable DPM feature.

Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Lazar Lijo <Lijo.Lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h

index a81e5c8232116cae3f212fdd865a996eb110ba0d..9bccf2ad038c8ac09a2666470894a360fec215bf 100644 (file)
@@ -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,12 @@ 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)
+{
+       return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_RlcPowerNotify,
+                                       en ? RLC_STATUS_NORMAL : RLC_STATUS_OFF, NULL);
+}
+
 static const struct pptable_funcs vangogh_ppt_funcs = {
 
        .check_fw_status = smu_v11_0_check_fw_status,
@@ -749,6 +755,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)
index 8756766296cd0e2cff72e9fa23f793bd65615f56..eab45549307646c1a3665d44d41d2b91034e005c 100644 (file)
@@ -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