Commit 8fd1b84c authored by Dave Airlie's avatar Dave Airlie

drm/radeon: fix race between GPU reset and TTM delayed delete thread.

My evergreen has been in a remote PC for week and reset has never once
saved me from certain doom, I finally relocated to the box with a
serial cable and noticed an oops when the GPU resets, and the TTM
delayed delete thread tries to remove something from the GTT.

This stops the delayed delete thread from executing across the GPU
reset handler, and woot I can GPU reset now.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 0f234f5f
...@@ -936,8 +936,11 @@ int radeon_resume_kms(struct drm_device *dev) ...@@ -936,8 +936,11 @@ int radeon_resume_kms(struct drm_device *dev)
int radeon_gpu_reset(struct radeon_device *rdev) int radeon_gpu_reset(struct radeon_device *rdev)
{ {
int r; int r;
int resched;
radeon_save_bios_scratch_regs(rdev); radeon_save_bios_scratch_regs(rdev);
/* block TTM */
resched = ttm_bo_lock_delayed_workqueue(&rdev->mman.bdev);
radeon_suspend(rdev); radeon_suspend(rdev);
r = radeon_asic_reset(rdev); r = radeon_asic_reset(rdev);
...@@ -946,6 +949,7 @@ int radeon_gpu_reset(struct radeon_device *rdev) ...@@ -946,6 +949,7 @@ int radeon_gpu_reset(struct radeon_device *rdev)
radeon_resume(rdev); radeon_resume(rdev);
radeon_restore_bios_scratch_regs(rdev); radeon_restore_bios_scratch_regs(rdev);
drm_helper_resume_force_mode(rdev->ddev); drm_helper_resume_force_mode(rdev->ddev);
ttm_bo_unlock_delayed_workqueue(&rdev->mman.bdev, resched);
return 0; return 0;
} }
/* bad news, how to tell it to userspace ? */ /* bad news, how to tell it to userspace ? */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment