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 Narrow the scope of the ...



details:   https://anonhg.NetBSD.org/src/rev/2186906880d5
branches:  trunk
changeset: 336471:2186906880d5
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Mar 02 23:05:03 2015 +0000

description:
Narrow the scope of the gmbus wait lock to where we need it.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 7305bac9dcb0 -r 2186906880d5 sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c   Mon Mar 02 21:55:44 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c   Mon Mar 02 23:05:03 2015 +0000
@@ -285,21 +285,19 @@
        I915_WRITE(GMBUS4 + reg_offset, gmbus4_irq_en);
 
 #ifdef __NetBSD__
-       spin_lock(&dev_priv->gmbus_wait_lock);
        if (cold) {
                i = 50;
                while (gmbus2 = I915_READ_NOTRACE(GMBUS2 + reg_offset),
                    !ISSET(gmbus2, (GMBUS_SATOER | gmbus2_status))) {
                        if (i-- == 0)
                                break;
-                       spin_unlock(&dev_priv->gmbus_wait_lock);
                        DELAY(1000);
-                       spin_lock(&dev_priv->gmbus_wait_lock);
                }
        } else {
                for (i = 0; i < mstohz(50); i++) {
                        int ret;
 
+                       spin_lock(&dev_priv->gmbus_wait_lock);
                        DRM_SPIN_TIMED_WAIT_NOINTR_UNTIL(ret,
                            &dev_priv->gmbus_wait_queue,
                            &dev_priv->gmbus_wait_lock,
@@ -307,9 +305,9 @@
                            (gmbus2 = I915_READ_NOTRACE(GMBUS2 + reg_offset),
                                ISSET(gmbus2,
                                    (GMBUS_SATOER | gmbus2_status))));
+                       spin_unlock(&dev_priv->gmbus_wait_lock);
                }
        }
-       spin_unlock(&dev_priv->gmbus_wait_lock);
 #else
        for (i = 0; i < msecs_to_jiffies_timeout(50); i++) {
                prepare_to_wait(&dev_priv->gmbus_wait_queue, &wait,



Home | Main Index | Thread Index | Old Index