public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Tidy load failure reporting
@ 2016-12-06 17:31 Tvrtko Ursulin
  2016-12-06 18:15 ` ✗ Fi.CI.BAT: warning for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Tvrtko Ursulin @ 2016-12-06 17:31 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Several changes here:

 * Remove unused i915_report_error.
 * Unexport __i915_printk and rename it to i915_load_error,
   converting the latter from a macro to a static function.
 * Use drm_dev_printk instead of open-coding the same.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 45 +++++++++++++++++++----------------------
 drivers/gpu/drm/i915/i915_drv.h |  7 -------
 2 files changed, 21 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index ae583c79c19f..78b2d03bf808 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -68,52 +68,49 @@ bool __i915_inject_load_failure(const char *func, int line)
 	return false;
 }
 
+static bool i915_error_injected(struct drm_i915_private *dev_priv)
+{
+	return i915.inject_load_failure &&
+	       i915_load_fail_count == i915.inject_load_failure;
+}
+
 #define FDO_BUG_URL "https://bugs.freedesktop.org/enter_bug.cgi?product=DRI"
 #define FDO_BUG_MSG "Please file a bug at " FDO_BUG_URL " against DRM/Intel " \
 		    "providing the dmesg log by booting with drm.debug=0xf"
 
-void
-__i915_printk(struct drm_i915_private *dev_priv, const char *level,
-	      const char *fmt, ...)
+static void __printf(2, 3)
+i915_load_error(struct drm_i915_private *dev_priv, const char *fmt, ...)
 {
-	static bool shown_bug_once;
+	static bool shown_bug_once __read_mostly;
 	struct device *kdev = dev_priv->drm.dev;
-	bool is_error = level[1] <= KERN_ERR[1];
-	bool is_debug = level[1] == KERN_DEBUG[1];
+	char *level;
+	bool is_error;
 	struct va_format vaf;
 	va_list args;
 
-	if (is_debug && !(drm_debug & DRM_UT_DRIVER))
-		return;
+	if (i915_error_injected(dev_priv)) {
+		is_error = true;
+		level = KERN_ERR;
+	} else {
+		is_error = false;
+		level = KERN_DEBUG;
+	};
 
 	va_start(args, fmt);
 
 	vaf.fmt = fmt;
 	vaf.va = &args;
 
-	dev_printk(level, kdev, "[" DRM_NAME ":%ps] %pV",
-		   __builtin_return_address(0), &vaf);
+	drm_dev_printk(kdev, level, DRM_UT_DRIVER, __func__, "", fmt, &vaf);
+
+	va_end(args);
 
 	if (is_error && !shown_bug_once) {
 		dev_notice(kdev, "%s", FDO_BUG_MSG);
 		shown_bug_once = true;
 	}
-
-	va_end(args);
-}
-
-static bool i915_error_injected(struct drm_i915_private *dev_priv)
-{
-	return i915.inject_load_failure &&
-	       i915_load_fail_count == i915.inject_load_failure;
 }
 
-#define i915_load_error(dev_priv, fmt, ...)				     \
-	__i915_printk(dev_priv,						     \
-		      i915_error_injected(dev_priv) ? KERN_DEBUG : KERN_ERR, \
-		      fmt, ##__VA_ARGS__)
-
-
 static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
 {
 	enum intel_pch ret = PCH_NOP;
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 605247baa7d1..f523cdfa8636 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2766,13 +2766,6 @@ int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,
 bool intel_sanitize_semaphores(struct drm_i915_private *dev_priv, int value);
 
 /* i915_drv.c */
-void __printf(3, 4)
-__i915_printk(struct drm_i915_private *dev_priv, const char *level,
-	      const char *fmt, ...);
-
-#define i915_report_error(dev_priv, fmt, ...)				   \
-	__i915_printk(dev_priv, KERN_ERR, fmt, ##__VA_ARGS__)
-
 #ifdef CONFIG_COMPAT
 extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
 			      unsigned long arg);
-- 
2.7.4

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

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

* ✗ Fi.CI.BAT: warning for drm/i915: Tidy load failure reporting
  2016-12-06 17:31 [PATCH] drm/i915: Tidy load failure reporting Tvrtko Ursulin
@ 2016-12-06 18:15 ` Patchwork
  2016-12-06 19:00 ` [PATCH v2] " Tvrtko Ursulin
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2016-12-06 18:15 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Tidy load failure reporting
URL   : https://patchwork.freedesktop.org/series/16435/
State : warning

== Summary ==

Series 16435v1 drm/i915: Tidy load failure reporting
https://patchwork.freedesktop.org/api/1.0/series/16435/revisions/1/mbox/

Test drv_module_reload:
        Subgroup basic-reload-inject:
                pass       -> DMESG-WARN (fi-skl-6770hq)
                pass       -> DMESG-WARN (fi-skl-6700hq)
                pass       -> DMESG-WARN (fi-hsw-4770)
                pass       -> DMESG-WARN (fi-skl-6260u)
                pass       -> DMESG-WARN (fi-ivb-3770)
                pass       -> DMESG-WARN (fi-bdw-5557u)
                pass       -> DMESG-WARN (fi-bsw-n3050)
                pass       -> DMESG-WARN (fi-hsw-4770r)
                pass       -> DMESG-WARN (fi-bxt-t5700)
                pass       -> DMESG-WARN (fi-snb-2520m)
                pass       -> DMESG-WARN (fi-ilk-650)
                pass       -> DMESG-WARN (fi-snb-2600)
                pass       -> DMESG-WARN (fi-ivb-3520m)
                pass       -> DMESG-WARN (fi-kbl-7500u)
                pass       -> DMESG-WARN (fi-byt-n2820)
                pass       -> DMESG-WARN (fi-byt-j1900)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-c:
                dmesg-warn -> PASS       (fi-skl-6770hq)

fi-bdw-5557u     total:247  pass:217  dwarn:1   dfail:0   fail:0   skip:29 
fi-bsw-n3050     total:247  pass:193  dwarn:1   dfail:0   fail:0   skip:53 
fi-bxt-t5700     total:247  pass:204  dwarn:1   dfail:0   fail:0   skip:42 
fi-byt-j1900     total:247  pass:204  dwarn:1   dfail:0   fail:0   skip:42 
fi-byt-n2820     total:247  pass:200  dwarn:1   dfail:0   fail:0   skip:46 
fi-hsw-4770      total:247  pass:212  dwarn:1   dfail:0   fail:0   skip:34 
fi-hsw-4770r     total:247  pass:212  dwarn:1   dfail:0   fail:0   skip:34 
fi-ilk-650       total:247  pass:179  dwarn:1   dfail:0   fail:0   skip:67 
fi-ivb-3520m     total:247  pass:211  dwarn:1   dfail:0   fail:0   skip:35 
fi-ivb-3770      total:247  pass:210  dwarn:1   dfail:0   fail:0   skip:36 
fi-kbl-7500u     total:247  pass:210  dwarn:1   dfail:0   fail:0   skip:36 
fi-skl-6260u     total:247  pass:218  dwarn:1   dfail:0   fail:0   skip:28 
fi-skl-6700hq    total:247  pass:212  dwarn:1   dfail:0   fail:0   skip:34 
fi-skl-6700k     total:247  pass:209  dwarn:3   dfail:0   fail:0   skip:35 
fi-skl-6770hq    total:247  pass:218  dwarn:1   dfail:0   fail:0   skip:28 
fi-snb-2520m     total:247  pass:200  dwarn:1   dfail:0   fail:0   skip:46 
fi-snb-2600      total:247  pass:199  dwarn:1   dfail:0   fail:0   skip:47 

1bc5ec1e0d7c411ccd38404de5b7b328620c82e4 drm-tip: 2016y-12m-06d-15h-09m-40s UTC integration manifest
b908481 drm/i915: Tidy load failure reporting

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3206/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2] drm/i915: Tidy load failure reporting
  2016-12-06 17:31 [PATCH] drm/i915: Tidy load failure reporting Tvrtko Ursulin
  2016-12-06 18:15 ` ✗ Fi.CI.BAT: warning for " Patchwork
@ 2016-12-06 19:00 ` Tvrtko Ursulin
  2016-12-06 22:12   ` Chris Wilson
  2016-12-06 20:22 ` ✓ Fi.CI.BAT: success for drm/i915: Tidy load failure reporting (rev2) Patchwork
  2016-12-07  7:15 ` ✓ Fi.CI.BAT: success for drm/i915: Tidy load failure reporting (rev3) Patchwork
  3 siblings, 1 reply; 7+ messages in thread
From: Tvrtko Ursulin @ 2016-12-06 19:00 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Several changes here:

 * Remove unused i915_report_error.
 * Unexport __i915_printk and rename it to i915_load_error,
   converting the latter from a macro to a static function.
 * Use drm_dev_printk instead of open-coding the same.

v2: Fix reversed error condition.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 45 +++++++++++++++++++----------------------
 drivers/gpu/drm/i915/i915_drv.h |  7 -------
 2 files changed, 21 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index ae583c79c19f..7217ecdb790d 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -68,52 +68,49 @@ bool __i915_inject_load_failure(const char *func, int line)
 	return false;
 }
 
+static bool i915_error_injected(struct drm_i915_private *dev_priv)
+{
+	return i915.inject_load_failure &&
+	       i915_load_fail_count == i915.inject_load_failure;
+}
+
 #define FDO_BUG_URL "https://bugs.freedesktop.org/enter_bug.cgi?product=DRI"
 #define FDO_BUG_MSG "Please file a bug at " FDO_BUG_URL " against DRM/Intel " \
 		    "providing the dmesg log by booting with drm.debug=0xf"
 
-void
-__i915_printk(struct drm_i915_private *dev_priv, const char *level,
-	      const char *fmt, ...)
+static void __printf(2, 3)
+i915_load_error(struct drm_i915_private *dev_priv, const char *fmt, ...)
 {
-	static bool shown_bug_once;
+	static bool shown_bug_once __read_mostly;
 	struct device *kdev = dev_priv->drm.dev;
-	bool is_error = level[1] <= KERN_ERR[1];
-	bool is_debug = level[1] == KERN_DEBUG[1];
+	char *level;
+	bool is_error;
 	struct va_format vaf;
 	va_list args;
 
-	if (is_debug && !(drm_debug & DRM_UT_DRIVER))
-		return;
+	if (i915_error_injected(dev_priv)) {
+		is_error = false;
+		level = KERN_DEBUG;
+	} else {
+		is_error = true;
+		level = KERN_ERR;
+	};
 
 	va_start(args, fmt);
 
 	vaf.fmt = fmt;
 	vaf.va = &args;
 
-	dev_printk(level, kdev, "[" DRM_NAME ":%ps] %pV",
-		   __builtin_return_address(0), &vaf);
+	drm_dev_printk(kdev, level, DRM_UT_DRIVER, __func__, "", fmt, &vaf);
+
+	va_end(args);
 
 	if (is_error && !shown_bug_once) {
 		dev_notice(kdev, "%s", FDO_BUG_MSG);
 		shown_bug_once = true;
 	}
-
-	va_end(args);
-}
-
-static bool i915_error_injected(struct drm_i915_private *dev_priv)
-{
-	return i915.inject_load_failure &&
-	       i915_load_fail_count == i915.inject_load_failure;
 }
 
-#define i915_load_error(dev_priv, fmt, ...)				     \
-	__i915_printk(dev_priv,						     \
-		      i915_error_injected(dev_priv) ? KERN_DEBUG : KERN_ERR, \
-		      fmt, ##__VA_ARGS__)
-
-
 static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
 {
 	enum intel_pch ret = PCH_NOP;
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 605247baa7d1..f523cdfa8636 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2766,13 +2766,6 @@ int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,
 bool intel_sanitize_semaphores(struct drm_i915_private *dev_priv, int value);
 
 /* i915_drv.c */
-void __printf(3, 4)
-__i915_printk(struct drm_i915_private *dev_priv, const char *level,
-	      const char *fmt, ...);
-
-#define i915_report_error(dev_priv, fmt, ...)				   \
-	__i915_printk(dev_priv, KERN_ERR, fmt, ##__VA_ARGS__)
-
 #ifdef CONFIG_COMPAT
 extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
 			      unsigned long arg);
-- 
2.7.4

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

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

* ✓ Fi.CI.BAT: success for drm/i915: Tidy load failure reporting (rev2)
  2016-12-06 17:31 [PATCH] drm/i915: Tidy load failure reporting Tvrtko Ursulin
  2016-12-06 18:15 ` ✗ Fi.CI.BAT: warning for " Patchwork
  2016-12-06 19:00 ` [PATCH v2] " Tvrtko Ursulin
@ 2016-12-06 20:22 ` Patchwork
  2016-12-07  7:15 ` ✓ Fi.CI.BAT: success for drm/i915: Tidy load failure reporting (rev3) Patchwork
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2016-12-06 20:22 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Tidy load failure reporting (rev2)
URL   : https://patchwork.freedesktop.org/series/16435/
State : success

== Summary ==

Series 16435v2 drm/i915: Tidy load failure reporting
https://patchwork.freedesktop.org/api/1.0/series/16435/revisions/2/mbox/


fi-bdw-5557u     total:247  pass:218  dwarn:0   dfail:0   fail:0   skip:29 
fi-bsw-n3050     total:247  pass:194  dwarn:0   dfail:0   fail:0   skip:53 
fi-byt-j1900     total:247  pass:205  dwarn:0   dfail:0   fail:0   skip:42 
fi-byt-n2820     total:247  pass:201  dwarn:0   dfail:0   fail:0   skip:46 
fi-hsw-4770      total:247  pass:213  dwarn:0   dfail:0   fail:0   skip:34 
fi-hsw-4770r     total:247  pass:213  dwarn:0   dfail:0   fail:0   skip:34 
fi-ilk-650       total:247  pass:180  dwarn:0   dfail:0   fail:0   skip:67 
fi-ivb-3520m     total:247  pass:212  dwarn:0   dfail:0   fail:0   skip:35 
fi-ivb-3770      total:247  pass:211  dwarn:0   dfail:0   fail:0   skip:36 
fi-kbl-7500u     total:247  pass:211  dwarn:0   dfail:0   fail:0   skip:36 
fi-skl-6260u     total:247  pass:219  dwarn:0   dfail:0   fail:0   skip:28 
fi-skl-6700hq    total:247  pass:213  dwarn:0   dfail:0   fail:0   skip:34 
fi-skl-6700k     total:247  pass:209  dwarn:3   dfail:0   fail:0   skip:35 
fi-skl-6770hq    total:247  pass:219  dwarn:0   dfail:0   fail:0   skip:28 
fi-snb-2520m     total:247  pass:201  dwarn:0   dfail:0   fail:0   skip:46 
fi-snb-2600      total:247  pass:200  dwarn:0   dfail:0   fail:0   skip:47 

08aa3ac5c18159c9105252903713cb21c27e9442 drm-tip: 2016y-12m-06d-18h-32m-52s UTC integration manifest
153190a drm/i915: Tidy load failure reporting

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3208/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2] drm/i915: Tidy load failure reporting
  2016-12-06 19:00 ` [PATCH v2] " Tvrtko Ursulin
@ 2016-12-06 22:12   ` Chris Wilson
  2016-12-07  6:57     ` [PATCH v3] " Tvrtko Ursulin
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2016-12-06 22:12 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: Intel-gfx

On Tue, Dec 06, 2016 at 07:00:26PM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Several changes here:
> 
>  * Remove unused i915_report_error.

The plan was to start using it for the more prominent errors. (Any and
every DRM_ERROR should be considered to be a userfacing error message
and incorporate a request to file a bug. Almost all need massaging to be
useful though.)

>  * Unexport __i915_printk and rename it to i915_load_error,
>    converting the latter from a macro to a static function.
>  * Use drm_dev_printk instead of open-coding the same.
> 
> v2: Fix reversed error condition.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 45 +++++++++++++++++++----------------------
>  drivers/gpu/drm/i915/i915_drv.h |  7 -------
>  2 files changed, 21 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index ae583c79c19f..7217ecdb790d 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -68,52 +68,49 @@ bool __i915_inject_load_failure(const char *func, int line)
>  	return false;
>  }
>  
> +static bool i915_error_injected(struct drm_i915_private *dev_priv)
> +{
> +	return i915.inject_load_failure &&
> +	       i915_load_fail_count == i915.inject_load_failure;
> +}
> +
>  #define FDO_BUG_URL "https://bugs.freedesktop.org/enter_bug.cgi?product=DRI"
>  #define FDO_BUG_MSG "Please file a bug at " FDO_BUG_URL " against DRM/Intel " \
>  		    "providing the dmesg log by booting with drm.debug=0xf"
>  
> -void
> -__i915_printk(struct drm_i915_private *dev_priv, const char *level,
> -	      const char *fmt, ...)
> +static void __printf(2, 3)
> +i915_load_error(struct drm_i915_private *dev_priv, const char *fmt, ...)
>  {
> -	static bool shown_bug_once;
> +	static bool shown_bug_once __read_mostly;
>  	struct device *kdev = dev_priv->drm.dev;
> -	bool is_error = level[1] <= KERN_ERR[1];
> -	bool is_debug = level[1] == KERN_DEBUG[1];
> +	char *level;
> +	bool is_error;
>  	struct va_format vaf;
>  	va_list args;
>  
> -	if (is_debug && !(drm_debug & DRM_UT_DRIVER))
> -		return;
> +	if (i915_error_injected(dev_priv)) {
> +		is_error = false;
> +		level = KERN_DEBUG;
> +	} else {
> +		is_error = true;
> +		level = KERN_ERR;
> +	};

Stray ';'

The drm_dev_printk replacement looks reasonable.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v3] drm/i915: Tidy load failure reporting
  2016-12-06 22:12   ` Chris Wilson
@ 2016-12-07  6:57     ` Tvrtko Ursulin
  0 siblings, 0 replies; 7+ messages in thread
From: Tvrtko Ursulin @ 2016-12-07  6:57 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Several changes here:

 * Remove unused i915_report_error.
 * Unexport __i915_printk and rename it to i915_load_error,
   converting the latter from a macro to a static function.
 * Use drm_dev_printk instead of open-coding the same.

v2: Fix reversed error condition.
v3: Remove stray semi-colon. (Chris Wilson)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 45 +++++++++++++++++++----------------------
 drivers/gpu/drm/i915/i915_drv.h |  7 -------
 2 files changed, 21 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index ae583c79c19f..e8b1cb123dae 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -68,52 +68,49 @@ bool __i915_inject_load_failure(const char *func, int line)
 	return false;
 }
 
+static bool i915_error_injected(struct drm_i915_private *dev_priv)
+{
+	return i915.inject_load_failure &&
+	       i915_load_fail_count == i915.inject_load_failure;
+}
+
 #define FDO_BUG_URL "https://bugs.freedesktop.org/enter_bug.cgi?product=DRI"
 #define FDO_BUG_MSG "Please file a bug at " FDO_BUG_URL " against DRM/Intel " \
 		    "providing the dmesg log by booting with drm.debug=0xf"
 
-void
-__i915_printk(struct drm_i915_private *dev_priv, const char *level,
-	      const char *fmt, ...)
+static void __printf(2, 3)
+i915_load_error(struct drm_i915_private *dev_priv, const char *fmt, ...)
 {
-	static bool shown_bug_once;
+	static bool shown_bug_once __read_mostly;
 	struct device *kdev = dev_priv->drm.dev;
-	bool is_error = level[1] <= KERN_ERR[1];
-	bool is_debug = level[1] == KERN_DEBUG[1];
+	char *level;
+	bool is_error;
 	struct va_format vaf;
 	va_list args;
 
-	if (is_debug && !(drm_debug & DRM_UT_DRIVER))
-		return;
+	if (i915_error_injected(dev_priv)) {
+		is_error = false;
+		level = KERN_DEBUG;
+	} else {
+		is_error = true;
+		level = KERN_ERR;
+	}
 
 	va_start(args, fmt);
 
 	vaf.fmt = fmt;
 	vaf.va = &args;
 
-	dev_printk(level, kdev, "[" DRM_NAME ":%ps] %pV",
-		   __builtin_return_address(0), &vaf);
+	drm_dev_printk(kdev, level, DRM_UT_DRIVER, __func__, "", fmt, &vaf);
+
+	va_end(args);
 
 	if (is_error && !shown_bug_once) {
 		dev_notice(kdev, "%s", FDO_BUG_MSG);
 		shown_bug_once = true;
 	}
-
-	va_end(args);
-}
-
-static bool i915_error_injected(struct drm_i915_private *dev_priv)
-{
-	return i915.inject_load_failure &&
-	       i915_load_fail_count == i915.inject_load_failure;
 }
 
-#define i915_load_error(dev_priv, fmt, ...)				     \
-	__i915_printk(dev_priv,						     \
-		      i915_error_injected(dev_priv) ? KERN_DEBUG : KERN_ERR, \
-		      fmt, ##__VA_ARGS__)
-
-
 static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
 {
 	enum intel_pch ret = PCH_NOP;
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 605247baa7d1..f523cdfa8636 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2766,13 +2766,6 @@ int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,
 bool intel_sanitize_semaphores(struct drm_i915_private *dev_priv, int value);
 
 /* i915_drv.c */
-void __printf(3, 4)
-__i915_printk(struct drm_i915_private *dev_priv, const char *level,
-	      const char *fmt, ...);
-
-#define i915_report_error(dev_priv, fmt, ...)				   \
-	__i915_printk(dev_priv, KERN_ERR, fmt, ##__VA_ARGS__)
-
 #ifdef CONFIG_COMPAT
 extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
 			      unsigned long arg);
-- 
2.7.4

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

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

* ✓ Fi.CI.BAT: success for drm/i915: Tidy load failure reporting (rev3)
  2016-12-06 17:31 [PATCH] drm/i915: Tidy load failure reporting Tvrtko Ursulin
                   ` (2 preceding siblings ...)
  2016-12-06 20:22 ` ✓ Fi.CI.BAT: success for drm/i915: Tidy load failure reporting (rev2) Patchwork
@ 2016-12-07  7:15 ` Patchwork
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2016-12-07  7:15 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Tidy load failure reporting (rev3)
URL   : https://patchwork.freedesktop.org/series/16435/
State : success

== Summary ==

Series 16435v3 drm/i915: Tidy load failure reporting
https://patchwork.freedesktop.org/api/1.0/series/16435/revisions/3/mbox/

Test drv_module_reload:
        Subgroup basic-reload-inject:
                incomplete -> PASS       (fi-kbl-7500u)

fi-bdw-5557u     total:247  pass:218  dwarn:0   dfail:0   fail:0   skip:29 
fi-bsw-n3050     total:247  pass:194  dwarn:0   dfail:0   fail:0   skip:53 
fi-bxt-t5700     total:247  pass:205  dwarn:0   dfail:0   fail:0   skip:42 
fi-byt-j1900     total:247  pass:205  dwarn:0   dfail:0   fail:0   skip:42 
fi-byt-n2820     total:247  pass:201  dwarn:0   dfail:0   fail:0   skip:46 
fi-hsw-4770      total:247  pass:213  dwarn:0   dfail:0   fail:0   skip:34 
fi-hsw-4770r     total:247  pass:213  dwarn:0   dfail:0   fail:0   skip:34 
fi-ilk-650       total:247  pass:180  dwarn:0   dfail:0   fail:0   skip:67 
fi-ivb-3520m     total:247  pass:212  dwarn:0   dfail:0   fail:0   skip:35 
fi-ivb-3770      total:247  pass:211  dwarn:0   dfail:0   fail:0   skip:36 
fi-kbl-7500u     total:247  pass:211  dwarn:0   dfail:0   fail:0   skip:36 
fi-skl-6260u     total:247  pass:219  dwarn:0   dfail:0   fail:0   skip:28 
fi-skl-6700hq    total:247  pass:213  dwarn:0   dfail:0   fail:0   skip:34 
fi-skl-6700k     total:247  pass:209  dwarn:3   dfail:0   fail:0   skip:35 
fi-skl-6770hq    total:247  pass:219  dwarn:0   dfail:0   fail:0   skip:28 
fi-snb-2520m     total:247  pass:201  dwarn:0   dfail:0   fail:0   skip:46 
fi-snb-2600      total:247  pass:200  dwarn:0   dfail:0   fail:0   skip:47 

f6eb1c22f17fb3aa43bfcce1715d576f656011da drm-tip: 2016y-12m-07d-03h-14m-42s UTC integration manifest
ea3eee9 drm/i915: Tidy load failure reporting

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3211/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-12-07  7:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-06 17:31 [PATCH] drm/i915: Tidy load failure reporting Tvrtko Ursulin
2016-12-06 18:15 ` ✗ Fi.CI.BAT: warning for " Patchwork
2016-12-06 19:00 ` [PATCH v2] " Tvrtko Ursulin
2016-12-06 22:12   ` Chris Wilson
2016-12-07  6:57     ` [PATCH v3] " Tvrtko Ursulin
2016-12-06 20:22 ` ✓ Fi.CI.BAT: success for drm/i915: Tidy load failure reporting (rev2) Patchwork
2016-12-07  7:15 ` ✓ Fi.CI.BAT: success for drm/i915: Tidy load failure reporting (rev3) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox