From ad179af7789e7e9d38619e2fba59ab7fed39838d Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Sep 2017 06:08:56 +0200 Subject: [PATCH] amdgpu: no "auto" DPM level for HAWAII 0x67B0/1 The "auto" DPM level is known to be broken on this specific model, so we must not set it by default or the kernel would hang. This bug is so critical the kernel would hang at startup even before the user become able to switch the DPM level to another safe options. This bug also prevents to install Linux distros on workstation featuring this GPU since the kernel launched by the installation media hangs while the installation process is starting. The two other safe DPM options are "low" or "high". This specific model also known as R9 390, R9 390X or GRENADA (variant of HAWAII) is an expensive and powerful top-of-the line GPU card for workstations. Hence the user expects the default DPM being "high" if "auto" is not available. The user can still switch the DPM level to "low" if he cares about energy saving, given this fix will allow him to complete the system init to give him a shell to change that settings. The bug was well-described as bug #91880 in freedesktop.org bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91880 Despite this bug being reported since two years, AMD has not provided a fix yet, so it's be better for users to not set the faulty level by default while they are waiting for a fix. This patche does not prevent the user to set the faulty level by himself, what this patch does is to not set this faulty level by default. If the fault is in provided firmware as suspected and if a fixed firmware will be distributed in the future, users will be able to switch to the "auto" level without rebuilding their video driver. The patch is applied on both radeon and amdgpu drivers. --- drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 13 ++++++++++++- drivers/gpu/drm/radeon/radeon_pm.c | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c index ec93714e..50ad660f 100644 --- a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c +++ b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c @@ -6305,7 +6305,18 @@ static int ci_dpm_sw_init(void *handle) /* default to balanced state */ adev->pm.dpm.state = POWER_STATE_TYPE_BALANCED; adev->pm.dpm.user_state = POWER_STATE_TYPE_BALANCED; - adev->pm.dpm.forced_level = AMD_DPM_FORCED_LEVEL_AUTO; + + switch (adev->pdev->device) { + case 0x67B0; + case 0x67B1; + /* "auto" level is known to be broken on these high-performance hawaii/grenada variants */ + adev->pm.dpm.forced_level = AMD_DPM_FORCED_LEVEL_HIGH; + break; + default: + adev->pm.dpm.forced_level = AMD_DPM_FORCED_LEVEL_AUTO; + break; + } + adev->pm.default_sclk = adev->clock.default_sclk; adev->pm.default_mclk = adev->clock.default_mclk; adev->pm.current_sclk = adev->clock.default_sclk; diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 326ad068..14a405a5 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c @@ -1370,7 +1370,18 @@ static int radeon_pm_init_dpm(struct radeon_device *rdev) /* default to balanced state */ rdev->pm.dpm.state = POWER_STATE_TYPE_BALANCED; rdev->pm.dpm.user_state = POWER_STATE_TYPE_BALANCED; - rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_AUTO; + + switch (adev->pdev->device) { + case 0x67B0: + case 0x67B1: + /* "auto" level is known to be broken on these high-performance hawaii/grenada variants */ + rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_HIGH; + break; + default: + rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_AUTO; + break; + } + rdev->pm.default_sclk = rdev->clock.default_sclk; rdev->pm.default_mclk = rdev->clock.default_mclk; rdev->pm.current_sclk = rdev->clock.default_sclk; -- 2.11.0