[PATCH] dma-buf: fix reservation_object_wait_timeout_rcu to wait correctly

Christian König deathsimple at vodafone.de
Mon Jul 24 09:58:15 UTC 2017


Am 24.07.2017 um 10:34 schrieb zhoucm1:
>
>
> On 2017年07月22日 00:20, Christian König wrote:
>> From: Christian König <christian.koenig at amd.com>
>>
>> With hardware resets in mind it is possible that all shared fences are
>> signaled, but the exlusive isn't. Fix waiting for everything in this 
>> situation.
>>
>> Signed-off-by: Christian König <christian.koenig at amd.com>
>> ---
>>   drivers/dma-buf/reservation.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/dma-buf/reservation.c 
>> b/drivers/dma-buf/reservation.c
>> index e2eff86..ce3f9c1 100644
>> --- a/drivers/dma-buf/reservation.c
>> +++ b/drivers/dma-buf/reservation.c
>> @@ -461,7 +461,7 @@ long reservation_object_wait_timeout_rcu(struct 
>> reservation_object *obj,
>>           }
>>       }
>>   -    if (!shared_count) {
>> +    if (!fence) {
> previous code seems be a bug, the exclusive fence isn't be waited at 
> all if shared_count != 0.
>
> With your fix, there still is a case the exclusive fence could be 
> skipped, that when fobj->shared[shared_count-1] isn't signalled.

Yeah, indeed that looks like it needs to be fixed as well.

I'm still completely jet lagged and need to work through tons of stuff 
from last week. Do you have time to take care of fixing up this patch 
and send a v2?

Thanks in advance,
Christian.

>
> Regards,
> David Zhou
>>           struct dma_fence *fence_excl = 
>> rcu_dereference(obj->fence_excl);
>>             if (fence_excl &&
>



More information about the dri-devel mailing list