mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikko Perttunen <cyndis@kapsi.fi>
To: Sumit Semwal <sumit.semwal@linaro.org>,
	Gustavo Padovan <gustavo@padovan.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	Mikko Perttunen <mperttunen@nvidia.com>
Subject: Re: [PATCH] dma_buf/sync_file: Enable signaling for fences when querying status
Date: Fri, 1 Sep 2023 12:37:51 +0300	[thread overview]
Message-ID: <55b5f086-22c9-e25c-bb25-f1a74906f5dc@kapsi.fi> (raw)
In-Reply-To: <20230725074611.3309115-1-cyndis@kapsi.fi>

On 7/25/23 10:46, Mikko Perttunen wrote:
> From: Mikko Perttunen <mperttunen@nvidia.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@nvidia.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

  reply	other threads:[~2023-09-01 10:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25  7:46 Mikko Perttunen
2023-09-01  9:37 ` Mikko Perttunen [this message]
2025-07-08 12:03 Mikko Perttunen
2025-07-08 14:20 ` Christian König
2025-07-09  1:28   ` Mikko Perttunen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55b5f086-22c9-e25c-bb25-f1a74906f5dc@kapsi.fi \
    --to=cyndis@kapsi.fi \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo@padovan.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mperttunen@nvidia.com \
    --cc=sumit.semwal@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®