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 Assert EWOULDBLOCK happens only ...



details:   https://anonhg.NetBSD.org/src/rev/4ab3c6f64fb2
branches:  trunk
changeset: 366476:4ab3c6f64fb2
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Aug 28 15:03:39 2018 +0000

description:
Assert EWOULDBLOCK happens only with timeout.

diffstat:

 sys/external/bsd/drm2/linux/linux_fence.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r 022543e82ba3 -r 4ab3c6f64fb2 sys/external/bsd/drm2/linux/linux_fence.c
--- a/sys/external/bsd/drm2/linux/linux_fence.c Tue Aug 28 14:57:03 2018 +0000
+++ b/sys/external/bsd/drm2/linux/linux_fence.c Tue Aug 28 15:03:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_fence.c,v 1.10 2018/08/28 14:23:02 riastradh Exp $       */
+/*     $NetBSD: linux_fence.c,v 1.11 2018/08/28 15:03:39 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_fence.c,v 1.10 2018/08/28 14:23:02 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_fence.c,v 1.11 2018/08/28 15:03:39 riastradh Exp $");
 
 #include <sys/atomic.h>
 #include <sys/condvar.h>
@@ -713,8 +713,11 @@
        spin_unlock(fence->lock);
 
        /* If cv_timedwait gave up, return 0 meaning timeout.  */
-       if (ret == -EWOULDBLOCK)
+       if (ret == -EWOULDBLOCK) {
+               /* Only cv_timedwait and cv_timedwait_sig can return this.  */
+               KASSERT(timeout < MAX_SCHEDULE_TIMEOUT);
                return 0;
+       }
 
        /* If there was a timeout and the deadline passed, return 0.  */
        if (timeout < MAX_SCHEDULE_TIMEOUT) {



Home | Main Index | Thread Index | Old Index