Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/linux drm: Fix dma_resv_test_signaled_...



details:   https://anonhg.NetBSD.org/src/rev/b9d3da7e203c
branches:  trunk
changeset: 1028902:b9d3da7e203c
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:26:30 2021 +0000

description:
drm: Fix dma_resv_test_signaled_rcu and dma_resv_wait_timeout_rcu.

Make them implemented the semantics as documented like Linux does:
only test the exclusive fence if there's no shared fences.

diffstat:

 sys/external/bsd/drm2/linux/linux_dma_resv.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r 1496aa625a73 -r b9d3da7e203c sys/external/bsd/drm2/linux/linux_dma_resv.c
--- a/sys/external/bsd/drm2/linux/linux_dma_resv.c      Sun Dec 19 12:26:22 2021 +0000
+++ b/sys/external/bsd/drm2/linux/linux_dma_resv.c      Sun Dec 19 12:26:30 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_dma_resv.c,v 1.14 2021/12/19 12:26:22 riastradh Exp $    */
+/*     $NetBSD: linux_dma_resv.c,v 1.15 2021/12/19 12:26:30 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_dma_resv.c,v 1.14 2021/12/19 12:26:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_resv.c,v 1.15 2021/12/19 12:26:30 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/poll.h>
@@ -1044,6 +1044,8 @@
                if (!dma_resv_read_valid(robj, &ticket))
                        goto restart;
        }
+       if (shared_count)
+               goto out;
 
        /* If there is an exclusive fence, test it.  */
        KASSERT(fence == NULL);
@@ -1131,6 +1133,8 @@
                if (!dma_resv_read_valid(robj, &ticket))
                        goto restart;
        }
+       if (shared_count)
+               goto out;
 
        /* If there is an exclusive fence, test it.  */
        KASSERT(fence == NULL);
@@ -1144,7 +1148,7 @@
                fence = NULL;
        }
 
-       /* Success!  Return the number of ticks left.  */
+out:   /* Success!  Return the number of ticks left.  */
        rcu_read_unlock();
        KASSERT(fence == NULL);
        return timeout;



Home | Main Index | Thread Index | Old Index