From: Mehmet Fide <mehmet.fide@gmail.com>
To: Andi Shyti <andi.shyti@kernel.org>,
Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>,
Frank Li <Frank.Li@nxp.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Stefan Eichenberger <eichest@gmail.com>,
Yao Yuan <yao.yuan@freescale.com>, Wolfram Sang <wsa@kernel.org>,
linux-i2c@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
mehmet.fide@screeningeagle.com
Subject: [PATCH v2 0/3] i2c: imx: fixes for a DMA write that is not acknowledged
Date: Thu, 19 Nov 2026 14:42:22 +0100 [thread overview]
Message-ID: <20261119134225.265242-1-mehmet.fide@gmail.com> (raw)
From: Mehmet Fide <mehmet.fide@screeningeagle.com>
A write of DMA_THRESHOLD bytes or more to an address that does not
answer leaves the interrupt status behind, so that the next DMA read
returns 0xff for every byte without an error (patch 1). It also leaves
its DMA buffer mapped, as every terminated DMA transfer does (patch 2),
and it blocks for DMA_TIMEOUT before it fails with -ETIMEDOUT instead
of -ENXIO (patch 3). Patch 3 needs patches 1 and 2.
Tested on a Colibri VF50 on the Iris carrier (i2c0 with DMA, M41T0 RTC
at 0x68) with this base, the other i2c-imx fixes on the list [1-4],
PROVE_LOCKING and DMA_API_DEBUG. Each round wrote 20 bytes to an unused
address and read 16 bytes of the RTC:
without the series, 200 rounds: 124 writes failed with -ETIMEDOUT
after up to 1.08 s, none with -ENXIO, 163 reads failed, 128 more
DMA mappings in use afterwards
with the series, 200 + 300 rounds: every write failed with -ENXIO
within 10 ms, every read was right, 4 more DMA mappings in use
after the first 200 rounds and none more after the next 300
On a v6.12 product kernel with the series backported, 200 rounds that
also wrote 18 bytes to a device that acknowledges them: every NACKed
write failed with -ENXIO at once and every acknowledged write went
through. A NACK of the last byte the DMA writes could not be provoked
on either board, so that path is not tested.
For stable: 6.12.y and older need backports, as noted on v1; I can
send them once the patches are in mainline.
Changes in v2:
- 2/3: new. Sashiko on v1 2/2: the new -ENXIO path left the DMA buffer
mapped, as the timeout path already did
- 3/3 (v1 2/2): a NACK of the last byte the DMA writes was missed
(Sashiko). Its acknowledge is now checked once the byte is out,
before the final byte is sent
- 1/3: no change
- rebased on v7.4-rc3+ (4405c18c95d2) and tested on that base; v1
was compile tested on its base only
v1: https://lore.kernel.org/linux-i2c/20261113073250.1037215-1-mehmet.fide@gmail.com/
[1] https://lore.kernel.org/linux-i2c/20261113110501.1142036-1-mehmet.fide@gmail.com/
[2] https://lore.kernel.org/linux-i2c/20261116122707.1349139-1-mehmet.fide@gmail.com/
[3] https://lore.kernel.org/linux-i2c/20261116125940.1368194-1-mehmet.fide@gmail.com/
[4] https://lore.kernel.org/linux-i2c/20261119130542.180192-1-mehmet.fide@gmail.com/
Mehmet Fide (3):
i2c: imx: do not carry the interrupt status over to the next transfer
i2c: imx: unmap the DMA buffer when a transfer is terminated
i2c: imx: return -ENXIO at once when a DMA write is not acknowledged
drivers/i2c/busses/i2c-imx.c | 52 +++++++++++++++++++++++-------------
1 file changed, 34 insertions(+), 18 deletions(-)
base-commit: 4405c18c95d2d0f99f6c581ef0ee8591a1aa6ccd
--
2.56.0
next reply other threads:[~2026-11-19 13:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 13:42 Mehmet Fide [this message]
2026-11-19 13:42 ` [PATCH v2 1/3] i2c: imx: do not carry the interrupt status over to the next transfer Mehmet Fide
2026-11-19 13:42 ` [PATCH v2 2/3] i2c: imx: unmap the DMA buffer when a transfer is terminated Mehmet Fide
2026-11-19 13:42 ` [PATCH v2 3/3] i2c: imx: return -ENXIO at once when a DMA write is not acknowledged Mehmet Fide
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=20261119134225.265242-1-mehmet.fide@gmail.com \
--to=mehmet.fide@gmail.com \
--cc=Frank.Li@nxp.com \
--cc=andi.shyti@kernel.org \
--cc=eichest@gmail.com \
--cc=festevam@gmail.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=mehmet.fide@screeningeagle.com \
--cc=o.rempel@pengutronix.de \
--cc=s.hauer@pengutronix.de \
--cc=stable@vger.kernel.org \
--cc=wsa@kernel.org \
--cc=yao.yuan@freescale.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