i2c: rk3x: Leave the irq handle if received nack irq

In the TRX mode, if there was a nack signal at the hardware's
tx, we can get start and nack ipd from the I2C_IPD register,
which will enter nack process, send stop command, change the
state to stop, and enter the handler of stop irq, but the stop
irq may not be generated, it has a latency. So the log will like
this:

[ 69.961944] rk3x-i2c ff650000.i2c: unexpected irq in STOP: 0x10
[ 70.959690] rk3x-i2c ff650000.i2c: timeout, ipd: 0x00, state: 4

This error log will confuse us, it is not easier to locate the problem,
we should get nack error at this time, and processing stop interrupt at
the next, then complete this i2c job.

Change-Id: I073ef288557b1b6f525d936e8f32d9d165c81ec4
Signed-off-by: David Wu <david.wu@rock-chips.com>
This commit is contained in:
David Wu
2018-10-18 18:18:32 +08:00
committed by Tao Huang
parent 71e358a704
commit b6331d5cd1

View File

@@ -510,8 +510,10 @@ static irqreturn_t rk3x_i2c_irq(int irqno, void *dev_id)
ipd &= ~REG_INT_NAKRCV;
if (!(i2c->msg->flags & I2C_M_IGNORE_NAK))
if (!(i2c->msg->flags & I2C_M_IGNORE_NAK)) {
rk3x_i2c_stop(i2c, -ENXIO);
goto out;
}
}
/* is there anything left to handle? */