diff mbox

[CI,v2] drm/i915: Print the condition causing GEM_BUG_ON

Message ID 20171017130241.15759-1-mika.kuoppala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mika Kuoppala Oct. 17, 2017, 1:02 p.m. UTC
It is easier to categorize and debug bugs if the failed condition
is in plain sight in the actual dmesg output. Make it so.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Chris Wilson Oct. 17, 2017, 2:12 p.m. UTC | #1
Quoting Patchwork (2017-10-17 14:28:39)
> == Series Details ==
> 
> Series: drm/i915: Print the condition causing GEM_BUG_ON (rev2)
> URL   : https://patchwork.freedesktop.org/series/32050/
> State : failure
> 
> == Summary ==
> 
> Series 32050v2 drm/i915: Print the condition causing GEM_BUG_ON
> https://patchwork.freedesktop.org/api/1.0/series/32050/revisions/2/mbox/
> 
> Test gem_exec_flush:
>         Subgroup basic-uc-set-default:
>                 pass       -> INCOMPLETE (fi-blb-e6850)
>         Subgroup basic-wb-ro-default:
>                 pass       -> INCOMPLETE (fi-skl-6700k)
> Test gem_exec_nop:
>         Subgroup basic-series:
>                 pass       -> INCOMPLETE (fi-kbl-7500u)
> Test gem_sync:
>         Subgroup basic-many-each:
>                 pass       -> INCOMPLETE (fi-kbl-7567u)
> Test kms_cursor_legacy:
>         Subgroup basic-busy-flip-before-cursor-legacy:
>                 fail       -> PASS       (fi-gdg-551) fdo#102618
>         Subgroup basic-flip-after-cursor-varying-size:
>                 skip       -> PASS       (fi-hsw-4770r)
> Test kms_pipe_crc_basic:
>         Subgroup suspend-read-crc-pipe-b:
>                 pass       -> INCOMPLETE (fi-kbl-7560u) fdo#102846

Are you going to tell me all of those
	watchdog: watchdog0: watchdog did not stop!
were merely coincidence? ;)
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
index ee54597465b6..84ba68e83df5 100644
--- a/drivers/gpu/drm/i915/i915_gem.h
+++ b/drivers/gpu/drm/i915/i915_gem.h
@@ -28,7 +28,11 @@ 
 #include <linux/bug.h>
 
 #ifdef CONFIG_DRM_I915_DEBUG_GEM
-#define GEM_BUG_ON(expr) BUG_ON(expr)
+#define GEM_BUG_ON(condition) do { if (unlikely((condition))) {	\
+		printk(KERN_ERR "GEM_BUG_ON(%s)\n", __stringify(condition)); \
+		BUG(); \
+		} \
+	} while(0)
 #define GEM_WARN_ON(expr) WARN_ON(expr)
 
 #define GEM_DEBUG_DECL(var) var