[PATCH] dma-buf/dma-fence: Signal all callbacks from dma_fence_release()

Christian König deathsimple at vodafone.de
Tue Aug 15 12:01:56 UTC 2017


Am 15.08.2017 um 13:23 schrieb Chris Wilson:
> Quoting Christian König (2017-08-13 14:04:29)
>> Am 11.08.2017 um 19:01 schrieb Chris Wilson:
>>> This is an illegal scenario, to free the fence whilst there are pending
>>> callbacks. Currently, we emit a WARN and then cast aside the callbacks
>>> leaving them dangling. Alternatively, we could set an error on the fence
>>> and then signal fence so that any dependency chains from the fence can
>>> be tidied up, and if they care they can check for the error.
>>>
>>> The question is whether or not the cure is worse than the disease
>>> (premature fence signaling is never pretty).
>>>
>>> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
>> Not sure if -EDEADLK is the best error code, but in general the approach
>> sounds like the least evil to me.
> EDEADLK felt appropriate since that was the situation that I expect might
> arise, well livelock.
>
> -ENXIO? That seems a reasonable alternative.
> -ENODEV?
> The classic -ENOTTY?

No strong opinion either. For now I think we should just stick with 
-EDEADLK.

We would need something like -EHUMAN, because in this particular case 
the human who wrote the code has messed up the reference counting.

Christian.

> -Chris




More information about the dri-devel mailing list