* [PATCH v2] dma-buf/dma-fence: Remove dma_fence_later()
@ 2026-11-20 11:27 Philipp Stanner
0 siblings, 0 replies; only message in thread
From: Philipp Stanner @ 2026-11-20 11:27 UTC (permalink / raw)
To: Sumit Semwal, Christian König, Philipp Stanner,
Tvrtko Ursulin
Cc: dri-devel, linux-kernel
dma_fence_later() does not have any in-tree users anymore.
dma_fence_is_later() is available as an alternative.
Remove the surplus function.
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
---
Changes in v2:
- Rebase onto misc-next due to conflict.
- Add Christian's Rb.
---
drivers/dma-buf/dma-fence.c | 3 ---
include/linux/dma-fence.h | 26 --------------------------
2 files changed, 29 deletions(-)
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 0776ca7c795e..ab02afdb0f18 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -1115,9 +1115,6 @@ static bool dma_fence_flags_valid(unsigned long flags)
* refcount after committing with this fence, but it will need to hold a
* refcount again if &dma_fence_ops.enable_signaling gets called.
*
- * context and seqno are used for easy comparison between fences, allowing
- * to check which fence is later by simply using dma_fence_later().
- *
* External locks are a relic of legacy use cases that needed a shared lock
* to serialize signaling when no out-of-order signaling was possible through
* &dma_fence_ops.signaled. Drivers have abandoned this concept since the
diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h
index 56c4e5beaafe..513d9dbbff47 100644
--- a/include/linux/dma-fence.h
+++ b/include/linux/dma-fence.h
@@ -626,32 +626,6 @@ static inline bool dma_fence_is_later_or_same(struct dma_fence *f1,
return f1 == f2 || dma_fence_is_later(f1, f2);
}
-/**
- * dma_fence_later - return the chronologically later fence
- * @f1: the first fence from the same context
- * @f2: the second fence from the same context
- *
- * Returns NULL if both fences are signaled, otherwise the fence that would be
- * signaled last. Both fences must be from the same context, since a seqno is
- * not re-used across contexts.
- */
-static inline struct dma_fence *dma_fence_later(struct dma_fence *f1,
- struct dma_fence *f2)
-{
- if (WARN_ON(f1->context != f2->context))
- return NULL;
-
- /*
- * Can't check just DMA_FENCE_FLAG_SIGNALED_BIT here, it may never
- * have been set if enable_signaling wasn't called, and enabling that
- * here is overkill.
- */
- if (dma_fence_is_later(f1, f2))
- return dma_fence_is_signaled(f1) ? NULL : f1;
- else
- return dma_fence_is_signaled(f2) ? NULL : f2;
-}
-
/**
* dma_fence_get_status_locked - returns the status upon completion
* @fence: the dma_fence to query
--
2.56.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-20 11:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 11:27 [PATCH v2] dma-buf/dma-fence: Remove dma_fence_later() Philipp Stanner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.