public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] dma-fence: Remove 64-bit flag
@ 2025-10-17  9:31 Philipp Stanner
  2025-10-17 21:28 ` Matthew Brost
  0 siblings, 1 reply; 5+ messages in thread
From: Philipp Stanner @ 2025-10-17  9:31 UTC (permalink / raw)
  To: Sumit Semwal, Gustavo Padovan, Christian König, tursulin
  Cc: linux-media, dri-devel, linaro-mm-sig, linux-kernel,
	Philipp Stanner

It seems that DMA_FENCE_FLAG_SEQNO64_BIT has no real effects anymore,
since seqno is a u64 everywhere.

Remove the unneeded flag.

Signed-off-by: Philipp Stanner <phasta@kernel.org>
---
Seems to me that this flag doesn't really do anything anymore?

I *suspect* that it could be that some drivers pass a u32 to
dma_fence_init()? I guess they could be ported, couldn't they.

P.
---
 drivers/dma-buf/dma-fence.c |  3 +--
 include/linux/dma-fence.h   | 10 +---------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 3f78c56b58dc..24794c027813 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -1078,8 +1078,7 @@ void
 dma_fence_init64(struct dma_fence *fence, const struct dma_fence_ops *ops,
 		 spinlock_t *lock, u64 context, u64 seqno)
 {
-	__dma_fence_init(fence, ops, lock, context, seqno,
-			 BIT(DMA_FENCE_FLAG_SEQNO64_BIT));
+	__dma_fence_init(fence, ops, lock, context, seqno, 0);
 }
 EXPORT_SYMBOL(dma_fence_init64);
 
diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h
index 64639e104110..4eca2db28625 100644
--- a/include/linux/dma-fence.h
+++ b/include/linux/dma-fence.h
@@ -98,7 +98,6 @@ struct dma_fence {
 };
 
 enum dma_fence_flag_bits {
-	DMA_FENCE_FLAG_SEQNO64_BIT,
 	DMA_FENCE_FLAG_SIGNALED_BIT,
 	DMA_FENCE_FLAG_TIMESTAMP_BIT,
 	DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT,
@@ -470,14 +469,7 @@ dma_fence_is_signaled(struct dma_fence *fence)
  */
 static inline bool __dma_fence_is_later(struct dma_fence *fence, u64 f1, u64 f2)
 {
-	/* This is for backward compatibility with drivers which can only handle
-	 * 32bit sequence numbers. Use a 64bit compare when the driver says to
-	 * do so.
-	 */
-	if (test_bit(DMA_FENCE_FLAG_SEQNO64_BIT, &fence->flags))
-		return f1 > f2;
-
-	return (int)(lower_32_bits(f1) - lower_32_bits(f2)) > 0;
+	return f1 > f2;
 }
 
 /**
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-10-27  7:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17  9:31 [RFC PATCH] dma-fence: Remove 64-bit flag Philipp Stanner
2025-10-17 21:28 ` Matthew Brost
2025-10-20  8:16   ` Philipp Stanner
2025-10-20 11:18     ` Matthew Brost
2025-10-27  7:41       ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox