From patchwork Thu Dec 22 22:21:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Brost X-Patchwork-Id: 13080363 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 88B44C4332F for ; Thu, 22 Dec 2022 22:29:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC08510E59F; Thu, 22 Dec 2022 22:28:44 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1E0B410E59C; 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=MqKBr8/mNu++7cS1FR4zn2oCl9vWAu77enHSGIGOIvg=; b=NEmiWtyE6jFP+IZFwOvyFL2v0PUhR8ys2bxhhyfSmkZNcdncGu2d+wHX fXFeloNToIsO9fb15eaNKG1eif1Mnxftm1aH3UCCUHEyAWkdeZA77xJ9K GjD34CdnJ5Dpz9GqfHBvqhtruXqc/nCIqI/kBSKgHWaTrCJM5qOBPJgTo coNz5jiWgal7KZPNGN6bPQp3FspG/t5cZuu8ERh/MT7YS4ElICB/I4qEz KK/lkvj7UbhH7vLBEqE0rm4AFMHSX+QpcHxJ/1Zb5bL7AhlIJrhS+2GOo pFkDtNrWV5lrXS3AQa5tN9a8rJ2kgEMF8MM3yXJ5N/NfN9WVGdCHHEXNk A==; X-IronPort-AV: E=McAfee;i="6500,9779,10569"; a="406472851" X-IronPort-AV: E=Sophos;i="5.96,266,1665471600"; d="scan'208";a="406472851" 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="645412313" X-IronPort-AV: E=Sophos;i="5.96,266,1665471600"; d="scan'208";a="645412313" 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:13 -0800 Message-Id: <20221222222127.34560-7-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 06/20] drm/sched: Start run wq before TDR in drm_sched_start 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 very small value it can fire before the run wq is started in the function drm_sched_start. The run wq is expected to running when the TDR fires, fix this ordering so this expectation is always met. Signed-off-by: Matthew Brost --- drivers/gpu/drm/scheduler/sched_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index 8e688c2fc482..f39fdc01c37b 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -586,13 +586,13 @@ void drm_sched_start(struct drm_gpu_scheduler *sched, bool full_recovery) drm_sched_job_done(s_job); } + drm_sched_run_wq_start(sched); + if (full_recovery) { spin_lock(&sched->job_list_lock); drm_sched_start_timeout(sched); spin_unlock(&sched->job_list_lock); } - - drm_sched_run_wq_start(sched); } EXPORT_SYMBOL(drm_sched_start);