]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/i915: Squash GEM load failure message (again)
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 9 Jun 2018 11:10:58 +0000 (12:10 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 11 Jun 2018 09:01:03 +0000 (10:01 +0100)
Due to a silent conflict (silent because we are trying to fix the CI
test that is meant to exercising these failures!) between commit
51e645b6652c ("drm/i915: Mark the GPU as wedged without error on fault
injection") and commit 8571a05a9dd0 ("drm/i915: Use GEM suspend when
aborting initialisation"), we failed to actually squash the error
message after injecting the load failure.

Rearrange the code to export i915_load_failure() for better logging of
real errors (and quiet logging of injected errors).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180609111058.2660-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c

index d258388605d60d81135c32621a57af02a6ea0c1c..4cdd70de5ed02cd310494c6a0d595a7db3bcf45e 100644 (file)
@@ -73,6 +73,12 @@ bool __i915_inject_load_failure(const char *func, int line)
 
        return false;
 }
+
+bool i915_error_injected(void)
+{
+       return i915_load_fail_count && !i915_modparams.inject_load_failure;
+}
+
 #endif
 
 #define FDO_BUG_URL "https://bugs.freedesktop.org/enter_bug.cgi?product=DRI"
@@ -115,20 +121,6 @@ __i915_printk(struct drm_i915_private *dev_priv, const char *level,
        va_end(args);
 }
 
-static bool i915_error_injected(struct drm_i915_private *dev_priv)
-{
-#if IS_ENABLED(CONFIG_DRM_I915_DEBUG)
-       return i915_load_fail_count && !i915_modparams.inject_load_failure;
-#else
-       return false;
-#endif
-}
-
-#define i915_load_error(i915, fmt, ...)                                         \
-       __i915_printk(i915,                                              \
-                     i915_error_injected(i915) ? KERN_DEBUG : KERN_ERR, \
-                     fmt, ##__VA_ARGS__)
-
 /* Map PCH device id to PCH type, or PCH_NONE if unknown. */
 static enum intel_pch
 intel_pch_type(const struct drm_i915_private *dev_priv, unsigned short id)
index 71651ca7a8b1bf5bfa8f695b6dd1bc6ec626d160..6104d7115054692d4a6ed727e6632bd11b9e4813 100644 (file)
        I915_STATE_WARN((x), "%s", "WARN_ON(" __stringify(x) ")")
 
 #if IS_ENABLED(CONFIG_DRM_I915_DEBUG)
+
 bool __i915_inject_load_failure(const char *func, int line);
 #define i915_inject_load_failure() \
        __i915_inject_load_failure(__func__, __LINE__)
+
+bool i915_error_injected(void);
+
 #else
+
 #define i915_inject_load_failure() false
+#define i915_error_injected() false
+
 #endif
 
+#define i915_load_error(i915, fmt, ...)                                         \
+       __i915_printk(i915, i915_error_injected() ? KERN_DEBUG : KERN_ERR, \
+                     fmt, ##__VA_ARGS__)
+
 typedef struct {
        uint32_t val;
 } uint_fixed_16_16_t;
index 4187e0688e508a8b335039db9c7d2b81520721b6..0f28b5ddfd156059c51acf38aa1f1021377c21b0 100644 (file)
@@ -5491,8 +5491,6 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
        }
 
        if (i915_inject_load_failure()) {
-               DRM_DEBUG_DRIVER("Marking the driver as wedged\n");
-               i915_gem_set_wedged(dev_priv);  /* Fail silently! */
                ret = -EIO;
                goto err_init_hw;
        }
@@ -5543,7 +5541,8 @@ err_unlock:
                 * for all other failure, such as an allocation failure, bail.
                 */
                if (!i915_terminally_wedged(&dev_priv->gpu_error)) {
-                       DRM_ERROR("Failed to initialize GPU, declaring it wedged\n");
+                       i915_load_error(dev_priv,
+                                       "Failed to initialize GPU, declaring it wedged!\n");
                        i915_gem_set_wedged(dev_priv);
                }
                ret = 0;