On 3/6/26 10:46, Boris Brezillon wrote:
> On Fri, 6 Mar 2026 09:10:52 +0100
> Christian König <[email protected]> wrote:
>> Well as I wrote above you either have super reliable locking in your 
>> signaling path or you will need that for error handling.
> 
> Not really. With rust's ownership model, you can make it so only one
> thread gets to own the DriverFence (the signal-able fence object), and
> the DriverFence::signal() method consumes this object. This implies
> that only one path gets to signal the DriverFence, and after that it
> vanishes, so no one else can signal it anymore. Just to clarify, by
> vanishes, I mean that the signal-able view disappears, but the
> observable object (Fence) can stay around, so it can be monitored (and
> only monitored) by others. With this model, it doesn't matter that
> _set_error() is set under a dma_fence locked section or not, because
> the concurrency is addressed at a higher level.

That whole approach won't work. You have at least the IRQ handler which signals 
completion and the timeout handler which signals completion with an error.

We have documented that this handling is mandatory for DMA-fences since so many 
driver implementations got it wrong.

That's why Philips patch set removed the return value from dma_fence_signal().

Regards,
Christian.

Reply via email to