Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i2c: imx: fix i2c issue when reading multiple messages

When reading multiple messages, meaning a repeated start is required,
polling the bus busy bit must be avoided. This must only be done for
the last message. Otherwise, the driver will timeout.

Here an example of such a sequence that fails with an error:
i2ctransfer -y -a 0 w1@0x00 0x02 r1 w1@0x00 0x02 r1
Error: Sending messages failed: Connection timed out

Fixes: 5f5c2d4579ca ("i2c: imx: prevent rescheduling in non dma mode")
Cc: stable@vger.kernel.org # v6.13+
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260218150940.131354-2-eichest@gmail.com

authored by

Stefan Eichenberger and committed by
Andi Shyti
f88e2e74 c3692998

+1 -1
+1 -1
drivers/i2c/busses/i2c-imx.c
··· 1522 1522 dev_err(&i2c_imx->adapter.dev, "<%s> read timedout\n", __func__); 1523 1523 return -ETIMEDOUT; 1524 1524 } 1525 - if (!i2c_imx->stopped) 1525 + if (i2c_imx->is_lastmsg && !i2c_imx->stopped) 1526 1526 return i2c_imx_bus_busy(i2c_imx, 0, false); 1527 1527 1528 1528 return 0;