From patchwork Fri Jun 28 11:35:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 2798521 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 74A449F245 for ; Fri, 28 Jun 2013 11:36:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 964232019F for ; Fri, 28 Jun 2013 11:36:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 640DF20188 for ; Fri, 28 Jun 2013 11:36:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EE8FDE6596 for ; Fri, 28 Jun 2013 04:36:16 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A40BE658B for ; Fri, 28 Jun 2013 04:36:05 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 28 Jun 2013 04:33:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,958,1363158000"; d="scan'208";a="361031858" Received: from gaia.fi.intel.com (HELO gaia) ([10.237.66.39]) by orsmga002.jf.intel.com with ESMTP; 28 Jun 2013 04:35:54 -0700 Received: by gaia (Postfix, from userid 1000) id 7D89240B0C; Fri, 28 Jun 2013 14:35:44 +0300 (EEST) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Fri, 28 Jun 2013 14:35:41 +0300 Message-Id: <1372419341-5858-1-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <20130627172330.GR18285@phenom.ffwll.local> References: <20130627172330.GR18285@phenom.ffwll.local> Subject: [Intel-gfx] [PATCH 3/3] tests/ZZ_hangman: Test both error_state interfaces X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-5.5 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 Test both debugfs and sysfs error_state interfaces. v2: sysfs error_state not mandatory Signed-off-by: Mika Kuoppala --- tests/ZZ_hangman | 52 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/tests/ZZ_hangman b/tests/ZZ_hangman index 08c5514..4db3823 100755 --- a/tests/ZZ_hangman +++ b/tests/ZZ_hangman @@ -18,25 +18,49 @@ if [ ! -f i915_ring_stop ] ; then exit 77 fi -if cat i915_error_state | grep -v "no error state collected" > /dev/null ; then - echo "gpu hang dectected" - exit 1 -fi +function check_iface { + estate_fname=$1 + mandatory=$2 -# stop rings -echo 0xf > i915_ring_stop -echo "rings stopped" + echo checking ${estate_fname} -(cd $oldpath; $SOURCE_DIR/gem_exec_big) > /dev/null + if [ ! -f $estate_fname ] ; then + if [ $mandatory != 0 ] ; then + echo "'${estate_fname}' not found"; + exit 1; + else + echo "${estate_fname} not mandatory"; + return; + fi + fi -if cat i915_error_state | grep -v "no error state collected" > /dev/null ; then - echo "gpu hang correctly dectected" -else - echo "gpu hang not dectected" + if cat $estate_fname | grep -v "no error state collected" > /dev/null ; then + echo "gpu hang detected" exit 2 -fi + fi + + echo 0xf > i915_ring_stop + echo "rings stopped" + + (cd $oldpath; $SOURCE_DIR/gem_exec_big) > /dev/null + + if cat $estate_fname | grep -v "no error state collected" > /dev/null ; then + echo "gpu hang correctly detected" + else + echo "gpu hang not detected" + exit 3 + fi # clear error state -echo > i915_error_state + echo > $estate_fname + + if cat $estate_fname | grep -v "no error state collected" > /dev/null ; then + echo "gpu hang still present" + exit 4 + fi +} + +check_iface $i915_dfs_path/i915_error_state 1 +check_iface $i915_sfs_path/error_state 0 exit 0