[PATCH v3] dma-buf/sync_file: Increment refcount of fence when all are signaled.

Sumit Semwal sumit.semwal at linaro.org
Tue Sep 20 12:58:08 UTC 2016


Hi Rafael,

On 16 September 2016 at 00:44, Rafael Antognolli
<rafael.antognolli at intel.com> wrote:
> When we merge several fences, if all of them are signaled already, we
> still keep one of them. So instead of using add_fence(), which will not
> increase the refcount of signaled fences, we should explicitly call
> fence_get() for the fence we are keeping.
>
> This patch fixes a kernel panic that can be triggered by creating a fence that
> is expired (or increasing the timeline until it expires), then creating a
> merged fence out of it, and deleting the merged fence. This will make the
> original expired fence's refcount go to zero.
>
> Testcase: igt/sw_sync/sync_expired_merge
> Signed-off-by: Rafael Antognolli <rafael.antognolli at intel.com>
> Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
> Reviewed-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
Thanks for the patch; applied via drm-misc.

> ---
>  drivers/dma-buf/sync_file.c | 6 ++----
Best,
Sumit.


More information about the dri-devel mailing list