Re: [PATCH v2] drm/nouveau: Prevent signalled fences in pending list

Christian König
2025-04-03T13:21:06Z

Am 03.04.25 um 15:15 schrieb Danilo Krummrich:
> On Thu, Apr 03, 2025 at 02:58:13PM +0200, Philipp Stanner wrote:
>> On Thu, 2025-04-03 at 14:08 +0200, Christian König wrote:
>>> Am 03.04.25 um 12:13 schrieb Philipp Stanner:
>>> BTW: nouveau_fence_no_signaling() looks completely broken as well. It
>>> calls nouveau_fence_is_signaled() and then list_del() on the fence
>>> head.
>> I can assure you that a great many things in Nouveau look completely
>> broken.
>>
>> The question for us is always the cost-benefit-ratio when fixing bugs.
>> There are fixes that solve the bug with reasonable effort, and there
>> are great reworks towards an ideal state.
> That's just an additional thing that Christian noticed. It isn't really directly
> related to what you want to fix with your patch.

Well there is some relation. From nouveau_fence_no_signaling():

if (nouveau_fence_is_signaled(f)) {
list_del(&fence->head);

dma_fence_put(&fence->base);
return false;
}

That looks like somebody realized that the fence needs to be removed from the pending list and the reference dropped.

It's just that this was added to the wrong function, e.g. those lines need to be in nouveau_fence_is_signaled() and not here.

Regards,
Christian.

>
> I think the function can simply be dropped.