drm/i915: Add a sunset clause to GPU hang logging
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 14 Oct 2016 13:44:28 +0000 (14:44 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 20 Oct 2016 13:07:22 +0000 (14:07 +0100)
If the kernel is old, more than a few releases old, chances are that the
user is using an old kernel for a good reason, despite there being GPU
hangs. After 180days since driver release stop suggesting that they
should send those reports upstream.

[Since Daniel acked this I expect he will pick up the dim patch to
automatically update the DRIVER_TIMESTAMP everytime we tag a new
release.]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161014134428.29582-1-chris@chris-wilson.co.uk
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gpu_error.c

index b339c916f7a98329f312f8d088bd3e9b9537be93..c278c5af6174531617c835be7e50e4443747ce37 100644 (file)
@@ -71,6 +71,7 @@
 #define DRIVER_NAME            "i915"
 #define DRIVER_DESC            "Intel Graphics"
 #define DRIVER_DATE            "20161010"
+#define DRIVER_TIMESTAMP       1476452087
 
 #undef WARN_ON
 /* Many gcc seem to no see through this and fall over :( */
index a8ce358850d12959e5eae22386113d8e5aa3f9ea..242b9a92789921fe05522600b6e68825cec37671 100644 (file)
@@ -1541,6 +1541,8 @@ static int capture(void *data)
        return 0;
 }
 
+#define DAY_AS_SECONDS(x) (24 * 60 * 60 * (x))
+
 /**
  * i915_capture_error_state - capture an error record for later analysis
  * @dev: drm device
@@ -1593,7 +1595,8 @@ void i915_capture_error_state(struct drm_i915_private *dev_priv,
                return;
        }
 
-       if (!warned) {
+       if (!warned &&
+           ktime_get_real_seconds() - DRIVER_TIMESTAMP < DAY_AS_SECONDS(180)) {
                DRM_INFO("GPU hangs can indicate a bug anywhere in the entire gfx stack, including userspace.\n");
                DRM_INFO("Please file a _new_ bug report on bugs.freedesktop.org against DRI -> DRM/Intel\n");
                DRM_INFO("drm/i915 developers can then reassign to the right component if it's not a kernel issue.\n");