From patchwork Wed Jun 8 13:07:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 9164595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0B61160572 for ; Wed, 8 Jun 2016 13:14:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F165926B4A for ; Wed, 8 Jun 2016 13:14:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E67F22823D; Wed, 8 Jun 2016 13:14:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEE7426B4A for ; Wed, 8 Jun 2016 13:14:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E122F6E9F3; Wed, 8 Jun 2016 13:14:14 +0000 (UTC) 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 88FB26E9F3 for ; Wed, 8 Jun 2016 13:14:12 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 08 Jun 2016 06:10:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,439,1459839600"; d="scan'208";a="997780289" Received: from gaia.fi.intel.com (HELO gaia) ([10.237.72.84]) by fmsmga002.fm.intel.com with ESMTP; 08 Jun 2016 06:10:28 -0700 Received: by gaia (Postfix, from userid 1000) id 7A49C40505; Wed, 8 Jun 2016 16:07:22 +0300 (EEST) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Wed, 8 Jun 2016 16:07:17 +0300 Message-Id: <1465391238-32737-1-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 2.5.0 Subject: [Intel-gfx] [PATCH 1/2] lib/gt: Omit illegal instruction on hang injection with gen 8+ 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-Virus-Scanned: ClamAV using ClamSMTP 0xffffffff as an illegal command confuses the command execution on gen9 so that the next BB start will get ignored, causing a runaway head past the bb end. This delays the hang detection substantially as hangcheck then observes only a non progressing seqno. Omit the bad instruction on gen8+ and rely on the chained batch loop to cause a deterministic hang. Make the chained bb start to jump straight into bb start, omitting the MI_NOOP or the bad instruction on subsequent passes. This makes the acthd sampling to hit more reliably to the same value, as the loop is smaller, making the head appear to be 'more stuck'. References: https://bugs.freedesktop.org/show_bug.cgi?id=92715 Cc: Chris Wilson Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson --- lib/igt_gt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/igt_gt.c b/lib/igt_gt.c index 95d74a0cfeae..adb4b95bb913 100644 --- a/lib/igt_gt.c +++ b/lib/igt_gt.c @@ -181,16 +181,22 @@ igt_hang_ring_t igt_hang_ctx(int fd, exec.relocs_ptr = (uintptr_t)&reloc; memset(b, 0xc5, sizeof(b)); - b[0] = 0xffffffff; + len = 2; - if (intel_gen(intel_get_drm_devid(fd)) >= 8) + if (intel_gen(intel_get_drm_devid(fd)) >= 8) { + b[0] = MI_NOOP; len++; + } else { + b[0] = 0xffffffff; + } + b[1] = MI_BATCH_BUFFER_START | (len - 2); b[1+len] = MI_BATCH_BUFFER_END; b[2+len] = MI_NOOP; gem_write(fd, exec.handle, 0, b, sizeof(b)); reloc.offset = 8; + reloc.delta = 4; reloc.target_handle = exec.handle; reloc.read_domains = I915_GEM_DOMAIN_COMMAND;