From 085bde1e91d85435c44a752bd59d38cf31465518 Mon Sep 17 00:00:00 2001 From: Jae Hyun Yoo Date: Thu, 11 Jul 2019 14:04:39 -0700 Subject: [PATCH] i2c: aspeed: add SLAVE_ADDR_RECEIVED_PENDING interrupt handling If a peer master sends messages too quickly before it processes previous slave DMA data handling, this indicator will be set. It's just a indicator and driver can't recover this case so just ignore it. Signed-off-by: Jae Hyun Yoo --- drivers/i2c/busses/i2c-aspeed.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c index d41f377de9dc..46de9a01a0eb 100644 --- a/drivers/i2c/busses/i2c-aspeed.c +++ b/drivers/i2c/busses/i2c-aspeed.c @@ -86,6 +86,7 @@ * These share bit definitions, so use the same values for the enable & * status bits. */ +#define ASPEED_I2CD_INTR_SLAVE_ADDR_RECEIVED_PENDING BIT(30) #define ASPEED_I2CD_INTR_SLAVE_INACTIVE_TIMEOUT BIT(15) #define ASPEED_I2CD_INTR_SDA_DL_TIMEOUT BIT(14) #define ASPEED_I2CD_INTR_BUS_RECOVER_DONE BIT(13) @@ -353,6 +354,18 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status) dev_dbg(bus->dev, "slave irq status 0x%08x, cmd 0x%08x\n", irq_status, command); + /* + * If a peer master sends messages too quickly before it processes + * previous slave DMA data handling, this indicator will be set. It's + * just a indicator and driver can't recover this case so just ignore + * it. + */ + if (unlikely(irq_status & + ASPEED_I2CD_INTR_SLAVE_ADDR_RECEIVED_PENDING)) { + dev_dbg(bus->dev, "A slave addr match interrupt is pending.\n"); + irq_handled |= ASPEED_I2CD_INTR_SLAVE_ADDR_RECEIVED_PENDING; + } + /* Slave was sent something. */ if (irq_status & ASPEED_I2CD_INTR_RX_DONE) { if (bus->dma_buf && -- 2.7.4