From f8d598778fb0a94fcb536323358fdbba8c5200ce Mon Sep 17 00:00:00 2001 From: Kyungwoo Kang Date: Tue, 9 Jan 2018 16:24:06 +0900 Subject: [PATCH] [COMMON] i2c: exynos5: Add checking Transfer done at ISR Previously when NACK occurred we just retry the protocol. But it is possible to TR_DONE interrupt occur at the process of NACK ISR. To prevent TR_DONE interrupt clear, we consider TR_DONE at NACK ISR. Change-Id: I3eb57019de66849e75c5f53dbfeb4d988c81bdc0 Signed-off-by: Kyungwoo Kang --- drivers/i2c/busses/i2c-exynos5.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index 4d7994e627b4..e19cb31ab4be 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -601,6 +601,8 @@ static irqreturn_t exynos5_i2c_irq(int irqno, void *dev_id) if (reg_val & HSI2C_INT_NODEV) { dev_err(i2c->dev, "HSI2C NO ACK occured\n"); if (i2c->nack_restart) + if (reg_val & HSI2C_INT_TRANSFER_DONE) + exynos5_i2c_stop(i2c); goto out; } -- 2.20.1