From eafa856ca26d538f9f9e0cd5f5cdbd0ca4cd25b8 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 10 Sep 2017 06:08:56 +0200 Subject: [PATCH] amdgpu: HAWAII 0x67B1: no auto default DPM profile The "auto" DPM profile 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 profile 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 profile 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 profile by default while they are waiting for a fix. This patche does not prevent the user to set the faulty profile by himself, what this patch does is to not set this faulty profile 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" profile without rebuilding their video driver. The patch is applied on both radeon and amdgpu drivers. --- drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 8 +++++++- drivers/gpu/drm/radeon/radeon_pm.c | 8 +++++++- 2 files changed, 14 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..d851bee7 100644 --- a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c +++ b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c @@ -6305,7 +6305,13 @@ 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; + + /* "auto" level is known to be broken on this high-performance hawaii variant */ + if (adev->pdev->device == 0x67B1) + adev->pm.dpm.forced_level = AMD_DPM_FORCED_LEVEL_HIGH; + else + adev->pm.dpm.forced_level = AMD_DPM_FORCED_LEVEL_AUTO; + 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..c1d31c4f 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c @@ -1370,7 +1370,13 @@ 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; + + /* "auto" level is known to be broken on this high-performance hawaii variant */ + if (adev->pdev->device == 0x67B1) + rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_HIGH; + else + rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_AUTO; + 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