]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/pm: correct Vega20 swctf limit setting
authorEvan Quan <evan.quan@amd.com>
Fri, 21 Aug 2020 04:21:30 +0000 (12:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:27:07 +0000 (11:27 +0200)
commit 9b51c4b2ba31396f3894ccc7df8bdf067243e9f5 upstream.

Correct the Vega20 thermal swctf limit.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_thermal.c

index ede54e87e287b5c838677e0739e60aa246aa7e65..1636df5fac74cff8a39f16ac9fa34cb026d4265c 100644 (file)
@@ -240,6 +240,8 @@ int vega20_thermal_get_temperature(struct pp_hwmgr *hwmgr)
 static int vega20_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,
                struct PP_TemperatureRange *range)
 {
+       struct phm_ppt_v3_information *pptable_information =
+               (struct phm_ppt_v3_information *)hwmgr->pptable;
        struct amdgpu_device *adev = hwmgr->adev;
        int low = VEGA20_THERMAL_MINIMUM_ALERT_TEMP *
                        PP_TEMPERATURE_UNITS_PER_CENTIGRADES;
@@ -249,8 +251,8 @@ static int vega20_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,
 
        if (low < range->min)
                low = range->min;
-       if (high > range->max)
-               high = range->max;
+       if (high > pptable_information->us_software_shutdown_temp)
+               high = pptable_information->us_software_shutdown_temp;
 
        if (low > high)
                return -EINVAL;