Skip to content

RFC dma-fence: Remove TIMESTAMP bit

Philipp Stanner amd-gfx dri-devel intel-gfx linux-media lkml stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8dma-buf: dma-fence: Hot-fix timestamp misorderingdrivers/dma-buf/dma-fence.c include/linux/dma-fence.h+15 -20 replies
2/8drm/sched: Hot-fix timestamp misorderingdrivers/gpu/drm/scheduler/sched_main.c+10 -20 replies
3/8dma-buf: dma-fence: Ensure ordering with locks for timestampsdrivers/dma-buf/dma-fence.c include/linux/dma-fence.h+12 -210 replies
4/8dma-buf: dma-fence: Improve dma_fence_timestamp()drivers/dma-buf/dma-fence-unwrap.c drivers/dma-buf/sync_file.c drivers/gpu/drm/scheduler/sched_entity.c +2 more+53 -330 replies
5/8drm/amdgpu: Stop using dma_fence internalsdrivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c+6 -50 replies
6/8dma-buf: sync_debug: don't use TIMESTAMP bitdrivers/dma-buf/sync_debug.c+4 -40 replies
7/8drm/i915: Remove TIMESTAMP bitdrivers/gpu/drm/i915/gt/intel_breadcrumbs.c+0 -10 replies
8/8dma-buf: dma-fence: Remove TIMESTAMP bitdrivers/dma-buf/dma-fence.c include/linux/dma-fence.h+0 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/8] dma-fence: Remove TIMESTAMP bit

The timestamp bit is annoying and dangerous because it makes memory ordering difficult. It's only accessor function, dma_fence_timestamp(), is unnecessarily complicated.

The current state is largely UB. Most notably, since there is no memory ordering, people might accidentally read a list head for a timestamp, generating total bogus output.

I have previously proposed backporting a hot fix for the ordering [1]. Tvrtko recently dived into fixing drm_sched [2].

My hope would be that the full drm_sched fix could be set on top of this series.

The first two patches could be backported into misc-fixes, and the rest enter into misc-next? I'm not entirely sure what the best strategy is.

Pls review,
P.

[1] https://lore.kernel.org/dri-devel/[email protected]/
[2] https://lore.kernel.org/dri-devel/[email protected]/

Philipp Stanner (8):
dma-buf: dma-fence: Hot-fix timestamp misordering drm/sched: Hot-fix timestamp misordering
dma-buf: dma-fence: Ensure ordering with locks for timestamps
dma-buf: dma-fence: Improve dma_fence_timestamp() drm/amdgpu: Stop using dma_fence internals
dma-buf: sync_debug: don't use TIMESTAMP bit drm/i915: Remove TIMESTAMP bit
dma-buf: dma-fence: Remove TIMESTAMP bit

 drivers/dma-buf/dma-fence-unwrap.c          | 20 ++++++++++-----
 drivers/dma-buf/dma-fence.c                 |  2 --
 drivers/dma-buf/sync_debug.c                |  8 +++---
 drivers/dma-buf/sync_file.c                 |  8 +++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c     | 11 ++++----
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c |  1 -
 drivers/gpu/drm/scheduler/sched_entity.c    |  4 +--
 drivers/gpu/drm/scheduler/sched_main.c      | 26 +++++++++++++++----
 include/linux/dma-fence.h                   | 28 +++++++++++++--------
 9 files changed, 68 insertions(+), 40 deletions(-)
Signature · 1 line
2.56.0