On 11/4/25 16:01, Tvrtko Ursulin wrote:
> On 31/10/2025 13:16, Christian König wrote:
>> /**
>> * dma_fence_get_stub - return a signaled fence
>> *
>> - * Return a stub fence which is already signaled. The fence's
>> - * timestamp corresponds to the first time after boot this
>> - * function is called.
>> + * Return a stub fence which is already signaled. The fence's timestamp
>> + * corresponds to the initialisation time of the linux kernel.
>> */
>> struct dma_fence *dma_fence_get_stub(void)
>> {
>> - spin_lock(&dma_fence_stub_lock);
>> - if (!dma_fence_stub.ops) {
>> - dma_fence_init(&dma_fence_stub,
>> - &dma_fence_stub_ops,
>> - &dma_fence_stub_lock,
>> - 0, 0);
>> -
>> - set_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT,
>> - &dma_fence_stub.flags);
>> -
>> - dma_fence_signal_locked(&dma_fence_stub);
>> - }
>> - spin_unlock(&dma_fence_stub_lock);
>> -
>> return dma_fence_get(&dma_fence_stub);
>
> Actually could you check if this could be demoted to static inline? It
> strikes me pointless to export a symbol for such a trivial wrapper.
I thought about that previously as well, but the answer is "No it can't".
We would need to expose the dma_fence_stub symbol then and the reason we have
the function in the first place is to avoid that.
Regards,
Christian.
>
> Regards,
>
> Tvrtko
>
>> }
>> EXPORT_SYMBOL(dma_fence_get_stub);
>