|
@@ -50,6 +50,21 @@
|
|
#include <linux/pm_runtime.h>
|
|
#include <linux/pm_runtime.h>
|
|
#include <linux/oom.h>
|
|
#include <linux/oom.h>
|
|
|
|
|
|
|
|
+static unsigned int i915_load_fail_count;
|
|
|
|
+
|
|
|
|
+bool __i915_inject_load_failure(const char *func, int line)
|
|
|
|
+{
|
|
|
|
+ if (i915_load_fail_count >= i915.inject_load_failure)
|
|
|
|
+ return false;
|
|
|
|
+
|
|
|
|
+ if (++i915_load_fail_count == i915.inject_load_failure) {
|
|
|
|
+ DRM_INFO("Injecting failure at checkpoint %u [%s:%d]\n",
|
|
|
|
+ i915.inject_load_failure, func, line);
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
|
|
static int i915_getparam(struct drm_device *dev, void *data,
|
|
static int i915_getparam(struct drm_device *dev, void *data,
|
|
struct drm_file *file_priv)
|
|
struct drm_file *file_priv)
|
|
@@ -370,6 +385,9 @@ static int i915_load_modeset_init(struct drm_device *dev)
|
|
struct drm_i915_private *dev_priv = dev->dev_private;
|
|
struct drm_i915_private *dev_priv = dev->dev_private;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
|
|
+ if (i915_inject_load_failure())
|
|
|
|
+ return -ENODEV;
|
|
|
|
+
|
|
ret = intel_bios_init(dev_priv);
|
|
ret = intel_bios_init(dev_priv);
|
|
if (ret)
|
|
if (ret)
|
|
DRM_INFO("failed to find VBIOS tables\n");
|
|
DRM_INFO("failed to find VBIOS tables\n");
|
|
@@ -951,6 +969,9 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv,
|
|
struct intel_device_info *device_info;
|
|
struct intel_device_info *device_info;
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
|
|
|
|
|
+ if (i915_inject_load_failure())
|
|
|
|
+ return -ENODEV;
|
|
|
|
+
|
|
dev_priv->dev = dev;
|
|
dev_priv->dev = dev;
|
|
|
|
|
|
/* Setup the write-once "constant" device info */
|
|
/* Setup the write-once "constant" device info */
|
|
@@ -1065,6 +1086,9 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)
|
|
struct drm_device *dev = dev_priv->dev;
|
|
struct drm_device *dev = dev_priv->dev;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
|
|
+ if (i915_inject_load_failure())
|
|
|
|
+ return -ENODEV;
|
|
|
|
+
|
|
if (i915_get_bridge_dev(dev))
|
|
if (i915_get_bridge_dev(dev))
|
|
return -EIO;
|
|
return -EIO;
|
|
|
|
|
|
@@ -1108,6 +1132,9 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
|
|
uint32_t aperture_size;
|
|
uint32_t aperture_size;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
|
|
+ if (i915_inject_load_failure())
|
|
|
|
+ return -ENODEV;
|
|
|
|
+
|
|
intel_device_info_runtime_init(dev);
|
|
intel_device_info_runtime_init(dev);
|
|
|
|
|
|
ret = i915_gem_gtt_init(dev);
|
|
ret = i915_gem_gtt_init(dev);
|