From patchwork Fri Feb 20 05:33:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 5854541 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 659549F399 for ; Fri, 20 Feb 2015 05:34:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E72720375 for ; Fri, 20 Feb 2015 05:34:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 38C7920374 for ; Fri, 20 Feb 2015 05:34:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BA4DD6E650; Thu, 19 Feb 2015 21:34:47 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id D554D6E64F for ; Thu, 19 Feb 2015 21:34:45 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 19 Feb 2015 21:34:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,612,1418112000"; d="scan'208";a="680732382" Received: from rmatwood-mobl.amr.corp.intel.com (HELO gibson.intel.com) ([10.252.128.65]) by fmsmga002.fm.intel.com with ESMTP; 19 Feb 2015 21:33:33 -0800 From: Ben Widawsky To: Intel GFX Date: Thu, 19 Feb 2015 21:33:32 -0800 Message-Id: <1424410412-24910-2-git-send-email-benjamin.widawsky@intel.com> X-Mailer: git-send-email 2.3.0 In-Reply-To: <1424410412-24910-1-git-send-email-benjamin.widawsky@intel.com> References: <1424410412-24910-1-git-send-email-benjamin.widawsky@intel.com> Cc: Ben Widawsky , Ben Widawsky Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Add the last written reg to error state 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Signed-off-by: Ben Widawsky Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_gpu_error.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 6fa22db..49bc296 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -323,6 +323,7 @@ struct drm_i915_error_state { struct timeval time; char error_msg[128]; + u32 last_written[NR_CPUS]; 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 2c87a79..f7737c5 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -356,6 +356,9 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m, error->ring[i].pid); } } + for_each_possible_cpu(i) + err_printf(m, "Last written register (cpu=%d): 0x%08x\n", + i, error->last_written[i]); err_printf(m, "Reset count: %u\n", error->reset_count); err_printf(m, "Suspend count: %u\n", error->suspend_count); err_printf(m, "PCI ID: 0x%04x\n", dev->pdev->device); @@ -1253,6 +1256,13 @@ static void i915_error_capture_msg(struct drm_device *dev, wedged ? "reset" : "continue"); } +static void i915_capture_cpu_state(struct drm_i915_error_state *error) +{ + int cpu; + for_each_possible_cpu(cpu) + error->last_written[cpu] = per_cpu(i915_last_written, cpu); +} + static void i915_capture_gen_state(struct drm_i915_private *dev_priv, struct drm_i915_error_state *error) { @@ -1286,6 +1296,7 @@ void i915_capture_error_state(struct drm_device *dev, bool wedged, kref_init(&error->ref); + i915_capture_cpu_state(error); i915_capture_gen_state(dev_priv, error); i915_capture_reg_state(dev_priv, error); i915_gem_capture_buffers(dev_priv, error);