diff options
author | Andrzej Hajda <[email protected]> | 2017-02-22 11:11:20 +0100 |
---|---|---|
committer | Wolfram Sang <[email protected]> | 2017-02-23 12:59:48 +0100 |
commit | fd1c9c8568439198a66f42108a9b01854e25346e (patch) | |
tree | 0b88f808a983e8670ab1f6cbba3d22bba1a057e2 | |
parent | e3ccc921b7d8fd1fcd10a00720e09823d8078666 (diff) |
i2c: exynos5: disable fifo-almost-empty irq signal when necessary
Fifo-almost-empty irq signal should be disabled as soon as possible,
to avoid unnecessary interrupt storm. The best moment is when there is
no more data to feed fifo.
This patch fixes system stalls caused by IRQ storm.
Signed-off-by: Andrzej Hajda <[email protected]>
Tested-by: Marek Szyprowski <[email protected]>
Tested-by: Andi Shyti <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
-rw-r--r-- | drivers/i2c/busses/i2c-exynos5.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index bea607149972..00e81e3564ff 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -502,8 +502,13 @@ static irqreturn_t exynos5_i2c_irq(int irqno, void *dev_id) fifo_level = HSI2C_TX_FIFO_LVL(fifo_status); len = i2c->variant->fifo_depth - fifo_level; - if (len > (i2c->msg->len - i2c->msg_ptr)) + if (len > (i2c->msg->len - i2c->msg_ptr)) { + u32 int_en = readl(i2c->regs + HSI2C_INT_ENABLE); + + int_en &= ~HSI2C_INT_TX_ALMOSTEMPTY_EN; + writel(int_en, i2c->regs + HSI2C_INT_ENABLE); len = i2c->msg->len - i2c->msg_ptr; + } while (len > 0) { byte = i2c->msg->buf[i2c->msg_ptr++]; |