intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] dma-fence: Remove return code of dma_fence_signal() et al.
@ 2025-12-01 10:50 Philipp Stanner
  2025-12-01 10:50 ` [PATCH v2 1/8] dma-buf/dma-fence: Add dma_fence_test_signaled_flag() Philipp Stanner
                   ` (8 more replies)
  0 siblings, 9 replies; 43+ messages in thread
From: Philipp Stanner @ 2025-12-01 10:50 UTC (permalink / raw)
  To: Sumit Semwal, Gustavo Padovan, Christian König,
	Felix Kuehling, Alex Deucher, David Airlie, Simona Vetter,
	Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	Huang Rui, Matthew Auld, Matthew Brost, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Lucas De Marchi,
	Thomas Hellström
  Cc: linux-media, dri-devel, linux-kernel, amd-gfx, intel-gfx,
	intel-xe, Philipp Stanner

Tested this with dma_buf selftests and drm_sched tests.

Changes in v2:
  - Fix bug and don't turn the kernel into a smoking pile of ashes by
    not setting the signaled-bit…
  - Add functions (dma_fence_check_and_signal()) preserving the old
    behavior of dma_fence_signal() & Co. (Felix)
  - Use those new functions in amdkfd, xe, ttm and st-dma-fence.
  - Be a bit less aggressive and keep the git-diff smaller.
  - Add a patch using the flag-helper in Xe. (Matthew)

Barely anyone uses dma_fence_signal()'s (and similar functions') return
code. Checking it is pretty much useless anyways, because what are you
going to do if a fence was already signal it? Unsignal it and signal it
again? ;p

Removing the return code simplifies the API and makes it easier for me
to sit on top with Rust DmaFence.

Philipp Stanner (8):
  dma-buf/dma-fence: Add dma_fence_test_signaled_flag()
  dma-buf/dma-fence: Add dma_fence_check_and_signal()
  amd/amdkfd: Use dma_fence_check_and_signal()
  drm/xe: Use dma_fence_check_and_signal_locked()
  dma-buf: Don't misuse dma_fence_signal()
  drm/ttm: Use dma_fence_check_and_signal()
  dma-buf/dma-fence: Remove return code of signaling-functions
  drm/xe: Use dma_fence_test_signaled_flag()

 drivers/dma-buf/dma-fence.c                   | 100 +++++++++++-------
 drivers/dma-buf/st-dma-fence.c                |   4 +-
 drivers/gpu/drm/amd/amdkfd/kfd_process.c      |   6 +-
 .../gpu/drm/ttm/tests/ttm_bo_validate_test.c  |   2 +-
 drivers/gpu/drm/xe/xe_exec_queue.c            |   9 +-
 drivers/gpu/drm/xe/xe_hw_fence.c              |   4 +-
 drivers/gpu/drm/xe/xe_pt.c                    |   3 +-
 drivers/gpu/drm/xe/xe_sched_job.c             |   2 +-
 include/linux/dma-fence.h                     |  35 ++++--
 9 files changed, 102 insertions(+), 63 deletions(-)

-- 
2.49.0


^ permalink raw reply	[flat|nested] 43+ messages in thread
* [PATCH 0/6] dma-fence: Remove return code of dma_fence_signal() et al.
@ 2025-11-26 13:19 Philipp Stanner
  2025-11-26 14:02 ` Christian König
  0 siblings, 1 reply; 43+ messages in thread
From: Philipp Stanner @ 2025-11-26 13:19 UTC (permalink / raw)
  To: Sumit Semwal, Gustavo Padovan, Christian König,
	Felix Kuehling, Alex Deucher, David Airlie, Simona Vetter,
	Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	Huang Rui, Matthew Auld, Matthew Brost, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Lucas De Marchi,
	Thomas Hellström
  Cc: linux-media, dri-devel, linaro-mm-sig, linux-kernel, amd-gfx,
	intel-gfx, intel-xe, rust-for-linux, Philipp Stanner

Barely anyone uses dma_fence_signal()'s (and similar functions') return
code. Checking it is pretty much useless anyways, because what are you
going to do if a fence was already signal it? Unsignal it and signal it
again? ;p

Removing the return code simplifies the API and makes it easier for me
to sit on top with Rust DmaFence.

Philipp Stanner (6):
  dma-buf/dma-fence: Add dma_fence_test_signaled_flag()
  amd/amdkfd: Ignore return code of dma_fence_signal()
  drm/gpu/xe: Ignore dma_fenc_signal() return code
  dma-buf: Don't misuse dma_fence_signal()
  drm/ttm: Remove return check of dma_fence_signal()
  dma-buf/dma-fence: Remove return code of signaling-functions

 drivers/dma-buf/dma-fence.c                   | 59 ++++++-------------
 drivers/dma-buf/st-dma-fence.c                |  7 +--
 drivers/gpu/drm/amd/amdkfd/kfd_process.c      |  5 +-
 .../gpu/drm/ttm/tests/ttm_bo_validate_test.c  |  3 +-
 drivers/gpu/drm/xe/xe_hw_fence.c              |  5 +-
 include/linux/dma-fence.h                     | 33 ++++++++---
 6 files changed, 53 insertions(+), 59 deletions(-)

-- 
2.49.0


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

end of thread, other threads:[~2025-12-04 20:29 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-01 10:50 [PATCH 0/6] dma-fence: Remove return code of dma_fence_signal() et al Philipp Stanner
2025-12-01 10:50 ` [PATCH v2 1/8] dma-buf/dma-fence: Add dma_fence_test_signaled_flag() Philipp Stanner
2025-12-03 13:03   ` Christian König
2025-12-01 10:50 ` [PATCH v2 2/8] dma-buf/dma-fence: Add dma_fence_check_and_signal() Philipp Stanner
2025-12-01 13:23   ` Christian König
2025-12-01 13:55     ` Philipp Stanner
2025-12-01 15:20       ` Christian König
2025-12-01 15:34         ` Philipp Stanner
2025-12-01 16:06           ` Christian König
2025-12-01 15:53         ` Philipp Stanner
2025-12-01 16:08           ` Christian König
2025-12-02  9:19             ` Philipp Stanner
2025-12-03 13:05   ` Christian König
2025-12-01 10:50 ` [PATCH v2 3/8] amd/amdkfd: Use dma_fence_check_and_signal() Philipp Stanner
2025-12-01 15:21   ` Felix Kuehling
2025-12-03 13:10   ` Christian König
2025-12-01 10:50 ` [PATCH v2 4/8] drm/xe: Use dma_fence_check_and_signal_locked() Philipp Stanner
2025-12-01 19:38   ` Matthew Brost
2025-12-02  7:17     ` Philipp Stanner
2025-12-02 15:57       ` Matthew Brost
2025-12-02 20:47     ` Andi Shyti
2025-12-02 21:04       ` Matthew Brost
2025-12-03 21:13         ` Rodrigo Vivi
2025-12-03 13:14   ` Christian König
2025-12-01 10:50 ` [PATCH v2 5/8] dma-buf: Don't misuse dma_fence_signal() Philipp Stanner
2025-12-03 13:11   ` Christian König
2025-12-01 10:50 ` [PATCH v2 6/8] drm/ttm: Use dma_fence_check_and_signal() Philipp Stanner
2025-12-03 13:11   ` Christian König
2025-12-01 10:50 ` [PATCH v2 7/8] dma-buf/dma-fence: Remove return code of signaling-functions Philipp Stanner
2025-12-03 13:13   ` Christian König
2025-12-01 10:50 ` [PATCH v2 8/8] drm/xe: Use dma_fence_test_signaled_flag() Philipp Stanner
2025-12-01 19:33   ` Matthew Brost
2025-12-02  8:29     ` Philipp Stanner
2025-12-03 13:15   ` Christian König
2025-12-03 15:18     ` Philipp Stanner
2025-12-03 15:24       ` Christian König
2025-12-03 17:31         ` Matthew Brost
2025-12-03 21:12           ` Rodrigo Vivi
2025-12-04 14:10 ` [PATCH 0/6] dma-fence: Remove return code of dma_fence_signal() et al Philipp Stanner
  -- strict thread matches above, loose matches on Subject: below --
2025-11-26 13:19 Philipp Stanner
2025-11-26 14:02 ` Christian König
2025-11-26 14:09   ` Philipp Stanner
2025-11-26 17:26     ` Matthew Brost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).