From e63417818b2b7cac6fb21f4ce19ac845a7d4c203 Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 12 Mar 2024 05:40:37 +0000 Subject: [PATCH] Revert "drm/amd/pm: resolve reboot exception for si oland" From Alex Deucher baac292852c0e347626fb5436916947188e5838f in linux-6.6.y/6.6.21 955558030954b9637b41c97b730f9b38c92ac488 in mainline linux --- .../pci/drm/amd/pm/legacy-dpm/amdgpu_si_dpm.c | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/sys/dev/pci/drm/amd/pm/legacy-dpm/amdgpu_si_dpm.c b/sys/dev/pci/drm/amd/pm/legacy-dpm/amdgpu_si_dpm.c index f81e4bd4811..99dde52a429 100644 --- a/sys/dev/pci/drm/amd/pm/legacy-dpm/amdgpu_si_dpm.c +++ b/sys/dev/pci/drm/amd/pm/legacy-dpm/amdgpu_si_dpm.c @@ -6925,6 +6925,23 @@ static int si_dpm_enable(struct amdgpu_device *adev) return 0; } +static int si_set_temperature_range(struct amdgpu_device *adev) +{ + int ret; + + ret = si_thermal_enable_alert(adev, false); + if (ret) + return ret; + ret = si_thermal_set_temperature_range(adev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX); + if (ret) + return ret; + ret = si_thermal_enable_alert(adev, true); + if (ret) + return ret; + + return ret; +} + static void si_dpm_disable(struct amdgpu_device *adev) { struct rv7xx_power_info *pi = rv770_get_pi(adev); @@ -7608,6 +7625,18 @@ static int si_dpm_process_interrupt(struct amdgpu_device *adev, static int si_dpm_late_init(void *handle) { + int ret; + struct amdgpu_device *adev = (struct amdgpu_device *)handle; + + if (!adev->pm.dpm_enabled) + return 0; + + ret = si_set_temperature_range(adev); + if (ret) + return ret; +#if 0 //TODO ? + si_dpm_powergate_uvd(adev, true); +#endif return 0; } -- 2.20.1