All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Add fault injection support
@ 2016-03-11 23:15 Imre Deak
  2016-03-12  7:40 ` ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Imre Deak @ 2016-03-11 23:15 UTC (permalink / raw)
  To: intel-gfx

Add support for forcing an error at selected places in the driver. As an
example add 3 options to fail during driver loading.

Requested by Chris.

CC: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---

[This depends on
https://lists.freedesktop.org/archives/intel-gfx/2016-March/089597.html]

 drivers/gpu/drm/i915/i915_dma.c    | 9 +++++++++
 drivers/gpu/drm/i915/i915_drv.h    | 4 ++++
 drivers/gpu/drm/i915/i915_params.c | 6 ++++++
 drivers/gpu/drm/i915/i915_params.h | 1 +
 4 files changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index b1dbf1b..d12ae0b 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -950,6 +950,9 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv,
 	struct intel_device_info *device_info;
 	int ret = 0;
 
+	if (i915.inject_fault & I915_FAULT_INIT_EARLY)
+		return -ENODEV;
+
 	dev_priv->dev = dev;
 
 	/* Setup the write-once "constant" device info */
@@ -1064,6 +1067,9 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)
 	struct drm_device *dev = dev_priv->dev;
 	int ret;
 
+	if (i915.inject_fault & I915_FAULT_INIT_MMIO)
+		return -ENODEV;
+
 	if (i915_get_bridge_dev(dev))
 		return -EIO;
 
@@ -1107,6 +1113,9 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
 	uint32_t aperture_size;
 	int ret;
 
+	if (i915.inject_fault & I915_FAULT_INIT_HW)
+		return -ENODEV;
+
 	intel_device_info_runtime_init(dev);
 
 	ret = i915_gem_gtt_init(dev);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index f62b6d1..5122ed9 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -98,6 +98,10 @@
 #define I915_STATE_WARN_ON(x)						\
 	I915_STATE_WARN((x), "%s", "WARN_ON(" __stringify(x) ")")
 
+#define I915_FAULT_INIT_EARLY	0x0001
+#define I915_FAULT_INIT_MMIO	0x0002
+#define I915_FAULT_INIT_HW	0x0004
+
 static inline const char *yesno(bool v)
 {
 	return v ? "yes" : "no";
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 278c9c4..21f8dd3 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -56,6 +56,7 @@ struct i915_params i915 __read_mostly = {
 	.edp_vswing = 0,
 	.enable_guc_submission = false,
 	.guc_log_level = -1,
+	.inject_fault = 0,
 };
 
 module_param_named(modeset, i915.modeset, int, 0400);
@@ -201,3 +202,8 @@ MODULE_PARM_DESC(enable_guc_submission, "Enable GuC submission (default:false)")
 module_param_named(guc_log_level, i915.guc_log_level, int, 0400);
 MODULE_PARM_DESC(guc_log_level,
 	"GuC firmware logging level (-1:disabled (default), 0-3:enabled)");
+
+module_param_named(inject_fault, i915.inject_fault, uint, 0600);
+MODULE_PARM_DESC(inject_fault,
+	"Force an error at selected points "
+	"(0:disabled, 0x1:INIT_EARLY, 0x2:INIT_MMIO, 0x4:INIT_HW)");
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index bd5026b..2989a48 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -59,6 +59,7 @@ struct i915_params {
 	bool enable_guc_submission;
 	bool verbose_state_checks;
 	bool nuclear_pageflip;
+	unsigned int inject_fault;
 };
 
 extern struct i915_params i915 __read_mostly;
-- 
2.5.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2016-03-16 10:27 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-11 23:15 [PATCH] drm/i915: Add fault injection support Imre Deak
2016-03-12  7:40 ` ✗ Fi.CI.BAT: failure for " Patchwork
2016-03-14  9:20 ` [PATCH v2] " Imre Deak
2016-03-14 14:59   ` [PATCH v3] " Imre Deak
2016-03-15  8:34     ` Joonas Lahtinen
2016-03-15  9:28       ` Chris Wilson
2016-03-15 13:17         ` Daniel Vetter
2016-03-15 14:08       ` Imre Deak
2016-03-15  8:56     ` Daniel Vetter
2016-03-15 14:01       ` Imre Deak
2016-03-15 14:14         ` Chris Wilson
2016-03-16  9:18           ` Joonas Lahtinen
2016-03-16  9:24             ` Chris Wilson
2016-03-16  9:43               ` Imre Deak
2016-03-16 10:04                 ` Chris Wilson
2016-03-16 10:17                   ` Imre Deak
2016-03-16 10:26                     ` Chris Wilson
2016-03-14 10:40 ` ✗ Fi.CI.BAT: failure for drm/i915: Add fault injection support (rev2) Patchwork
2016-03-14 14:40 ` ✗ Fi.CI.BAT: failure for drm/i915: Add fault injection support (rev3) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.