aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_pm.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index aa14dbb7e4fb..0bfa656aa87d 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -234,7 +234,7 @@ static void radeon_set_power_state(struct radeon_device *rdev)
234 234
235static void radeon_pm_set_clocks(struct radeon_device *rdev) 235static void radeon_pm_set_clocks(struct radeon_device *rdev)
236{ 236{
237 int i; 237 int i, r;
238 238
239 /* no need to take locks, etc. if nothing's going to change */ 239 /* no need to take locks, etc. if nothing's going to change */
240 if ((rdev->pm.requested_clock_mode_index == rdev->pm.current_clock_mode_index) && 240 if ((rdev->pm.requested_clock_mode_index == rdev->pm.current_clock_mode_index) &&
@@ -248,8 +248,17 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev)
248 /* wait for the rings to drain */ 248 /* wait for the rings to drain */
249 for (i = 0; i < RADEON_NUM_RINGS; i++) { 249 for (i = 0; i < RADEON_NUM_RINGS; i++) {
250 struct radeon_ring *ring = &rdev->ring[i]; 250 struct radeon_ring *ring = &rdev->ring[i];
251 if (ring->ready) 251 if (!ring->ready) {
252 radeon_fence_wait_empty_locked(rdev, i); 252 continue;
253 }
254 r = radeon_fence_wait_empty_locked(rdev, i);
255 if (r) {
256 /* needs a GPU reset dont reset here */
257 mutex_unlock(&rdev->ring_lock);
258 up_write(&rdev->pm.mclk_lock);
259 mutex_unlock(&rdev->ddev->struct_mutex);
260 return;
261 }
253 } 262 }
254 263
255 radeon_unmap_vram_bos(rdev); 264 radeon_unmap_vram_bos(rdev);