[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1337152826-9850-4-git-send-email-sonic.zhang@analog.com>
Date: Wed, 16 May 2012 15:20:22 +0800
From: <sonic.zhang@...log.com>
To: Ben Dooks <ben-linux@...ff.org>,
Wolfram Sang <w.sang@...gutronix.de>
CC: <linux-i2c@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
<uclinux-dist-devel@...ckfin.uclinux.org>,
Sonic Zhang <sonic.zhang@...log.com>
Subject: [PATCH 4/8] i2c: i2c-bfin-twi: Tighten condition when failing I2C transfer if MEN bit is reset unexpectedly.
From: Sonic Zhang <sonic.zhang@...log.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@...log.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists