From patchwork Thu Nov 6 11:03:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 5240951 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2E051C11AC for ; Thu, 6 Nov 2014 11:01:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5373D2010C for ; Thu, 6 Nov 2014 11:01:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6908020109 for ; Thu, 6 Nov 2014 11:01:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7C326E008; Thu, 6 Nov 2014 03:01:06 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id A744F6E008 for ; Thu, 6 Nov 2014 03:01:05 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 06 Nov 2014 03:01:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="412356166" Received: from rosetta.fi.intel.com (HELO rosetta) ([10.237.72.83]) by FMSMGA003.fm.intel.com with ESMTP; 06 Nov 2014 02:52:30 -0800 Received: by rosetta (Postfix, from userid 1000) id A7B9C80054; Thu, 6 Nov 2014 13:03:51 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Thu, 6 Nov 2014 13:03:47 +0200 Message-Id: <1415271827-19647-2-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415271827-19647-1-git-send-email-mika.kuoppala@intel.com> References: <1415271827-19647-1-git-send-email-mika.kuoppala@intel.com> Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Capture module params on hang X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP as it helps with bug triaging. Suggested-by: Chris Wilson Signed-off-by: Mika Kuoppala --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_gpu_error.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 0f00e58..c0ae57c 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -339,6 +339,7 @@ struct drm_i915_error_state { struct timeval time; char error_msg[128]; + char module_params_msg[1024]; u32 reset_count; u32 suspend_count; diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 89a2f3d..c5e55b3 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -342,6 +342,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m, err_printf(m, "Time: %ld s %ld us\n", error->time.tv_sec, error->time.tv_usec); err_printf(m, "Kernel: " UTS_RELEASE "\n"); + err_printf(m, "Module params: %s\n", error->module_params_msg); max_hangcheck_score = 0; for (i = 0; i < ARRAY_SIZE(error->ring); i++) { if (error->ring[i].hangcheck_score > max_hangcheck_score) @@ -1258,6 +1259,34 @@ static void i915_error_capture_msg(struct drm_device *dev, wedged ? "reset" : "continue"); } +static void i915_error_capture_module_params(struct drm_i915_error_state *error) +{ + const struct module *m = THIS_MODULE; + int i, len; + char *buf; + + if (!m) + return; + + buf = kmalloc(4096, GFP_ATOMIC); + if (buf == NULL) + return; + + for (i = 0, len = 0; i < m->num_kp; i++) { + if (!m->kp[i].ops || !m->kp[i].ops->get || + m->kp[i].ops->get(buf, &m->kp[i]) <= 0) + continue; + + len += scnprintf(error->module_params_msg + len, + sizeof(error->module_params_msg) - len, + "%s=%s ", + m->kp[i].name, + buf); + } + + kfree(buf); +} + static void i915_capture_gen_state(struct drm_i915_private *dev_priv, struct drm_i915_error_state *error) { @@ -1303,7 +1332,10 @@ void i915_capture_error_state(struct drm_device *dev, bool wedged, error->display = intel_display_capture_error_state(dev); i915_error_capture_msg(dev, error, wedged, error_msg); + i915_error_capture_module_params(error); + DRM_INFO("%s\n", error->error_msg); + DRM_INFO("%s\n", error->module_params_msg); spin_lock_irqsave(&dev_priv->gpu_error.lock, flags); if (dev_priv->gpu_error.first_error == NULL) {