From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C4C8C2D0DB for ; Fri, 31 Jan 2020 13:23:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2653720707 for ; Fri, 31 Jan 2020 13:23:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2653720707 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CC0056FB4A; Fri, 31 Jan 2020 13:23:30 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 008BA6FB4A for ; Fri, 31 Jan 2020 13:23:28 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2020 05:23:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,385,1574150400"; d="scan'208";a="218610220" Received: from gaia.fi.intel.com ([10.237.72.192]) by orsmga007.jf.intel.com with ESMTP; 31 Jan 2020 05:23:27 -0800 Received: by gaia.fi.intel.com (Postfix, from userid 1000) id 3367A5C0D3B; Fri, 31 Jan 2020 15:22:38 +0200 (EET) From: Mika Kuoppala To: Chris Wilson , intel-gfx@lists.freedesktop.org In-Reply-To: <20200131130319.2998318-1-chris@chris-wilson.co.uk> References: <20200131130319.2998318-1-chris@chris-wilson.co.uk> Date: Fri, 31 Jan 2020 15:22:38 +0200 Message-ID: <87r1zf92w1.fsf@gaia.fi.intel.com> MIME-Version: 1.0 Subject: Re: [Intel-gfx] [PATCH] drm/i915/selftests: Disable heartbeat around hang tests X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Chris Wilson writes: > If the heartbeat fires in the middle of the preempt-hang test, it > consumes our forced hang disrupting the test. > > Reported-by: Daniel Vetter > Signed-off-by: Chris Wilson > --- > drivers/gpu/drm/i915/gt/selftest_lrc.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c > index 5e04ecb61dcc..f5214a374fb7 100644 > --- a/drivers/gpu/drm/i915/gt/selftest_lrc.c > +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c > @@ -2452,15 +2452,19 @@ static int live_preempt_hang(void *arg) > I915_USER_PRIORITY(I915_CONTEXT_MIN_USER_PRIORITY); > > for_each_engine(engine, gt, id) { > + unsigned long heartbeat; > struct i915_request *rq; > > if (!intel_engine_has_preemption(engine)) > continue; > > + engine_heartbeat_disable(engine, &heartbeat); > + > rq = spinner_create_request(&spin_lo, ctx_lo, engine, > MI_ARB_CHECK); > if (IS_ERR(rq)) { > err = PTR_ERR(rq); > + engine_heartbeat_enable(engine, heartbeat); Was thinking that you could grab the engine and abuse then the error path to enable. But too hairy. Reviewed-by: Mika Kuoppala > goto err_ctx_lo; > } > > @@ -2470,6 +2474,7 @@ static int live_preempt_hang(void *arg) > GEM_TRACE_DUMP(); > intel_gt_set_wedged(gt); > err = -EIO; > + engine_heartbeat_enable(engine, heartbeat); > goto err_ctx_lo; > } > > @@ -2477,6 +2482,7 @@ static int live_preempt_hang(void *arg) > MI_ARB_CHECK); > if (IS_ERR(rq)) { > igt_spinner_end(&spin_lo); > + engine_heartbeat_enable(engine, heartbeat); > err = PTR_ERR(rq); > goto err_ctx_lo; > } > @@ -2491,6 +2497,7 @@ static int live_preempt_hang(void *arg) > pr_err("Preemption did not occur within timeout!"); > GEM_TRACE_DUMP(); > intel_gt_set_wedged(gt); > + engine_heartbeat_enable(engine, heartbeat); > err = -EIO; > goto err_ctx_lo; > } > @@ -2505,12 +2512,15 @@ static int live_preempt_hang(void *arg) > GEM_TRACE("hi spinner failed to start\n"); > GEM_TRACE_DUMP(); > intel_gt_set_wedged(gt); > + engine_heartbeat_enable(engine, heartbeat); > err = -EIO; > goto err_ctx_lo; > } > > igt_spinner_end(&spin_hi); > igt_spinner_end(&spin_lo); > + engine_heartbeat_enable(engine, heartbeat); > + > if (igt_flush_test(gt->i915)) { > err = -EIO; > goto err_ctx_lo; > -- > 2.25.0 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx