diff mbox

[6/6] drm/i915: Hookup chip reset in error handler

Message ID 1252853462-9236-7-git-send-email-bgamari.foss@gmail.com (mailing list archive)
State Superseded
Headers show

Commit Message

Ben Gamari Sept. 13, 2009, 2:51 p.m. UTC
This patch uses the previously introduced chip reset logic to reset the
chip when an error event is detected.

Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
---
 drivers/gpu/drm/i915/i915_irq.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

Comments

Jesse Barnes Sept. 13, 2009, 5:06 p.m. UTC | #1
On Sun, 13 Sep 2009 10:51:02 -0400
Ben Gamari <bgamari.foss@gmail.com> wrote:

> This patch uses the previously introduced chip reset logic to reset
> the chip when an error event is detected.
> 
> Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
> ---
>  drivers/gpu/drm/i915/i915_irq.c |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c
> b/drivers/gpu/drm/i915/i915_irq.c index dbfcf0a..43bfb36 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -308,6 +308,18 @@ static void i915_error_work_func(struct
> work_struct *work) DRM_DEBUG("generating error event\n");
>  
>  	kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE,
> envp); +
> +	if (dev_priv->mm.wedged) {
> +		printk(KERN_ERR "GPU hang detected...");
> +		if (IS_I965G(dev)) {
> +			printk("resetting...");
> +			i965_reset(dev, GDRST_RENDER);
> +			printk("done.\n");
> +			dev_priv->mm.wedged = 0;
> +		} else {
> +			printk("reboot required\n");
> +		}
> +	}
>  }

We have the uevents now at error detect time right?  We should probably
send a uevent here too and remove the printks (or just make them into
debug or warning printks instead).

Thanks,
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index dbfcf0a..43bfb36 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -308,6 +308,18 @@  static void i915_error_work_func(struct work_struct *work)
 	DRM_DEBUG("generating error event\n");
 
 	kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, envp);
+
+	if (dev_priv->mm.wedged) {
+		printk(KERN_ERR "GPU hang detected...");
+		if (IS_I965G(dev)) {
+			printk("resetting...");
+			i965_reset(dev, GDRST_RENDER);
+			printk("done.\n");
+			dev_priv->mm.wedged = 0;
+		} else {
+			printk("reboot required\n");
+		}
+	}
 }
 
 /**