Skip to content

Commit f88e2e7

Browse files
eichenbergerAndi Shyti
authored andcommitted
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: 5f5c2d4 ("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
1 parent c369299 commit f88e2e7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/i2c/busses/i2c-imx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@ static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs,
15221522
dev_err(&i2c_imx->adapter.dev, "<%s> read timedout\n", __func__);
15231523
return -ETIMEDOUT;
15241524
}
1525-
if (!i2c_imx->stopped)
1525+
if (i2c_imx->is_lastmsg && !i2c_imx->stopped)
15261526
return i2c_imx_bus_busy(i2c_imx, 0, false);
15271527

15281528
return 0;

0 commit comments

Comments
 (0)