[PATCH 0/1] i2c: imx: honour I2C_M_IGNORE_NAK for write messages

From: Haobin Jiang

Date: Sat Aug 29 2026 - 10:25:23 EST


Hi Andi,

This patch teaches the i.MX host driver to honour the standard
I2C_M_IGNORE_NAK flag on writes, and advertises I2C_FUNC_PROTOCOL_MANGLING
so the core will actually accept it.

Today the driver has no hardware "ignore NAK" bit and treats every NAK as
a fatal -ENXIO across all of its write paths. There are legitimate cases
where a target NAKs a write on purpose and the transfer must still
complete; the standard way to say so is I2C_M_IGNORE_NAK. One concrete
in-tree example is the ATECC508A/608A wake sequence in
drivers/crypto/atmel-i2c.c, where the still-asleep device NAKs every byte
of the wake token. I mention it only as motivation: the change itself is
driver-agnostic and simply exposes the standard flag the core already
defines.

I did look into the earlier work in this area before writing it. A 2011
mangling patch bundled NOSTART/REV_DIR_ADDR/IGNORE_NAK together and did
not honour the flag on the address byte, and a 2013 retry-on-NAK patch
retried at the controller layer, which is the wrong layer. This patch
deliberately avoids both: it implements only the standard flag, leaves
the NAK-vs-retry decision to the device driver, and changes nothing for
transfers that do not set the flag.

I would appreciate any feedback, and I am happy to adjust the commit
message or split the change if you would prefer it structured
differently.

Kind regards,
Haobin Jiang

Haobin Jiang (1):
i2c: imx: honour I2C_M_IGNORE_NAK for write messages

drivers/i2c/busses/i2c-imx.c | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)


base-commit: 04e9bf1648f846976b543e91c1838a712433772a
--
2.34.1