From patchwork Fri May 8 13:39:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 6365761 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 DEA2D9F1C2 for ; Fri, 8 May 2015 13:40:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 093C1201F2 for ; Fri, 8 May 2015 13:40:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 10414201DD for ; Fri, 8 May 2015 13:40:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9DA9A6E93E; Fri, 8 May 2015 06:40:32 -0700 (PDT) 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 1162C6E93E for ; Fri, 8 May 2015 06:40:31 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 08 May 2015 06:40:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,391,1427785200"; d="scan'208";a="722829143" Received: from rosetta.fi.intel.com (HELO rosetta) ([10.237.72.80]) by fmsmga002.fm.intel.com with ESMTP; 08 May 2015 06:40:29 -0700 Received: by rosetta (Postfix, from userid 1000) id 0CC4C80084; Fri, 8 May 2015 16:39:59 +0300 (EEST) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Fri, 8 May 2015 16:39:55 +0300 Message-Id: <1431092395-23930-2-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431092395-23930-1-git-send-email-mika.kuoppala@intel.com> References: <1431092395-23930-1-git-send-email-mika.kuoppala@intel.com> Cc: miku@iki.fi Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Make hangcheck logging more compact 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 With commit aaecdf611a05 ("drm/i915: Stop gathering error states for CS error interrupts") we only call i915_handle_error() on call sites where there is a stuck/hung gpu. So there is no more need to carry around extra information into dmesg. Emit one loud bang into dmesg with first hanging ring as culprit. Rest of the details will be in error state. Based-on-patch-by: Chris Wilson Signed-off-by: Mika Kuoppala Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) --- drivers/gpu/drm/i915/i915_gpu_error.c | 4 +--- drivers/gpu/drm/i915/i915_irq.c | 26 ++++++++------------------ 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 9c0db19..292cf1f 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -1251,9 +1251,7 @@ static void i915_error_capture_msg(struct drm_device *dev, error->ring[ring_id].pid); scnprintf(error->error_msg + len, sizeof(error->error_msg) - len, - ", reason: %s, action: %s", - error_msg, - wedged ? "reset" : "continue"); + ", %s", error_msg); } static void i915_capture_gen_state(struct drm_i915_private *dev_priv, diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index a3244bd..a3b5001 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -2924,14 +2924,12 @@ static bool check_for_missed_irq(struct intel_engine_cs *ring) return true; } -static bool hangcheck_handle_stuck_ring(struct intel_engine_cs *ring, u64 acthd) +static void hangcheck_handle_stuck_ring(struct intel_engine_cs *ring, u64 acthd) { #define BUSY 1 #define KICK 5 #define HUNG 20 - struct intel_ring_hangcheck *hc = &ring->hangcheck; - bool there_is_hope = true; /* We always increment the hangcheck score * if the ring is busy and still processing @@ -2964,11 +2962,8 @@ static bool hangcheck_handle_stuck_ring(struct intel_engine_cs *ring, u64 acthd) break; case HANGCHECK_HUNG: hc->score += HUNG; - there_is_hope = false; break; } - - return there_is_hope; } /* @@ -2987,8 +2982,7 @@ static void i915_hangcheck_elapsed(struct work_struct *work) struct drm_device *dev = dev_priv->dev; struct intel_engine_cs *ring; int i; - int busy_count = 0, rings_hung = 0; - bool stuck[I915_NUM_RINGS] = { 0 }; + int busy_count = 0, ring_hung = -1; if (!i915.enable_hangcheck) return; @@ -3043,19 +3037,15 @@ engine_check_done: hc->acthd = acthd; hc->start = start; busy_count += busy; - } - for_each_ring(ring, dev_priv, i) { - if (ring->hangcheck.score >= HANGCHECK_SCORE_RING_HUNG) { - DRM_INFO("%s on %s\n", - stuck[i] ? "stuck" : "no progress", - ring->name); - rings_hung++; - } + if (ring_hung == -1 && + ring->hangcheck.score >= HANGCHECK_SCORE_RING_HUNG) + ring_hung = i; } - if (rings_hung) - return i915_handle_error(dev, true, "Ring hung"); + if (ring_hung != -1) + return i915_handle_error(dev, true, "%s hung", + dev_priv->ring[ring_hung].name); if (busy_count) /* Reset timer case chip hangs without another request