From: "Christian König" <christian.koenig@amd.com>
To: Lionel Landwerlin <lionel.g.landwerlin@intel.com>,
dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, chris@chris-wilson.co.uk
Subject: Re: [Intel-gfx] [PATCH 2/2] dma-buf: fix dma-fence-chain out of order test
Date: Thu, 25 Jun 2020 14:44:08 +0200 [thread overview]
Message-ID: <e782f2eb-2345-a66f-6d5a-78fe3aeaaa85@amd.com> (raw)
In-Reply-To: <20200625123443.19680-2-lionel.g.landwerlin@intel.com>
Am 25.06.20 um 14:34 schrieb Lionel Landwerlin:
> There was probably a misunderstand on how the dma-fence-chain is
> supposed to work or what dma_fence_chain_find_seqno() is supposed to
> return.
>
> dma_fence_chain_find_seqno() is here to give us the fence to wait upon
> for a particular point in the timeline. The timeline progresses only
> when all the points prior to a given number have completed.
>
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> Fixes: dc2f7e67a28a5c ("dma-buf: Exercise dma-fence-chain under selftests")
Acked-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/dma-buf/st-dma-fence-chain.c | 43 ++++++++++++++--------------
> 1 file changed, 21 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/dma-buf/st-dma-fence-chain.c b/drivers/dma-buf/st-dma-fence-chain.c
> index 5d45ba7ba3cd..9525f7f56119 100644
> --- a/drivers/dma-buf/st-dma-fence-chain.c
> +++ b/drivers/dma-buf/st-dma-fence-chain.c
> @@ -318,15 +318,16 @@ static int find_out_of_order(void *arg)
> goto err;
> }
>
> - if (fence && fence != fc.chains[1]) {
> + /*
> + * We signaled the middle fence (2) of the 1-2-3 chain. The behavior
> + * of the dma-fence-chain is to make us wait for all the fences up to
> + * the point we want. Since fence 1 is still not signaled, this what
> + * we should get as fence to wait upon (fence 2 being garbage
> + * collected during the traversal of the chain).
> + */
> + if (fence != fc.chains[0]) {
> pr_err("Incorrect chain-fence.seqno:%lld reported for completed seqno:2\n",
> - fence->seqno);
> -
> - dma_fence_get(fence);
> - err = dma_fence_chain_find_seqno(&fence, 2);
> - dma_fence_put(fence);
> - if (err)
> - pr_err("Reported %d for finding self!\n", err);
> + fence ? fence->seqno : 0);
>
> err = -EINVAL;
> }
> @@ -415,20 +416,18 @@ static int __find_race(void *arg)
> if (!fence)
> goto signal;
>
> - err = dma_fence_chain_find_seqno(&fence, seqno);
> - if (err) {
> - pr_err("Reported an invalid fence for find-self:%d\n",
> - seqno);
> - dma_fence_put(fence);
> - break;
> - }
> -
> - if (fence->seqno < seqno) {
> - pr_err("Reported an earlier fence.seqno:%lld for seqno:%d\n",
> - fence->seqno, seqno);
> - err = -EINVAL;
> - dma_fence_put(fence);
> - break;
> + /*
> + * We can only find ourselves if we are on fence we were
> + * looking for.
> + */
> + if (fence->seqno == seqno) {
> + err = dma_fence_chain_find_seqno(&fence, seqno);
> + if (err) {
> + pr_err("Reported an invalid fence for find-self:%d\n",
> + seqno);
> + dma_fence_put(fence);
> + break;
> + }
> }
>
> dma_fence_put(fence);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2020-06-25 12:44 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 12:34 [Intel-gfx] [PATCH 1/2] Revert "dma-buf: Report signaled links inside dma-fence-chain" Lionel Landwerlin
2020-06-25 12:34 ` [Intel-gfx] [PATCH 2/2] dma-buf: fix dma-fence-chain out of order test Lionel Landwerlin
2020-06-25 12:44 ` Christian König [this message]
2020-06-25 13:18 ` Chris Wilson
2020-06-25 13:23 ` Lionel Landwerlin
2020-06-25 13:47 ` Chris Wilson
2020-06-25 13:56 ` Lionel Landwerlin
2020-06-25 13:59 ` Daniel Vetter
2020-07-02 12:57 ` Christian König
2020-06-25 12:43 ` [Intel-gfx] [PATCH 1/2] Revert "dma-buf: Report signaled links inside dma-fence-chain" Christian König
2020-06-25 17:13 ` Dave Airlie
2020-06-25 19:27 ` Jani Nikula
2020-06-25 19:54 ` Daniel Vetter
2020-06-26 4:43 ` Sumit Semwal
2020-06-26 7:03 ` Christian König
2020-06-26 12:39 ` Daniel Vetter
2020-06-26 15:34 ` Sumit Semwal
2020-06-26 1:36 ` Dave Airlie
2020-07-02 8:26 ` Lionel Landwerlin
2020-07-02 8:28 ` Christian König
2020-06-26 14:15 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] " Patchwork
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=e782f2eb-2345-a66f-6d5a-78fe3aeaaa85@amd.com \
--to=christian.koenig@amd.com \
--cc=chris@chris-wilson.co.uk \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lionel.g.landwerlin@intel.com \
/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