From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796208884; b=KKq5jPqithAc1DNKjyGenOZ18X/6YSHbDMPXp3r5/dQdwZ70w6VTbYV+Now1qfk8Mlgf E7aZzsmK5ucRPLKpzZFll0jVX21cjYuYhZhLgSO6HQa6FTs13xjcPS401qDKtnNtJH0aZ TxMBgI40MFO2YPYFYl7B7vx1+aZQb5fbq/6PiO0NK13FOIP61QWLmflKdXiEHTs+wsGHh mJ7Tk5LBjV/m8rdg2i5p89PQTr0Oycc4Fn/fcAODeKDKyPi8p29ZlcYQWYAKvjFjL9Arz WH8nMOy6KGDSF5LPArZ9VsZGA0Wh+n/x0wpdBU2x61phCGl3Q3+ePtw7ps6+60ON19w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796208884; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=75x6RF9Lol2Z0AAypAkmoV2vTZa5mxIWklC4nwzgqI0=; b=s1LTxKkqeXq/SxqA99VdlYV965zFfN2f83Geu0qGmWn0cAqR2mDqIsntpBuQ5nURLp/8 B1vPk9Vnpo0JfgN/nHwckTIB0iwqxKg8nxlADzPExJ6DgDPgmhLxsnWDJqkiTfox+BoAM 6apm074ym3lUEJIN2UhGuhW/xI7S1gsB6wvONLD3T6w2pSDxvtIXStN0GfF3uwk0m387H 30c85vlHF0/2dAjxeVv6mt3OAcfTmUefjndDwSe030MFUMyn2lzV+YvRMTL1LKH0TeCp+ pAFOaa1dXQsS+M43jR2dqFXckBZkF+HFE3MNjSeTTfRPonIimDFMQN0ub1FkqrandOw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=vSoue4IN; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F7D7606A31A for ; Wed, 2 Dec 2026 10:54:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=vSoue4IN Received: by smtp.kernel.org (Postfix) with ESMTPSA id A26621F000C1; Wed, 2 Dec 2026 10:54:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796208883; bh=75x6RF9Lol2Z0AAypAkmoV2vTZa5mxIWklC4nwzgqI0=; h=Subject:To:Cc:From:Date; b=vSoue4INDLaGlDFa6oDwxHKr9G6Nz2y/F/wdJTqnU2+Icp9jNZzXl4YBFkYwH4hVA qeX4NrlppLMHxMqm8nDMmiSth9t2h1V+H2aiXFAPV9YVFSl/HaBJI41iw66sNiLwSD quQOeDZFOgps753XuDpcbsmqvU/H8czDySdaW/Jk= Subject: FAILED: patch "[PATCH] drm/xe: Unwrap sync fences before adding them as job" failed to apply to 6.18-stable tree To: junjia.chen@intel.com,airlied@redhat.com,matthew.brost@intel.com Cc: From: Date: Wed, 02 Dec 2026 11:54:32 +0100 Message-ID: <2026120232-quartet-sandlot-73e6@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x e2cdad51ec53dd0f48e7f767cc1390dec69d54d4 # git commit -s git send-email --to '' --in-reply-to '2026120232-quartet-sandlot-73e6@gregkh' --subject-prefix 'PATCH 6.18.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From e2cdad51ec53dd0f48e7f767cc1390dec69d54d4 Mon Sep 17 00:00:00 2001 From: "Chen, Junjia" Date: Thu, 29 Oct 2026 00:13:58 +0800 Subject: [PATCH] drm/xe: Unwrap sync fences before adding them as job dependencies A timeline syncobj point is a dma_fence_chain node that carries its own fence context, separate from the contexts of the fences it wraps. xe_sync_entry_add_deps() passed that container straight to drm_sched_job_add_dependency(). drm_sched_entity_add_dependency_cb() only drops a dependency when the fence context is one of the entity's own (fence_context or fence_context + 1). A chain node never matches, so a wait on a point whose inner fence is the finished fence of an earlier job on the same exec queue is treated like a cross-queue dependency: the job is held until the previous job has completed on the GPU. Every job queued behind it waits too, and the ring drains before the next batch of jobs is released. Unwrap the fence with dma_fence_unwrap_for_each() and add each unsignaled underlying fence as a dependency, so drm_sched sees the real fence contexts and ignores same-entity fences. Dependencies on other exec queues still wait for completion. drm_sched_job_add_dependency() keeps only the latest fence per context, so the dependency array does not grow with the length of the chain. Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") Cc: stable@vger.kernel.org Signed-off-by: Chen, Junjia Reviewed-by: Matthew Brost Signed-off-by: Matthew Brost Link: https://lore.kernel.org/intel-xe/20261028161358.1917359-1-junjia.chen@intel.com/ (cherry picked from commit 3b8860fe2581a8db796150728687ba1c6b78ddab) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c index a3268465868e..48a38d64a42a 100644 --- a/drivers/gpu/drm/xe/xe_sync.c +++ b/drivers/gpu/drm/xe/xe_sync.c @@ -6,6 +6,7 @@ #include "xe_sync.h" #include +#include #include #include #include @@ -234,11 +235,35 @@ ALLOW_ERROR_INJECTION(xe_sync_entry_parse, ERRNO); int xe_sync_entry_add_deps(struct xe_sync_entry *sync, struct xe_sched_job *job) { - if (sync->fence) - return drm_sched_job_add_dependency(&job->drm, - dma_fence_get(sync->fence)); + struct dma_fence_unwrap iter; + struct dma_fence *fence; + int err = 0; - return 0; + if (!sync->fence) + return 0; + + /* + * Unwrap fence containers (e.g. dma_fence_chain from a timeline + * syncobj) so the scheduler sees the underlying fences. That lets it + * drop dependencies on jobs from the same entity and only wait for + * jobs on the same scheduler to be scheduled, rather than waiting for + * the container, which forces a full GPU completion wait and drains + * the queue. + */ + dma_fence_unwrap_for_each(fence, &iter, sync->fence) { + /* + * There is no dma_fence_unwrap_stop() helper to drop the + * reference the iterator holds, so keep iterating without + * doing anything once an error has occurred. + */ + if (err || dma_fence_is_signaled(fence)) + continue; + + err = drm_sched_job_add_dependency(&job->drm, + dma_fence_get(fence)); + } + + return err; } /**