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/dist/drm/i915 i915: Fix timeout return...



details:   https://anonhg.NetBSD.org/src/rev/bb2032e91538
branches:  trunk
changeset: 1029205:bb2032e91538
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Dec 27 13:29:15 2021 +0000

description:
i915: Fix timeout return value of i915_request_wait.

For some reason this returns ETIME, not ETIMEDOUT or 0 like most
other wait-with-timeout things in Linux.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_request.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 94b304cc3c64 -r bb2032e91538 sys/external/bsd/drm2/dist/drm/i915/i915_request.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_request.c        Mon Dec 27 13:29:04 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_request.c        Mon Dec 27 13:29:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_request.c,v 1.15 2021/12/27 13:29:04 riastradh Exp $      */
+/*     $NetBSD: i915_request.c,v 1.16 2021/12/27 13:29:15 riastradh Exp $      */
 
 /*
  * Copyright © 2008-2015 Intel Corporation
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_request.c,v 1.15 2021/12/27 13:29:04 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_request.c,v 1.16 2021/12/27 13:29:15 riastradh Exp $");
 
 #include <linux/dma-fence-array.h>
 #include <linux/irq_work.h>
@@ -1623,8 +1623,12 @@
                    C);
        }
 #undef C
-       if (timeout > 0)        /* succeeded before timeout */
+       if (timeout > 0) {      /* succeeded before timeout */
+               KASSERT(i915_request_completed(rq));
                dma_fence_signal_locked(&rq->fence);
+       } else if (timeout == 0) {      /* timed out */
+               timeout = -ETIME;
+       }
        spin_unlock(rq->fence.lock);
        DRM_DESTROY_WAITQUEUE(&wait.wq);
 #else



Home | Main Index | Thread Index | Old Index