aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-06-18 06:42:08 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-06-23 08:01:38 -0400
commitb1330fbb870467bbb90adb2e8868672af4ca88c7 (patch)
tree26dade4170a4b26bb8a114791676c78b0e8fc0f9
parentbf13af56252b2b4f50eb6fc8638e8cb9e84ff475 (diff)
drm/i915: Report an error when i915.reset prevents a reset
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>
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c1
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c3
-rw-r--r--drivers/gpu/drm/i915/i915_params.c2
-rw-r--r--drivers/gpu/drm/i915/intel_uncore.c3
4 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 88795d2f1819..c5349fa3fcce 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -165,7 +165,6 @@ static int i915_getparam(struct drm_device *dev, void *data,
165 break; 165 break;
166 case I915_PARAM_HAS_GPU_RESET: 166 case I915_PARAM_HAS_GPU_RESET:
167 value = i915.enable_hangcheck && 167 value = i915.enable_hangcheck &&
168 i915.reset &&
169 intel_has_gpu_reset(dev); 168 intel_has_gpu_reset(dev);
170 break; 169 break;
171 default: 170 default:
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index b12a8218e35e..e44dc0d6656f 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -846,9 +846,6 @@ int i915_reset(struct drm_device *dev)
846 bool simulated; 846 bool simulated;
847 int ret; 847 int ret;
848 848
849 if (!i915.reset)
850 return 0;
851
852 intel_reset_gt_powersave(dev); 849 intel_reset_gt_powersave(dev);
853 850
854 mutex_lock(&dev->struct_mutex); 851 mutex_lock(&dev->struct_mutex);
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 3f67e69185c8..18f65595d60e 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -104,7 +104,7 @@ MODULE_PARM_DESC(vbt_sdvo_panel_type,
104 "Override/Ignore selection of SDVO panel mode in the VBT " 104 "Override/Ignore selection of SDVO panel mode in the VBT "
105 "(-2=ignore, -1=auto [default], index in VBT BIOS table)"); 105 "(-2=ignore, -1=auto [default], index in VBT BIOS table)");
106 106
107module_param_named(reset, i915.reset, bool, 0600); 107module_param_named_unsafe(reset, i915.reset, bool, 0600);
108MODULE_PARM_DESC(reset, "Attempt GPU resets (default: true)"); 108MODULE_PARM_DESC(reset, "Attempt GPU resets (default: true)");
109 109
110module_param_named(enable_hangcheck, i915.enable_hangcheck, bool, 0644); 110module_param_named(enable_hangcheck, i915.enable_hangcheck, bool, 0644);
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 160a47a9bdd9..45285a9178fe 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1496,6 +1496,9 @@ not_ready:
1496 1496
1497static int (*intel_get_gpu_reset(struct drm_device *dev))(struct drm_device *) 1497static int (*intel_get_gpu_reset(struct drm_device *dev))(struct drm_device *)
1498{ 1498{
1499 if (!i915.reset)
1500 return NULL;
1501
1499 if (INTEL_INFO(dev)->gen >= 8) 1502 if (INTEL_INFO(dev)->gen >= 8)
1500 return gen8_do_reset; 1503 return gen8_do_reset;
1501 else if (INTEL_INFO(dev)->gen >= 6) 1504 else if (INTEL_INFO(dev)->gen >= 6)