From patchwork Wed Feb 10 15:50:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: arun.siluvery@linux.intel.com X-Patchwork-Id: 8272971 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 47E4FBEEE5 for ; Wed, 10 Feb 2016 15:50:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 519A220155 for ; Wed, 10 Feb 2016 15:50:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 535642039E for ; Wed, 10 Feb 2016 15:50:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E7F866E71F; Wed, 10 Feb 2016 07:50:27 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTP id DDE346E71D for ; Wed, 10 Feb 2016 07:50:25 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP; 10 Feb 2016 07:50:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,426,1449561600"; d="scan'208";a="45646767" Received: from asiluver-linux.isw.intel.com ([10.102.226.117]) by fmsmga004.fm.intel.com with ESMTP; 10 Feb 2016 07:50:24 -0800 From: Arun Siluvery To: intel-gfx@lists.freedesktop.org Date: Wed, 10 Feb 2016 15:50:08 +0000 Message-Id: <1455119410-17283-8-git-send-email-arun.siluvery@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455119410-17283-1-git-send-email-arun.siluvery@linux.intel.com> References: <1455119410-17283-1-git-send-email-arun.siluvery@linux.intel.com> Cc: Mika Kuoppala Subject: [Intel-gfx] [PATCH v2 7/9] drm/i915/guc: Improve action error reporting 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.4 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 From: Dave Gordon For: VIZ-2021 Signed-off-by: Dave Gordon Signed-off-by: Arun Siluvery --- drivers/gpu/drm/i915/i915_debugfs.c | 17 ++++++++++------- drivers/gpu/drm/i915/i915_guc_submission.c | 20 ++++++++++++-------- drivers/gpu/drm/i915/intel_guc.h | 9 +++++++-- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index ec0c2a05e..2a326ad 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -2495,19 +2495,22 @@ static int i915_guc_info(struct seq_file *m, void *data) mutex_unlock(&dev->struct_mutex); seq_printf(m, "GuC total action count: %llu\n", guc.action_count); - seq_printf(m, "GuC action failure count: %u\n", guc.action_fail); seq_printf(m, "GuC last action command: 0x%x\n", guc.action_cmd); seq_printf(m, "GuC last action status: 0x%x\n", guc.action_status); - seq_printf(m, "GuC last action error code: %d\n", guc.action_err); + + seq_printf(m, "GuC action failure count: %u\n", guc.action_fail_count); + seq_printf(m, "GuC last failed action: 0x%x\n", guc.action_fail_cmd); + seq_printf(m, "GuC last failed status: 0x%x\n", guc.action_fail_status); + seq_printf(m, "GuC last error code: %d\n", guc.action_err); seq_printf(m, "\nGuC submissions:\n"); for_each_ring(ring, dev_priv, i) { - seq_printf(m, "\t%-24s: %10llu, last seqno 0x%08x\n", - ring->name, guc.submissions[ring->guc_id], - guc.last_seqno[ring->guc_id]); - total += guc.submissions[ring->guc_id]; + seq_printf(m, "\t%-24s: %10llu, last %-8s 0x%08x %9d\n", + ring->name, guc.submissions[i], "seqno", + guc.last_seqno[i], guc.last_seqno[i]); + total += guc.submissions[i]; } - seq_printf(m, "\t%s: %llu\n", "Total", total); + seq_printf(m, "\t%s: %10llu\n", "Total regular", total); seq_printf(m, "\nGuC execbuf client @ %p:\n", guc.execbuf_client); i915_guc_client_info(m, dev_priv, &client); diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c index d7543ef..8b0a34d 100644 --- a/drivers/gpu/drm/i915/i915_guc_submission.c +++ b/drivers/gpu/drm/i915/i915_guc_submission.c @@ -78,9 +78,8 @@ static inline bool host2guc_action_response(struct drm_i915_private *dev_priv, static int host2guc_action(struct intel_guc *guc, u32 *data, u32 len) { struct drm_i915_private *dev_priv = guc_to_i915(guc); - u32 status; - int i; - int ret; + u32 status, response; + int ret, i; if (WARN_ON(len < 1 || len > 15)) return -EINVAL; @@ -99,6 +98,8 @@ static int host2guc_action(struct intel_guc *guc, u32 *data, u32 len) /* No HOST2GUC command should take longer than 10ms */ ret = wait_for_atomic(host2guc_action_response(dev_priv, &status), 10); + response = I915_READ(SOFT_SCRATCH(15)); + dev_priv->guc.action_status = status; if (status != GUC2HOST_STATUS_SUCCESS) { /* * Either the GuC explicitly returned an error (which @@ -108,15 +109,15 @@ static int host2guc_action(struct intel_guc *guc, u32 *data, u32 len) if (ret != -ETIMEDOUT) ret = -EIO; - DRM_ERROR("GUC: host2guc action 0x%X failed. ret=%d " + DRM_ERROR("GuC: host2guc action 0x%X failed. ret=%d " "status=0x%08X response=0x%08X\n", - data[0], ret, status, - I915_READ(SOFT_SCRATCH(15))); + data[0], ret, status, response); - dev_priv->guc.action_fail += 1; + dev_priv->guc.action_fail_count += 1; + dev_priv->guc.action_fail_cmd = data[0]; + dev_priv->guc.action_fail_status = status; dev_priv->guc.action_err = ret; } - dev_priv->guc.action_status = status; intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL); @@ -589,6 +590,9 @@ int i915_guc_submit(struct i915_guc_client *client, guc->submissions[engine_id] += 1; guc->last_seqno[engine_id] = rq->seqno; + if (q_ret) + guc->failures[engine_id] += 1; + return q_ret; } diff --git a/drivers/gpu/drm/i915/intel_guc.h b/drivers/gpu/drm/i915/intel_guc.h index 73002e9..c3281e7 100644 --- a/drivers/gpu/drm/i915/intel_guc.h +++ b/drivers/gpu/drm/i915/intel_guc.h @@ -103,11 +103,16 @@ struct intel_guc { uint64_t action_count; /* Total commands issued */ uint32_t action_cmd; /* Last command word */ uint32_t action_status; /* Last return status */ - uint32_t action_fail; /* Total number of failures */ - int32_t action_err; /* Last error code */ + uint32_t action_fail_count; /* Total number of failures */ + uint32_t action_fail_cmd; /* Last failed command */ + uint32_t action_fail_status; /* Last bad return status */ + int32_t action_err; /* Last (nonzero) error code */ + + /* Submission status & statistics */ uint64_t submissions[GUC_MAX_ENGINES_NUM]; uint32_t last_seqno[GUC_MAX_ENGINES_NUM]; + uint32_t failures[I915_NUM_RINGS]; }; /* intel_guc_loader.c */