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 Fix two more gmbus wait ...



details:   https://anonhg.NetBSD.org/src/rev/cd1fa80cb71e
branches:  trunk
changeset: 806542:cd1fa80cb71e
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Feb 28 04:54:12 2015 +0000

description:
Fix two more gmbus wait bugs.

- Fix sense of return value in intel_dp_aux_wait_done.
- Make the waits uninterruptible here like in Linux.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/intel_dp.c  |  12 +++++++++---
 sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c |   5 +++--
 2 files changed, 12 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r cc6ed742dcb8 -r cd1fa80cb71e sys/external/bsd/drm2/dist/drm/i915/intel_dp.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_dp.c    Sat Feb 28 04:47:44 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_dp.c    Sat Feb 28 04:54:12 2015 +0000
@@ -371,10 +371,16 @@
        if (has_aux_irq && !cold) {
                int ret;
                spin_lock(&dev_priv->gmbus_wait_lock);
-               DRM_SPIN_TIMED_WAIT_UNTIL(ret, &dev_priv->gmbus_wait_queue,
-                   &dev_priv->gmbus_wait_lock, msecs_to_jiffies_timeout(10),
+               DRM_SPIN_TIMED_WAIT_NOINTR_UNTIL(ret,
+                   &dev_priv->gmbus_wait_queue, &dev_priv->gmbus_wait_lock,
+                   msecs_to_jiffies_timeout(10),
                    C);
-               done = ret;     /* XXX ugh */
+               if (ret < 0)    /* Failure: pretend same as done.  */
+                       done = true;
+               else if (ret == 0) /* Timed out: not done.  */
+                       done = false;
+               else            /* Succeeded (ret > 0): done.  */
+                       done = true;
                spin_unlock(&dev_priv->gmbus_wait_lock);
        } else {
                done = wait_for_atomic(C, 10) == 0;
diff -r cc6ed742dcb8 -r cd1fa80cb71e sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c   Sat Feb 28 04:47:44 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c   Sat Feb 28 04:54:12 2015 +0000
@@ -299,8 +299,9 @@
                }
        } else {
                int ret;
-               DRM_SPIN_TIMED_WAIT_UNTIL(ret, &dev_priv->gmbus_wait_queue,
-                   &dev_priv->gmbus_wait_lock, mstohz(50),
+               DRM_SPIN_TIMED_WAIT_NOINTR_UNTIL(ret,
+                   &dev_priv->gmbus_wait_queue, &dev_priv->gmbus_wait_lock,
+                   mstohz(50),
                    (gmbus2 = I915_READ_NOTRACE(GMBUS2 + reg_offset),
                        ISSET(gmbus2, (GMBUS_SATOER | gmbus2_status))));
        }



Home | Main Index | Thread Index | Old Index