From patchwork Thu Dec 22 22:21:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Brost X-Patchwork-Id: 13080375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 05EEDC4167B for ; Thu, 22 Dec 2022 22:30:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0BB5410E5C0; Thu, 22 Dec 2022 22:29:00 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3150710E59D; Thu, 22 Dec 2022 22:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671748120; x=1703284120; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=y0GRqFTy4Y7dd+E5+/dK+CjrRyfodQ6AWBNk7sMSu+Y=; b=KRa320hZFI8qzZ7Y+Nx/VcV21kzuctRxhsWIYeUPpq/H2s0YA1UMg9WI W+1yJWSXKKDB6cWDrmDOpCzC4afNyD1KdPs32rGa3P2g3eKfqBRwcYwvU WMfegBihqP/J+FUMvXstvPSFaeNGuk8V0Xyeqg0s8I8Meax6qRF3CrVmw k/GEfQ6qpGMfvkGGFoQCaQyVPFJht4D95/xvG+nbUponpDupUu+WNfSzg KyMq8r6+8uUmLHnKXQFw2iIVqtomK4/hzsaMBmTtk4vnCoepL/xH57veg BVeReMPLBzScXwM+AabAEWiPC1oUVWYfTVEf5KfWY8bJJX/VT4sVR6K5X Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10569"; a="406472853" X-IronPort-AV: E=Sophos;i="5.96,266,1665471600"; d="scan'208";a="406472853" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2022 14:28:39 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10569"; a="645412315" X-IronPort-AV: E=Sophos;i="5.96,266,1665471600"; d="scan'208";a="645412315" Received: from jons-linux-dev-box.fm.intel.com ([10.1.27.20]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2022 14:28:38 -0800 From: Matthew Brost To: , Date: Thu, 22 Dec 2022 14:21:14 -0800 Message-Id: <20221222222127.34560-8-matthew.brost@intel.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221222222127.34560-1-matthew.brost@intel.com> References: <20221222222127.34560-1-matthew.brost@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [RFC PATCH 07/20] drm/sched: Submit job before starting TDR 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" If the TDR is set to a value, it can fire before a job is submitted in drm_sched_main. The job should be always be submitted before the TDR fires, fix this ordering. Signed-off-by: Matthew Brost --- drivers/gpu/drm/scheduler/sched_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index f39fdc01c37b..fa25541bb477 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -1082,10 +1082,10 @@ static void drm_sched_main(struct work_struct *w) s_fence = sched_job->s_fence; atomic_inc(&sched->hw_rq_count); - drm_sched_job_begin(sched_job); trace_drm_run_job(sched_job, entity); fence = sched->ops->run_job(sched_job); + drm_sched_job_begin(sched_job); complete_all(&entity->entity_idle); drm_sched_fence_scheduled(s_fence);