From patchwork Mon Sep 14 21:48:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gamari X-Patchwork-Id: 47479 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8ELn8Ja032313 for ; Mon, 14 Sep 2009 21:49:08 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 491319F4F7; Mon, 14 Sep 2009 14:49:08 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from qw-out-1920.google.com (qw-out-1920.google.com [74.125.92.147]) by gabe.freedesktop.org (Postfix) with ESMTP id A04D89F4E5 for ; Mon, 14 Sep 2009 14:49:03 -0700 (PDT) Received: by qw-out-1920.google.com with SMTP id 4so1001610qwk.12 for ; Mon, 14 Sep 2009 14:49:03 -0700 (PDT) Received: by 10.224.91.131 with SMTP id n3mr5638525qam.369.1252964943709; Mon, 14 Sep 2009 14:49:03 -0700 (PDT) Received: from localhost.localdomain ([128.119.194.104]) by mx.google.com with ESMTPS id 20sm2140955qyk.9.2009.09.14.14.49.02 (version=SSLv3 cipher=RC4-MD5); Mon, 14 Sep 2009 14:49:02 -0700 (PDT) From: Ben Gamari To: Jesse Barnes , Chris Wilson Date: Mon, 14 Sep 2009 17:48:46 -0400 Message-Id: <1252964927-28043-7-git-send-email-bgamari.foss@gmail.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1252964927-28043-6-git-send-email-bgamari.foss@gmail.com> References: <1252964927-28043-1-git-send-email-bgamari.foss@gmail.com> <1252964927-28043-2-git-send-email-bgamari.foss@gmail.com> <1252964927-28043-3-git-send-email-bgamari.foss@gmail.com> <1252964927-28043-4-git-send-email-bgamari.foss@gmail.com> <1252964927-28043-5-git-send-email-bgamari.foss@gmail.com> <1252964927-28043-6-git-send-email-bgamari.foss@gmail.com> Cc: intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 6/8] drm/i915: Hookup chip reset in error handler X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org This patch uses the previously introduced chip reset logic to reset the chip when an error event is detected. Signed-off-by: Ben Gamari --- drivers/gpu/drm/i915/i915_irq.c | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 2a042bc..8f52766 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -302,12 +302,25 @@ static void i915_error_work_func(struct work_struct *work) drm_i915_private_t *dev_priv = container_of(work, drm_i915_private_t, error_work); struct drm_device *dev = dev_priv->dev; - char *event_string = "ERROR=1"; - char *envp[] = { event_string, NULL }; + char *error_event[] = { "ERROR=1", NULL }; + char *reset_event[] = { "RESET=1", NULL }; + char *reset_done_event[] = { "ERROR=0", NULL }; DRM_DEBUG("generating error event\n"); + kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, error_event); - kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, envp); + if (dev_priv->mm.wedged) { + if (IS_I965G(dev)) { + DRM_DEBUG("resetting chip\n"); + kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, reset_event); + if (!i965_reset(dev, GDRST_RENDER)) { + dev_priv->mm.wedged = 0; + kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, reset_done_event); + } + } else { + printk("reboot required\n"); + } + } } /**