intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: hangcheck disable parameter
@ 2011-06-29 17:26 Ben Widawsky
  2011-06-29 17:41 ` Keith Packard
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Widawsky @ 2011-06-29 17:26 UTC (permalink / raw)
  To: Keith Packard; +Cc: intel-gfx

Provide a parameter to disable hanghcheck. This is useful mostly for
developers trying to debug known problems, and probably should not be
touched by normal users.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_drv.c |    3 +++
 drivers/gpu/drm/i915/i915_drv.h |    1 +
 drivers/gpu/drm/i915/i915_gem.c |    7 +++++--
 drivers/gpu/drm/i915/i915_irq.c |   13 +++++++++----
 4 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 609358f..b54f7d9 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -70,6 +70,9 @@ module_param_named(vbt_sdvo_panel_type, i915_vbt_sdvo_panel_type, int, 0600);
 static bool i915_try_reset = true;
 module_param_named(reset, i915_try_reset, bool, 0600);
 
+bool i915_enable_hangcheck = true;
+module_param_named(enable_hangcheck, i915_enable_hangcheck, bool, 0644);
+
 static struct drm_driver driver;
 extern int intel_agp_enabled;
 
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 01affb63..e0f9ca3 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -994,6 +994,7 @@ extern unsigned int i915_panel_use_ssc;
 extern int i915_vbt_sdvo_panel_type;
 extern unsigned int i915_enable_rc6;
 extern unsigned int i915_enable_fbc;
+extern bool i915_enable_hangcheck;
 
 extern int i915_suspend(struct drm_device *dev, pm_message_t state);
 extern int i915_resume(struct drm_device *dev);
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 71cc8a3..8b670e7 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1779,8 +1779,11 @@ i915_add_request(struct intel_ring_buffer *ring,
 	ring->outstanding_lazy_request = false;
 
 	if (!dev_priv->mm.suspended) {
-		mod_timer(&dev_priv->hangcheck_timer,
-			  jiffies + msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
+		if (i915_enable_hangcheck) {
+			mod_timer(&dev_priv->hangcheck_timer,
+				  jiffies +
+				  msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
+		}
 		if (was_empty)
 			queue_delayed_work(dev_priv->wq,
 					   &dev_priv->mm.retire_work, HZ);
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index ae2b499..0b0de52 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -361,10 +361,12 @@ static void notify_ring(struct drm_device *dev,
 
 	ring->irq_seqno = seqno;
 	wake_up_all(&ring->irq_queue);
-
-	dev_priv->hangcheck_count = 0;
-	mod_timer(&dev_priv->hangcheck_timer,
-		  jiffies + msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
+	if (i915_enable_hangcheck) {
+		dev_priv->hangcheck_count = 0;
+		mod_timer(&dev_priv->hangcheck_timer,
+			  jiffies +
+			  msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
+	}
 }
 
 static void gen6_pm_rps_work(struct work_struct *work)
@@ -1664,6 +1666,9 @@ void i915_hangcheck_elapsed(unsigned long data)
 	uint32_t acthd, instdone, instdone1;
 	bool err = false;
 
+	if (!i915_enable_hangcheck)
+		return;
+
 	/* If all work is done then ACTHD clearly hasn't advanced. */
 	if (i915_hangcheck_ring_idle(&dev_priv->ring[RCS], &err) &&
 	    i915_hangcheck_ring_idle(&dev_priv->ring[VCS], &err) &&
-- 
1.7.5.2

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

* Re: [PATCH] drm/i915: hangcheck disable parameter
  2011-06-29 17:26 [PATCH] drm/i915: hangcheck disable parameter Ben Widawsky
@ 2011-06-29 17:41 ` Keith Packard
  0 siblings, 0 replies; 5+ messages in thread
From: Keith Packard @ 2011-06-29 17:41 UTC (permalink / raw)
  To: Ben Widawsky; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 321 bytes --]

On Wed, 29 Jun 2011 10:26:42 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:

> Provide a parameter to disable hanghcheck. This is useful mostly for
> developers trying to debug known problems, and probably should not be
> touched by normal users.

I've merged this to drm-intel-next

-- 
keith.packard@intel.com

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

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

* Re: [PATCH] drm/i915: hangcheck disable parameter
  2011-06-29  0:09 Ben Widawsky
  2011-06-29  8:26 ` Chris Wilson
@ 2011-07-02  8:04 ` Julien Cristau
  1 sibling, 0 replies; 5+ messages in thread
From: Julien Cristau @ 2011-07-02  8:04 UTC (permalink / raw)
  To: Ben Widawsky; +Cc: intel-gfx

On Tue, Jun 28, 2011 at 17:09:54 -0700, Ben Widawsky wrote:

> Provide a parameter to disable hanghcheck. This is useful mostly for
> developers trying to debug known problems, and probably should not be
> touched by normal users.
> 
Something like this could maybe find its way into a MODULE_PARM_DESC?

Actually it looks like none of the i915 parameters have a description :(

Cheers,
Julien

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

* Re: [PATCH] drm/i915: hangcheck disable parameter
  2011-06-29  0:09 Ben Widawsky
@ 2011-06-29  8:26 ` Chris Wilson
  2011-07-02  8:04 ` Julien Cristau
  1 sibling, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2011-06-29  8:26 UTC (permalink / raw)
  To: Ben Widawsky, intel-gfx

On Tue, 28 Jun 2011 17:09:54 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:
> Provide a parameter to disable hanghcheck. This is useful mostly for
> developers trying to debug known problems, and probably should not be
> touched by normal users.

Looks good, comments inline.

> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> ---
>  drivers/gpu/drm/i915/i915_dma.c |    2 ++
>  drivers/gpu/drm/i915/i915_drv.c |    3 +++
>  drivers/gpu/drm/i915/i915_gem.c |    9 +++++++--
>  drivers/gpu/drm/i915/i915_irq.c |   17 +++++++++++++----
>  4 files changed, 25 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index 2b79588..279e357 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -43,6 +43,8 @@
>  #include <linux/slab.h>
>  #include <acpi/video.h>
>  
> +extern unsigned int i915_enable_hangcheck;

Put this in i915_drv.h along with the other module parameters. And
consider making it __read_mostly.

>  static void gen6_pm_rps_work(struct work_struct *work)
> @@ -1664,6 +1668,11 @@ void i915_hangcheck_elapsed(unsigned long data)
>  	uint32_t acthd, instdone, instdone1;
>  	bool err = false;
>  
> +	if (!i915_enable_hangcheck) {
> +		DRM_DEBUG_DRIVER("Ignoring disabled hangcheck\n");

I'm not convinced of the value of this debug message since it is 99%
likely to occur after setting the i915_enable_hangcheck to 0 and just
means that the timer expired and nothing more.

DRM_DEBUG_DRIVER("Hangcheck disabled per user request\n");
is marginally more informative.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

* [PATCH] drm/i915: hangcheck disable parameter
@ 2011-06-29  0:09 Ben Widawsky
  2011-06-29  8:26 ` Chris Wilson
  2011-07-02  8:04 ` Julien Cristau
  0 siblings, 2 replies; 5+ messages in thread
From: Ben Widawsky @ 2011-06-29  0:09 UTC (permalink / raw)
  To: intel-gfx

Provide a parameter to disable hanghcheck. This is useful mostly for
developers trying to debug known problems, and probably should not be
touched by normal users.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_dma.c |    2 ++
 drivers/gpu/drm/i915/i915_drv.c |    3 +++
 drivers/gpu/drm/i915/i915_gem.c |    9 +++++++--
 drivers/gpu/drm/i915/i915_irq.c |   17 +++++++++++++----
 4 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 2b79588..279e357 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -43,6 +43,8 @@
 #include <linux/slab.h>
 #include <acpi/video.h>
 
+extern unsigned int i915_enable_hangcheck;
+
 static void i915_write_hws_pga(struct drm_device *dev)
 {
 	drm_i915_private_t *dev_priv = dev->dev_private;
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 609358f..8aebe26 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -70,6 +70,9 @@ module_param_named(vbt_sdvo_panel_type, i915_vbt_sdvo_panel_type, int, 0600);
 static bool i915_try_reset = true;
 module_param_named(reset, i915_try_reset, bool, 0600);
 
+unsigned int i915_enable_hangcheck = 1;
+module_param_named(enable_hangcheck, i915_enable_hangcheck, int, 0644);
+
 static struct drm_driver driver;
 extern int intel_agp_enabled;
 
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 71cc8a3..2670a69 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -35,6 +35,8 @@
 #include <linux/swap.h>
 #include <linux/pci.h>
 
+extern bool i915_enable_hangcheck;
+
 static __must_check int i915_gem_object_flush_gpu_write_domain(struct drm_i915_gem_object *obj);
 static void i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj);
 static void i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj);
@@ -1779,8 +1781,11 @@ i915_add_request(struct intel_ring_buffer *ring,
 	ring->outstanding_lazy_request = false;
 
 	if (!dev_priv->mm.suspended) {
-		mod_timer(&dev_priv->hangcheck_timer,
-			  jiffies + msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
+		if (i915_enable_hangcheck) {
+			mod_timer(&dev_priv->hangcheck_timer,
+				  jiffies +
+				  msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
+		}
 		if (was_empty)
 			queue_delayed_work(dev_priv->wq,
 					   &dev_priv->mm.retire_work, HZ);
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index ae2b499..b0d71d0 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -64,6 +64,8 @@
 #define DRM_I915_VBLANK_PIPE_ALL	(DRM_I915_VBLANK_PIPE_A | \
 					 DRM_I915_VBLANK_PIPE_B)
 
+extern bool i915_enable_hangcheck;
+
 /* For display hotplug interrupt */
 static void
 ironlake_enable_display_irq(drm_i915_private_t *dev_priv, u32 mask)
@@ -361,10 +363,12 @@ static void notify_ring(struct drm_device *dev,
 
 	ring->irq_seqno = seqno;
 	wake_up_all(&ring->irq_queue);
-
-	dev_priv->hangcheck_count = 0;
-	mod_timer(&dev_priv->hangcheck_timer,
-		  jiffies + msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
+	if (i915_enable_hangcheck) {
+		dev_priv->hangcheck_count = 0;
+		mod_timer(&dev_priv->hangcheck_timer,
+			  jiffies +
+			  msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
+	}
 }
 
 static void gen6_pm_rps_work(struct work_struct *work)
@@ -1664,6 +1668,11 @@ void i915_hangcheck_elapsed(unsigned long data)
 	uint32_t acthd, instdone, instdone1;
 	bool err = false;
 
+	if (!i915_enable_hangcheck) {
+		DRM_DEBUG_DRIVER("Ignoring disabled hangcheck\n");
+		return;
+	}
+
 	/* If all work is done then ACTHD clearly hasn't advanced. */
 	if (i915_hangcheck_ring_idle(&dev_priv->ring[RCS], &err) &&
 	    i915_hangcheck_ring_idle(&dev_priv->ring[VCS], &err) &&
-- 
1.7.5.2

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

end of thread, other threads:[~2011-07-02  8:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-29 17:26 [PATCH] drm/i915: hangcheck disable parameter Ben Widawsky
2011-06-29 17:41 ` Keith Packard
  -- strict thread matches above, loose matches on Subject: below --
2011-06-29  0:09 Ben Widawsky
2011-06-29  8:26 ` Chris Wilson
2011-07-02  8:04 ` Julien Cristau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).