On Monday, September 08, 2014 at 08:06:12 PM, Janusz Użycki wrote: > Subject: [PATCH 2/2] i2c-mxs: fixed PIO NACK error instead of timeout > (1000ms) > > i2cdetect scanned i2c bus very slow if address was not occupied by any > device. Shouldn't this check be used only after the 'SELECT' command ? > Signed-off-by: Janusz Uzycki <j.uzycki@xxxxxxxxxxxxxx> > --- > linux-3.14.17/drivers/i2c/busses/i2c-mxs.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/linux-3.14.17/drivers/i2c/busses/i2c-mxs.c > b/linux-3.14.17/drivers/i2c/busses/i2c-mxs.c > index 87ee72d..b498708 100644 > --- a/linux-3.14.17/drivers/i2c/busses/i2c-mxs.c > +++ b/linux-3.14.17/drivers/i2c/busses/i2c-mxs.c > @@ -307,6 +307,9 @@ static int mxs_i2c_pio_wait_xfer_end(struct > mxs_i2c_dev *i2c) > unsigned long timeout = jiffies + msecs_to_jiffies(1000); > > while (readl(i2c->regs + MXS_I2C_CTRL0) & MXS_I2C_CTRL0_RUN) { > + /*int ret = mxs_i2c_pio_check_error_state(i2c);*/ > + if (readl(i2c->regs + MXS_I2C_CTRL1) & > MXS_I2C_CTRL1_NO_SLAVE_ACK_IRQ) > + return -ENXIO; > if (time_after(jiffies, timeout)) > return -ETIMEDOUT; > cond_resched(); > -- > 1.7.11.3 Best regards, Marek Vasut -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html