All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org,
	etnaviv@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Subject: [PATCH 5/6] RDMA: use dma_resv_wait() instead of extracting the fence
Date: Thu, 28 Oct 2021 15:26:29 +0200	[thread overview]
Message-ID: <20211028132630.2330-5-christian.koenig@amd.com> (raw)
In-Reply-To: <20211028132630.2330-1-christian.koenig@amd.com>

Use dma_resv_wait() instead of extracting the exclusive fence and
waiting on it manually.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/infiniband/core/umem_dmabuf.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/core/umem_dmabuf.c b/drivers/infiniband/core/umem_dmabuf.c
index e824baf4640d..258ba9b8c17d 100644
--- a/drivers/infiniband/core/umem_dmabuf.c
+++ b/drivers/infiniband/core/umem_dmabuf.c
@@ -13,7 +13,6 @@ int ib_umem_dmabuf_map_pages(struct ib_umem_dmabuf *umem_dmabuf)
 {
 	struct sg_table *sgt;
 	struct scatterlist *sg;
-	struct dma_fence *fence;
 	unsigned long start, end, cur = 0;
 	unsigned int nmap = 0;
 	int i;
@@ -65,11 +64,8 @@ int ib_umem_dmabuf_map_pages(struct ib_umem_dmabuf *umem_dmabuf)
 	 * may be not up-to-date. Wait for the exporter to finish
 	 * the migration.
 	 */
-	fence = dma_resv_excl_fence(umem_dmabuf->attach->dmabuf->resv);
-	if (fence)
-		return dma_fence_wait(fence, false);
-
-	return 0;
+	return dma_resv_wait_timeout(umem_dmabuf->attach->dmabuf->resv, false,
+				     false, MAX_SCHEDULE_TIMEOUT);
 }
 EXPORT_SYMBOL(ib_umem_dmabuf_map_pages);
 
-- 
2.25.1


  parent reply	other threads:[~2021-10-28 13:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 13:26 [PATCH 1/6] dma-buf: move dma_resv_prune_unlocked into dma_resv.c Christian König
2021-10-28 13:26 ` [PATCH 2/6] drm/amdgpu: stop getting excl fence separately Christian König
2021-11-11  8:58   ` Christian König
2021-11-16 10:43     ` Christian König
2021-11-16 14:54       ` Deucher, Alexander
2021-10-28 13:26 ` [PATCH 3/6] drm/etnaviv: stop getting the excl fence separately here Christian König
2021-11-01  9:51   ` Lucas Stach
2021-10-28 13:26 ` [PATCH 4/6] dma-buf: drop excl_fence parameter from dma_resv_get_fences Christian König
2021-10-28 13:26 ` Christian König [this message]
2021-10-28 13:26 ` [PATCH 6/6] drm/radeon: use dma_resv_wait_timeout() instead of manually waiting Christian König
2021-11-03  7:55   ` Christian König
2021-11-03  7:55     ` Christian König
2021-11-03 16:36   ` Das, Nirmoy
2021-11-25  9:31 ` [PATCH 1/6] dma-buf: move dma_resv_prune_unlocked into dma_resv.c Maarten Lankhorst
2021-11-25  9:44   ` Christian König

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=20211028132630.2330-5-christian.koenig@amd.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=etnaviv@lists.freedesktop.org \
    --cc=linux-media@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.