]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu/powerplay/smu7: fix AVFS handling with custom powerplay table
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 8 Nov 2019 16:15:17 +0000 (11:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 11:17:17 +0000 (13:17 +0200)
[ Upstream commit 901245624c7812b6c95d67177bae850e783b5212 ]

When a custom powerplay table is provided, we need to update
the OD VDDC flag to avoid AVFS being enabled when it shouldn't be.

Bug: https://bugzilla.kernel.org/show_bug.cgi?id=205393
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c

index 3a2a1dc9a786a5c6297c8dab09fa4349330c937b..1b55f037ba4a7c43ca544fdf72041338454603fe 100644 (file)
@@ -3987,6 +3987,13 @@ static int smu7_set_power_state_tasks(struct pp_hwmgr *hwmgr, const void *input)
                        "Failed to populate and upload SCLK MCLK DPM levels!",
                        result = tmp_result);
 
+       /*
+        * If a custom pp table is loaded, set DPMTABLE_OD_UPDATE_VDDC flag.
+        * That effectively disables AVFS feature.
+        */
+       if (hwmgr->hardcode_pp_table != NULL)
+               data->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_VDDC;
+
        tmp_result = smu7_update_avfs(hwmgr);
        PP_ASSERT_WITH_CODE((0 == tmp_result),
                        "Failed to update avfs voltages!",