Skip to content

Commit

Permalink
radeon: Stop the ttm workqueue while reclocking
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthew Garrett authored and Dave Airlie committed May 18, 2010
1 parent 7c5ee53 commit d9932a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/radeon/radeon_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit d9932a3

Please sign in to comment.