lkml.org 
[lkml]   [2012]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4/8] i2c: i2c-bfin-twi: Tighten condition when failing I2C transfer if MEN bit is reset unexpectedly.
    Date
    From: Sonic Zhang <sonic.zhang@analog.com>

    Correct I2C transfer may fail because interrupt status bits XMTSERV and
    RCVSERV are not checked when MCOMP interrupt is handled.

    Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
    ---
    drivers/i2c/busses/i2c-bfin-twi.c | 3 ++-
    1 files changed, 2 insertions(+), 1 deletions(-)

    diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c
    index 4abaf59..63fb84f 100644
    --- a/drivers/i2c/busses/i2c-bfin-twi.c
    +++ b/drivers/i2c/busses/i2c-bfin-twi.c
    @@ -201,7 +201,8 @@ static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface,
    return;
    }
    if (twi_int_status & MCOMP) {
    - if ((read_MASTER_CTL(iface) & MEN) == 0 &&
    + if (twi_int_status & (XMTSERV|RCVSERV) &&
    + (read_MASTER_CTL(iface) & MEN) == 0 &&
    (iface->cur_mode == TWI_I2C_MODE_REPEAT ||
    iface->cur_mode == TWI_I2C_MODE_COMBINED)) {
    iface->result = -1;
    --
    1.7.0.4



    \
     
     \ /
      Last update: 2012-05-16 10:21    [W:0.026 / U:90.764 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site