From patchwork Thu Mar 18 17:04:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 12148685 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=-15.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 E78B5C43332 for ; Thu, 18 Mar 2021 17:04:41 +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 B01A764E05 for ; Thu, 18 Mar 2021 17:04:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B01A764E05 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=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2EBEF6E934; Thu, 18 Mar 2021 17:04:34 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id F07FC6E935; Thu, 18 Mar 2021 17:04:31 +0000 (UTC) IronPort-SDR: IgOFYAT8AGDadI1/Rm5ycFYMiwp7KejMg9hQQcc8aU0VXhwwpQDS+tN4FEjfhvc+YqArbhMRDC tvVt4/hAt8nw== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="209733847" X-IronPort-AV: E=Sophos;i="5.81,259,1610438400"; d="scan'208";a="209733847" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 10:04:31 -0700 IronPort-SDR: MtdxoRNfcJPry6Lqi5cQi/Dp+FQb8RLVDPS/L0Yb+zPdryJrbug8jW/hq+EU/SZrOR0ejrimDN eVJVyXZ98FEQ== X-IronPort-AV: E=Sophos;i="5.81,259,1610438400"; d="scan'208";a="413164945" Received: from syeghiay-mobl.ger.corp.intel.com (HELO localhost.localdomain) ([10.252.51.182]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 10:04:29 -0700 From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Subject: [PATCH 3/6] drm/i915: Handle async cancellation in sentinel assert Date: Thu, 18 Mar 2021 17:04:16 +0000 Message-Id: <20210318170419.2107512-4-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210318170419.2107512-1-tvrtko.ursulin@linux.intel.com> References: <20210318170419.2107512-1-tvrtko.ursulin@linux.intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, Tvrtko Ursulin Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Tvrtko Ursulin With the watchdog cancelling requests asynchronously to preempt-to-busy we need to relax one assert making it apply only to requests not in error. v2: * Check against the correct request! Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c index 4b870eca9693..bf557290173a 100644 --- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c +++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c @@ -815,6 +815,13 @@ assert_pending_valid(const struct intel_engine_execlists *execlists, spin_unlock_irqrestore(&rq->lock, flags); if (!ok) return false; + + /* + * Due async nature of preempt-to-busy and request cancellation + * we need to skip further asserts for cancelled requests. + */ + if (READ_ONCE(rq->fence.error)) + break; } return ce;