From: Stefan Eichenberger <eichest@gmail.com>
To: o.rempel@pengutronix.de, kernel@pengutronix.de,
andi.shyti@kernel.org, Frank.Li@nxp.com, s.hauer@pengutronix.de,
festevam@gmail.com, stefan.eichenberger@toradex.com,
francesco.dolcini@toradex.com
Cc: linux-i2c@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH v1 1/2] i2c: imx: fix i2c issue when reading multiple messages
Date: Wed, 18 Feb 2026 16:08:49 +0100 [thread overview]
Message-ID: <20260218150940.131354-2-eichest@gmail.com> (raw)
In-Reply-To: <20260218150940.131354-1-eichest@gmail.com>
From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
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>
---
drivers/i2c/busses/i2c-imx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 85f554044cf1e..56e2a14495a9a 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -1522,7 +1522,7 @@ static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs,
dev_err(&i2c_imx->adapter.dev, "<%s> read timedout\n", __func__);
return -ETIMEDOUT;
}
- if (!i2c_imx->stopped)
+ if (i2c_imx->is_lastmsg && !i2c_imx->stopped)
return i2c_imx_bus_busy(i2c_imx, 0, false);
return 0;
--
2.51.0
next parent reply other threads:[~2026-02-18 15:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260218150940.131354-1-eichest@gmail.com>
2026-02-18 15:08 ` Stefan Eichenberger [this message]
2026-02-18 16:22 ` [PATCH v1 1/2] i2c: imx: fix i2c issue when reading multiple messages Frank Li
2026-02-18 15:08 ` [PATCH v1 2/2] i2c: imx: ensure no clock is generated after last read Stefan Eichenberger
2026-02-18 16:26 ` Frank Li
2026-02-18 16:37 ` Stefan Eichenberger
2026-03-03 9:14 ` Stefan Eichenberger
2026-03-03 15:53 ` Frank Li
2026-03-04 3:00 ` Carlos Song
2026-03-19 23:09 ` Andi Shyti
2026-03-20 2:04 ` [EXT] " Carlos Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260218150940.131354-2-eichest@gmail.com \
--to=eichest@gmail.com \
--cc=Frank.Li@nxp.com \
--cc=andi.shyti@kernel.org \
--cc=festevam@gmail.com \
--cc=francesco.dolcini@toradex.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=s.hauer@pengutronix.de \
--cc=stable@vger.kernel.org \
--cc=stefan.eichenberger@toradex.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox