diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c index 90ca593d8ae380..5b2589b6b9cc8d 100644 --- a/drivers/i2c/busses/i2c-bcm2835.c +++ b/drivers/i2c/busses/i2c-bcm2835.c @@ -373,10 +373,6 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) u32 val, err; val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S); - bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_S, - BCM2835_I2C_S_CLKT | - BCM2835_I2C_S_ERR | - BCM2835_I2C_S_DONE); bcm2835_debug_add(i2c_dev, val); err = val & (BCM2835_I2C_S_CLKT | BCM2835_I2C_S_ERR); @@ -386,9 +382,6 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) } if (val & BCM2835_I2C_S_DONE) { - if (val & BCM2835_I2C_S_TA) - return IRQ_HANDLED; - if (!i2c_dev->curr_msg) { dev_err(i2c_dev->dev, "Got unexpected interrupt (from firmware?)\n"); } else if (i2c_dev->curr_msg->flags & I2C_M_RD) { @@ -396,10 +389,7 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S); } - if (i2c_dev->msg_buf_remaining) - return IRQ_HANDLED; - - if (val & BCM2835_I2C_S_RXD) + if ((val & BCM2835_I2C_S_RXD) || i2c_dev->msg_buf_remaining) i2c_dev->msg_err = BCM2835_I2C_S_LEN; else i2c_dev->msg_err = 0; @@ -436,6 +426,8 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) complete: bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, BCM2835_I2C_C_CLEAR); + bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_S, BCM2835_I2C_S_CLKT | + BCM2835_I2C_S_ERR | BCM2835_I2C_S_DONE); complete(&i2c_dev->completion); return IRQ_HANDLED;