summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérôme Glisse <jglisse@redhat.com>2015-06-05 13:33:57 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-06-22 17:01:23 -0700
commit6fb3e1bc2b825db7300b240380ad7228a9d3460c (patch)
tree3eeb1049bb9c6ab37f9b1ccd35f00b1d6b99287b
parent93fbe0f62906303f566fc3a1405ad4767c8854c2 (diff)
downloadlwn-6fb3e1bc2b825db7300b240380ad7228a9d3460c.tar.gz
lwn-6fb3e1bc2b825db7300b240380ad7228a9d3460c.zip
drm/radeon: fix freeze for laptop with Turks/Thames GPU.
commit 6dfd197283bffc23a2b046a7f065588de7e1fc1e upstream. Laptop with Turks/Thames GPU will freeze if dpm is enabled. It seems the SMC engine is relying on some state inside the CP engine. CP needs to chew at least one packet for it to get in good state for dynamic power management. This patch simply disabled and re-enable DPM after the ring test which is enough to avoid the freeze. Signed-off-by: Jérôme Glisse <jglisse@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index e39026cc7d07..129915eca07b 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1337,6 +1337,21 @@ int radeon_device_init(struct radeon_device *rdev,
goto failed;
}
+ /*
+ * Turks/Thames GPU will freeze whole laptop if DPM is not restarted
+ * after the CP ring have chew one packet at least. Hence here we stop
+ * and restart DPM after the radeon_ib_ring_tests().
+ */
+ if (rdev->pm.dpm_enabled &&
+ (rdev->pm.pm_method == PM_METHOD_DPM) &&
+ (rdev->family == CHIP_TURKS) &&
+ (rdev->flags & RADEON_IS_MOBILITY)) {
+ mutex_lock(&rdev->pm.mutex);
+ radeon_dpm_disable(rdev);
+ radeon_dpm_enable(rdev);
+ mutex_unlock(&rdev->pm.mutex);
+ }
+
if ((radeon_testing & 1)) {
if (rdev->accel_working)
radeon_test_moves(rdev);