]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/radeon: fix freeze for laptop with Turks/Thames GPU.
authorJérôme Glisse <jglisse@redhat.com>
Fri, 5 Jun 2015 17:33:57 +0000 (13:33 -0400)
committerLuis Henriques <luis.henriques@canonical.com>
Tue, 30 Jun 2015 16:15:30 +0000 (17:15 +0100)
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>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/gpu/drm/radeon/radeon_device.c

index d024389c42722d33851060a399be99d189c55d2f..e5ed5ee9d8324f728b69c8aa9938f5913a8da1ef 100644 (file)
@@ -1374,6 +1374,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);