drm/i915: Report an error when i915.reset prevents a reset
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 18 Jun 2015 10:42:08 +0000 (11:42 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 23 Jun 2015 12:01:38 +0000 (14:01 +0200)
If the user disables the GPU reset using the i915.reset parameter and
one occurs, report that we failed to reset the GPU. If we return early,
as we currently do, then we leave all state intact (with a hung GPU)
and clients block forever waiting for their requests to complete.

Testcase: igt/gem_eio
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: Mark i915.reset as an unsafe modoption, as discussed with
Chris.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_params.c
drivers/gpu/drm/i915/intel_uncore.c

index 88795d2f1819e5bd9e6f6a8f82955d536c5a99e4..c5349fa3fccef323d61f38ac9e869be153d5b9d1 100644 (file)
@@ -165,7 +165,6 @@ static int i915_getparam(struct drm_device *dev, void *data,
                break;
        case I915_PARAM_HAS_GPU_RESET:
                value = i915.enable_hangcheck &&
-                       i915.reset &&
                        intel_has_gpu_reset(dev);
                break;
        default:
index b12a8218e35ea5e92b0878a4a92a8672d61a3b7f..e44dc0d6656facf3102d0fe1ce01135e546e628b 100644 (file)
@@ -846,9 +846,6 @@ int i915_reset(struct drm_device *dev)
        bool simulated;
        int ret;
 
-       if (!i915.reset)
-               return 0;
-
        intel_reset_gt_powersave(dev);
 
        mutex_lock(&dev->struct_mutex);
index 3f67e69185c8c151c064440ab15220e15567ecfd..18f65595d60ee1b611864cf0c4b9118de6edf251 100644 (file)
@@ -104,7 +104,7 @@ MODULE_PARM_DESC(vbt_sdvo_panel_type,
        "Override/Ignore selection of SDVO panel mode in the VBT "
        "(-2=ignore, -1=auto [default], index in VBT BIOS table)");
 
-module_param_named(reset, i915.reset, bool, 0600);
+module_param_named_unsafe(reset, i915.reset, bool, 0600);
 MODULE_PARM_DESC(reset, "Attempt GPU resets (default: true)");
 
 module_param_named(enable_hangcheck, i915.enable_hangcheck, bool, 0644);
index 160a47a9bdd97944658bdd7ed903b87b7966c573..45285a9178fe10e1fd1f4db25547a7a51b52853e 100644 (file)
@@ -1496,6 +1496,9 @@ not_ready:
 
 static int (*intel_get_gpu_reset(struct drm_device *dev))(struct drm_device *)
 {
+       if (!i915.reset)
+               return NULL;
+
        if (INTEL_INFO(dev)->gen >= 8)
                return gen8_do_reset;
        else if (INTEL_INFO(dev)->gen >= 6)