drm/radeon: drop doing resets in a work item
authorChristian König <christian.koenig@amd.com>
Wed, 27 Aug 2014 13:22:01 +0000 (15:22 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 27 Aug 2014 21:42:13 +0000 (17:42 -0400)
Blocking completely innocent processes with a GPU reset is
a pretty bad idea. Just set needs_reset and let the next
command submission or fence wait do the job.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/cik.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_device.c
drivers/gpu/drm/radeon/radeon_irq_kms.c

index 79a5a5519bd67131233508b99d0f11add8b48240..1f598ab3b9a7046aa2bdac07471b399e0ce246fc 100644 (file)
@@ -8246,8 +8246,10 @@ restart_ih:
        }
        if (queue_hotplug)
                schedule_work(&rdev->hotplug_work);
-       if (queue_reset)
-               schedule_work(&rdev->reset_work);
+       if (queue_reset) {
+               rdev->needs_reset = true;
+               wake_up_all(&rdev->fence_queue);
+       }
        if (queue_thermal)
                schedule_work(&rdev->pm.dpm.thermal.work);
        rdev->ih.rptr = rptr;
index 896a847796509e78c7a0e6f0d2b6c499b91a1477..c163b4f8914993f3ef2a479a68b555261069b526 100644 (file)
@@ -2346,7 +2346,6 @@ struct radeon_device {
        struct radeon_mec mec;
        struct work_struct hotplug_work;
        struct work_struct audio_work;
-       struct work_struct reset_work;
        int num_crtc; /* number of crtcs */
        struct mutex dc_hw_i2c_mutex; /* display controller hw i2c mutex */
        bool has_uvd;
index 9f666370b5acf919e2c3d726b1ceb45c007fb4ff..d30f1cc1aa12be2998495064bf265cbb23c7fd0b 100644 (file)
@@ -1673,9 +1673,6 @@ int radeon_gpu_reset(struct radeon_device *rdev)
                return 0;
        }
 
-       rdev->in_reset = true;
-       rdev->needs_reset = false;
-
        radeon_save_bios_scratch_regs(rdev);
        /* block TTM */
        resched = ttm_bo_lock_delayed_workqueue(&rdev->mman.bdev);
@@ -1738,6 +1735,10 @@ int radeon_gpu_reset(struct radeon_device *rdev)
        radeon_hpd_init(rdev);
 
        ttm_bo_unlock_delayed_workqueue(&rdev->mman.bdev, resched);
+
+       rdev->in_reset = true;
+       rdev->needs_reset = false;
+
        downgrade_write(&rdev->exclusive_lock);
 
        drm_helper_resume_force_mode(rdev->ddev);
index 16807afab362509f8432bf4a021d3954e747c301..f0bff4be67f1c60c7be5ae1afd7b5e8ea7dc86df 100644 (file)
@@ -87,23 +87,6 @@ static void radeon_hotplug_work_func(struct work_struct *work)
        drm_helper_hpd_irq_event(dev);
 }
 
-/**
- * radeon_irq_reset_work_func - execute gpu reset
- *
- * @work: work struct
- *
- * Execute scheduled gpu reset (cayman+).
- * This function is called when the irq handler
- * thinks we need a gpu reset.
- */
-static void radeon_irq_reset_work_func(struct work_struct *work)
-{
-       struct radeon_device *rdev = container_of(work, struct radeon_device,
-                                                 reset_work);
-
-       radeon_gpu_reset(rdev);
-}
-
 /**
  * radeon_driver_irq_preinstall_kms - drm irq preinstall callback
  *
@@ -284,7 +267,6 @@ int radeon_irq_kms_init(struct radeon_device *rdev)
 
        INIT_WORK(&rdev->hotplug_work, radeon_hotplug_work_func);
        INIT_WORK(&rdev->audio_work, r600_audio_update_hdmi);
-       INIT_WORK(&rdev->reset_work, radeon_irq_reset_work_func);
 
        rdev->irq.installed = true;
        r = drm_irq_install(rdev->ddev, rdev->ddev->pdev->irq);