lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <55b5f086-22c9-e25c-bb25-f1a74906f5dc@kapsi.fi>
Date:   Fri, 1 Sep 2023 12:37:51 +0300
From:   Mikko Perttunen <cyndis@...si.fi>
To:     Sumit Semwal <sumit.semwal@...aro.org>,
        Gustavo Padovan <gustavo@...ovan.org>
Cc:     linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        dri-devel@...ts.freedesktop.org,
        Mikko Perttunen <mperttunen@...dia.com>
Subject: Re: [PATCH] dma_buf/sync_file: Enable signaling for fences when
 querying status

On 7/25/23 10:46, Mikko Perttunen wrote:
> From: Mikko Perttunen <mperttunen@...dia.com>
> 
> dma_fence_get_status is not guaranteed to return valid information
> on if the fence has been signaled or not if SW signaling has not
> been enabled for the fence. To ensure valid information is reported,
> enable SW signaling for fences before getting their status.
> 
> Signed-off-by: Mikko Perttunen <mperttunen@...dia.com>
> ---
>   drivers/dma-buf/sync_file.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
> index af57799c86ce..57f194b8477f 100644
> --- a/drivers/dma-buf/sync_file.c
> +++ b/drivers/dma-buf/sync_file.c
> @@ -267,6 +267,7 @@ static int sync_fill_fence_info(struct dma_fence *fence,
>   	strscpy(info->driver_name, fence->ops->get_driver_name(fence),
>   		sizeof(info->driver_name));
>   
> +	dma_fence_enable_sw_signaling(fence);
>   	info->status = dma_fence_get_status(fence);
>   	while (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags) &&
>   	       !test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags))
> @@ -307,6 +308,7 @@ static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
>   	 * info->num_fences.
>   	 */
>   	if (!info.num_fences) {
> +		dma_fence_enable_sw_signaling(sync_file->fence);
>   		info.status = dma_fence_get_status(sync_file->fence);
>   		goto no_fences;
>   	} else {

Any thoughts?

Mikko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ