[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1446190649-1318-1-git-send-email-jszhang@marvell.com>
Date: Fri, 30 Oct 2015 15:37:29 +0800
From: Jisheng Zhang <jszhang@...vell.com>
To: <andriy.shevchenko@...ux.intel.com>,
<jarkko.nikula@...ux.intel.com>, <mika.westerberg@...ux.intel.com>,
<wsa@...-dreams.de>
CC: <linux-i2c@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
Jisheng Zhang <jszhang@...vell.com>
Subject: [PATCH] i2c: designware: Don't mask TX_EMPTY if write is in progress
Currently when i2c_msg index search is completed, TX_EMPTY interrupt
will be masked. But if the size of i2c_msg data is longer than the size
of the tx buffer, we still need TX_EMPTY interrupt, otherwise we will
get "controller timed out" error.
This patch fixes this issue by only masking TX_EMPTY if i2c_msg index
search is completed and write is not in progress.
Signed-off-by: Jisheng Zhang <jszhang@...vell.com>
---
drivers/i2c/busses/i2c-designware-core.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 7441cdc..a2eb212 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -542,10 +542,11 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
}
/*
- * If i2c_msg index search is completed, we don't need TX_EMPTY
- * interrupt any more.
+ * If i2c_msg index search is completed and writing is not in progress,
+ * we don't need TX_EMPTY interrupt any more.
*/
- if (dev->msg_write_idx == dev->msgs_num)
+ if (dev->msg_write_idx == dev->msgs_num &&
+ !(dev->status & STATUS_WRITE_IN_PROGRESS))
intr_mask &= ~DW_IC_INTR_TX_EMPTY;
if (dev->msg_err)
--
2.6.2
--
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