summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/radeon_pm.c
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2010-04-27 00:02:26 +0400
committerDave Airlie <airlied@redhat.com>2010-05-18 12:21:22 +0400
commitd9932a3241cc6a9629d6586ec362583cb77d7a29 (patch)
tree050f0becbb25c40b11ef6a37a3ac107647792bb7 /drivers/gpu/drm/radeon/radeon_pm.c
parent7c5ee5366f79f53de2a11e73953daee6d58df124 (diff)
downloadlinux-d9932a3241cc6a9629d6586ec362583cb77d7a29.tar.xz
radeon: Stop the ttm workqueue while reclocking
The ttm bo workqueue may touch objects while we're reclocking, so make sure it's blocked until we're done. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_pm.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index c9390ea56f96..79d3336eede5 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -460,9 +460,11 @@ bool radeon_pm_debug_check_in_vbl(struct radeon_device *rdev, bool finish)
static void radeon_pm_idle_work_handler(struct work_struct *work)
{
struct radeon_device *rdev;
+ int resched;
rdev = container_of(work, struct radeon_device,
pm.idle_work.work);
+ resched = ttm_bo_lock_delayed_workqueue(&rdev->mman.bdev);
mutex_lock(&rdev->ddev->struct_mutex);
mutex_lock(&rdev->pm.mutex);
if (rdev->pm.state == PM_STATE_ACTIVE) {
@@ -509,6 +511,7 @@ static void radeon_pm_idle_work_handler(struct work_struct *work)
}
mutex_unlock(&rdev->pm.mutex);
mutex_unlock(&rdev->ddev->struct_mutex);
+ ttm_bo_unlock_delayed_workqueue(&rdev->mman.bdev, resched);
queue_delayed_work(rdev->wq, &rdev->pm.idle_work,
msecs_to_jiffies(RADEON_IDLE_LOOP_MS));