]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
i2c: imx: ensure no clock is generated after last read
authorStefan Eichenberger <stefan.eichenberger@toradex.com>
Wed, 18 Feb 2026 15:08:50 +0000 (16:08 +0100)
committerAndi Shyti <andi.shyti@kernel.org>
Fri, 27 Mar 2026 12:51:21 +0000 (13:51 +0100)
commit13101db735bdb29c5f60e95fb578690bd178b30f
treec2580e001b777e3af4344d36144f4c634e08d694
parentf88e2e748a1fc3cb4b8d163a9be790812f578850
i2c: imx: ensure no clock is generated after last read

When reading from the I2DR register, right after releasing the bus by
clearing MSTA and MTX, the I2C controller might still generate an
additional clock cycle which can cause devices to misbehave. Ensure to
only read from I2DR after the bus is not busy anymore. Because this
requires polling, the read of the last byte is moved outside of the
interrupt handler.

An example for such a failing transfer is this:
i2ctransfer -y -a 0 w1@0x00 0x02 r1
Error: Sending messages failed: Connection timed out
It does not happen with every device because not all devices react to
the additional clock cycle.

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>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260218150940.131354-3-eichest@gmail.com
drivers/i2c/busses/i2c-imx.c