mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
__rcu annotations on the return types from dma_fence_driver_name() and
dma_fence_timeline_name() cause sparse to complain because both the
constant signaled strings, and the strings return by the dma_fence_ops are
not __rcu annotated.
For a simple fix it is easiest to cast them with __rcu added and undo the
smarts from the tracpoints side of things. There is no functional change
since the rest is left in place. Later we can consider changing the
dma_fence_ops return types too, and handle all the individual drivers
which define them.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Fixes: 506aa8b02a ("dma-fence: Add safe access helpers and document the rules")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506162214.1eA69hLe-lkp@intel.com/
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20250616155952.24259-1-tvrtko.ursulin@igalia.com
Signed-off-by: Christian König <christian.koenig@amd.com>
95 lines
1.8 KiB
C
95 lines
1.8 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#undef TRACE_SYSTEM
|
|
#define TRACE_SYSTEM dma_fence
|
|
|
|
#if !defined(_TRACE_DMA_FENCE_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
#define _TRACE_DMA_FENCE_H
|
|
|
|
#include <linux/tracepoint.h>
|
|
|
|
struct dma_fence;
|
|
|
|
/*
|
|
* Safe only for call sites which are guaranteed to not race with fence
|
|
* signaling,holding the fence->lock and having checked for not signaled, or the
|
|
* signaling path itself.
|
|
*/
|
|
DECLARE_EVENT_CLASS(dma_fence,
|
|
|
|
TP_PROTO(struct dma_fence *fence),
|
|
|
|
TP_ARGS(fence),
|
|
|
|
TP_STRUCT__entry(
|
|
__string(driver, fence->ops->get_driver_name(fence))
|
|
__string(timeline, fence->ops->get_timeline_name(fence))
|
|
__field(unsigned int, context)
|
|
__field(unsigned int, seqno)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
__assign_str(driver);
|
|
__assign_str(timeline);
|
|
__entry->context = fence->context;
|
|
__entry->seqno = fence->seqno;
|
|
),
|
|
|
|
TP_printk("driver=%s timeline=%s context=%u seqno=%u",
|
|
__get_str(driver), __get_str(timeline), __entry->context,
|
|
__entry->seqno)
|
|
);
|
|
|
|
DEFINE_EVENT(dma_fence, dma_fence_emit,
|
|
|
|
TP_PROTO(struct dma_fence *fence),
|
|
|
|
TP_ARGS(fence)
|
|
);
|
|
|
|
DEFINE_EVENT(dma_fence, dma_fence_init,
|
|
|
|
TP_PROTO(struct dma_fence *fence),
|
|
|
|
TP_ARGS(fence)
|
|
);
|
|
|
|
DEFINE_EVENT(dma_fence, dma_fence_destroy,
|
|
|
|
TP_PROTO(struct dma_fence *fence),
|
|
|
|
TP_ARGS(fence)
|
|
);
|
|
|
|
DEFINE_EVENT(dma_fence, dma_fence_enable_signal,
|
|
|
|
TP_PROTO(struct dma_fence *fence),
|
|
|
|
TP_ARGS(fence)
|
|
);
|
|
|
|
DEFINE_EVENT(dma_fence, dma_fence_signaled,
|
|
|
|
TP_PROTO(struct dma_fence *fence),
|
|
|
|
TP_ARGS(fence)
|
|
);
|
|
|
|
DEFINE_EVENT(dma_fence, dma_fence_wait_start,
|
|
|
|
TP_PROTO(struct dma_fence *fence),
|
|
|
|
TP_ARGS(fence)
|
|
);
|
|
|
|
DEFINE_EVENT(dma_fence, dma_fence_wait_end,
|
|
|
|
TP_PROTO(struct dma_fence *fence),
|
|
|
|
TP_ARGS(fence)
|
|
);
|
|
|
|
#endif /* _TRACE_DMA_FENCE_H */
|
|
|
|
/* This part must be outside protection */
|
|
#include <trace/define_trace.h>
|