linux-stable/drivers/dma-buf
Christian König d67b5a2b97 dma-buf: add dma_fence_timestamp helper
commit b83ce9cb4a upstream.

When a fence signals there is a very small race window where the timestamp
isn't updated yet. sync_file solves this by busy waiting for the
timestamp to appear, but on other ocassions didn't handled this
correctly.

Provide a dma_fence_timestamp() helper function for this and use it in
all appropriate cases.

Another alternative would be to grab the spinlock when that happens.

v2 by teddy: add a wait parameter to wait for the timestamp to show up, in case
   the accurate timestamp is needed and/or the timestamp is not based on
   ktime (e.g. hw timestamp)
v3 chk: drop the parameter again for unified handling

Signed-off-by: Yunxiang Li <Yunxiang.Li@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: 1774baa64f ("drm/scheduler: Change scheduled fence track v2")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
CC: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20230929104725.2358-1-christian.koenig@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-19 23:08:57 +02:00
..
heaps dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
dma-buf-sysfs-stats.c dma-buf: fix dma_buf_export init order v2 2023-01-24 07:24:30 +01:00
dma-buf-sysfs-stats.h dma-buf: fix dma_buf_export init order v2 2023-01-24 07:24:30 +01:00
dma-buf.c dma-buf: Add unlocked variant of attachment-mapping functions 2023-09-23 11:11:08 +02:00
dma-fence-array.c dma-buf: handle empty dma_fence_arrays gracefully 2022-03-29 09:14:30 +02:00
dma-fence-chain.c dma-buf: cleanup dma_fence_chain_walk 2022-05-30 11:24:50 +02:00
dma-fence-unwrap.c dma-buf: add dma_fence_timestamp helper 2023-10-19 23:08:57 +02:00
dma-fence.c dma-buf: fix an error pointer vs NULL bug 2023-08-03 10:24:19 +02:00
dma-heap.c dma-buf: fix racing conflict of dma_heap_add() 2022-11-22 18:27:56 +05:30
dma-resv.c dma-buf/dma-resv: Stop leaking on krealloc() failure 2023-07-27 08:50:27 +02:00
Kconfig dma-buf: deprecate DMABUF_SYSFS_STATS 2022-06-23 10:51:43 +02:00
Makefile dma-buf: cleanup dma_fence_unwrap implementation 2022-05-30 14:16:32 +02:00
selftest.c
selftest.h
selftests.h dma-buf: add dma_fence_unwrap v2 2022-03-25 14:18:28 +01:00
st-dma-fence-chain.c dma-buf: Enable signaling on fence for selftests 2022-09-16 15:53:25 +02:00
st-dma-fence-unwrap.c dma-buf: Enable signaling on fence for selftests 2022-09-16 15:53:25 +02:00
st-dma-fence.c dma-buf: Enable signaling on fence for selftests 2022-09-16 15:53:25 +02:00
st-dma-resv.c dma-buf: Enable signaling on fence for selftests 2022-09-16 15:53:25 +02:00
sw_sync.c dma-buf/sw_sync: Avoid recursive lock during fence signal 2023-08-30 16:11:12 +02:00
sync_debug.c
sync_debug.h
sync_file.c dma-buf: add dma_fence_timestamp helper 2023-10-19 23:08:57 +02:00
sync_trace.h
udmabuf.c whack-a-mole: cropped up open-coded file_inode() uses... 2022-10-06 17:22:11 -07:00