mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RFC] dma-buf: To check DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT status on debug
@ 2022-08-04 12:19 Arvind Yadav
  2022-08-08 19:44 ` Christian König
  0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2022-08-04 12:19 UTC (permalink / raw)
  To: Christian.Koenig, andrey.grodzovsky, shashank.sharma,
	amaranath.somalapuram, Luben.Tuikov, Alexander.Deucher,
	sumit.semwal, linux-media, dri-devel, linaro-mm-sig,
	linux-kernel, amd-gfx
  Cc: Arvind Yadav

If core DMA-buf framework forgets to call dma_fence_enable_signaling()
before calling the dma_fence_is_signaled(). To handle this scenario on
debug kernel the DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT needs to be checked
before checking the actual signaling status.

Signed-off-by: Arvind Yadav <Arvind.Yadav@amd.com>
---
 include/linux/dma-fence.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h
index 775cdc0b4f24..7c95c8d5e5f5 100644
--- a/include/linux/dma-fence.h
+++ b/include/linux/dma-fence.h
@@ -428,6 +428,10 @@ dma_fence_is_signaled_locked(struct dma_fence *fence)
 static inline bool
 dma_fence_is_signaled(struct dma_fence *fence)
 {
+#ifdef CONFIG_DEBUG_FS
+	if (test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &fence->flags))
+		return true;
+#endif
 	if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
 		return true;
 
-- 
2.25.1


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

end of thread, other threads:[~2022-08-08 19:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04 12:19 [PATCH RFC] dma-buf: To check DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT status on debug Arvind Yadav
2022-08-08 19:44 ` 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

all inboxes | Powered by JetHome®