lkml.org 
[lkml]   [2012]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 09/13 v4] drm/i915/intel_i2c: use double-buffered writes
    Date
    The GMBUS controller GMBUS3 register is double-buffered.  Take advantage
    of this by writing two 4-byte words before the first wait for HW_RDY.
    This helps keep the GMBUS controller from becoming idle during long writes.

    Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
    ---
    drivers/gpu/drm/i915/intel_i2c.c | 14 +++++++-------
    1 files changed, 7 insertions(+), 7 deletions(-)

    diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
    index 5a94e9b..c576e02 100644
    --- a/drivers/gpu/drm/i915/intel_i2c.c
    +++ b/drivers/gpu/drm/i915/intel_i2c.c
    @@ -262,13 +262,6 @@ gmbus_xfer_write(struct drm_i915_private *dev_priv, struct i2c_msg *msg,
    GMBUS_SLAVE_WRITE | GMBUS_SW_RDY);
    POSTING_READ(GMBUS2 + reg_offset);
    while (len) {
    - if (wait_for(I915_READ(GMBUS2 + reg_offset) &
    - (GMBUS_SATOER | GMBUS_HW_RDY),
    - 50))
    - return -ETIMEDOUT;
    - if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER)
    - return -ENXIO;
    -
    val = loop = 0;
    do {
    val |= *buf++ << (8 * loop);
    @@ -276,6 +269,13 @@ gmbus_xfer_write(struct drm_i915_private *dev_priv, struct i2c_msg *msg,

    I915_WRITE(GMBUS3 + reg_offset, val);
    POSTING_READ(GMBUS2 + reg_offset);
    +
    + if (wait_for(I915_READ(GMBUS2 + reg_offset) &
    + (GMBUS_SATOER | GMBUS_HW_RDY),
    + 50))
    + return -ETIMEDOUT;
    + if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER)
    + return -ENXIO;
    }
    return 0;
    }
    --
    1.7.7.3


    \
     
     \ /
      Last update: 2012-03-27 20:39    [W:3.361 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site