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 Recheck condition after ...



details:   https://anonhg.NetBSD.org/src/rev/5dda565e7d57
branches:  trunk
changeset: 806537:5dda565e7d57
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Feb 28 03:27:38 2015 +0000

description:
Recheck condition after wait in wait_for like Linux does.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/intel_drv.h |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r e89a02353eba -r 5dda565e7d57 sys/external/bsd/drm2/dist/drm/i915/intel_drv.h
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_drv.h   Sat Feb 28 03:23:32 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_drv.h   Sat Feb 28 03:27:38 2015 +0000
@@ -50,7 +50,9 @@
                int ms = (MS);                                          \
                while (!(COND)) {                                       \
                        if (--ms < 0) {                                 \
-                               ret__ = -ETIMEDOUT;                     \
+                               DELAY(1000);                            \
+                               if (!(COND))                            \
+                                       ret__ = -ETIMEDOUT;             \
                                break;                                  \
                        }                                               \
                        DELAY(1000);                                    \
@@ -59,7 +61,8 @@
                unsigned long timeout__ = jiffies + msecs_to_jiffies(MS); \
                while (!(COND)) {                                       \
                        if (time_after(jiffies, timeout__)) {           \
-                               ret__ = -ETIMEDOUT;                     \
+                               if (!(COND))                            \
+                                       ret__ = -ETIMEDOUT;             \
                                break;                                  \
                        }                                               \
                        if ((W) && drm_can_sleep())  {                  \



Home | Main Index | Thread Index | Old Index