From: Carlos Song <carlos.song@oss.nxp.com>
To: Michael Walle <mwalle@kernel.org>,
Dong Aisheng <aisheng.dong@nxp.com>,
Andi Shyti <andi.shyti@kernel.org>, Frank Li <Frank.Li@nxp.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>
Cc: Carlos Song <carlos.song@nxp.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
linux-i2c@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] i2c: imx-lpi2c: don't treat a NACK in SMBus block read as an error
Date: Thu, 5 Nov 2026 16:33:23 +0800 [thread overview]
Message-ID: <aa852e02-41f9-4d06-ba65-3a4145475628@oss.nxp.com> (raw)
In-Reply-To: <20261104121108.659820-2-mwalle@kernel.org>
> An SMBus device might indicate that a value isn't ready yet by asserting
> a NACK.
> This will lead to the following error message which will flood the
> kernel log for some device like an IPMI SSIF BMC:
>
> [ 4.277005] i2c i2c-5: SMBus read count failed -110
>
> Stop the polling if NDF is set and return -EIO, just like everywhere
> else. While at it, drop the MSR_RDF_ASSERTED() macro, it's just one bit,
> no need for FIELD_GET.
>
> Fixes: efdc383d1cc2 ("i2c: imx-lpi2c: fix SMBus block read NACK after byte count")
> Signed-off-by: Michael Walle <mwalle@kernel.org>
> ---
> drivers/i2c/busses/i2c-imx-lpi2c.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
> index f57e800ac3b5..583155802e8a 100644
> --- a/drivers/i2c/busses/i2c-imx-lpi2c.c
> +++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
> @@ -92,7 +92,6 @@
> #define MRDR_RXEMPTY BIT(14)
> #define MDER_TDDE BIT(0)
> #define MDER_RDDE BIT(1)
> -#define MSR_RDF_ASSERTED(x) FIELD_GET(MSR_RDF, (x))
>
> #define SCR_SEN BIT(0)
> #define SCR_RST BIT(1)
> @@ -594,7 +593,10 @@ static int lpi2c_imx_read_init(struct lpi2c_imx_struct *lpi2c_imx,
> writel((RECV_DATA << 8) | 0x01, lpi2c_imx->base + LPI2C_MTDR);
>
> ret = readl_poll_timeout(lpi2c_imx->base + LPI2C_MSR, val,
> - MSR_RDF_ASSERTED(val), 1, 1000);
> + (val & (MSR_RDF | MSR_NDF)), 1, 1000);
> + if (val & MSR_NDF)
> + return -EIO;
> +
> if (ret) {
> dev_err(&lpi2c_imx->adapter.dev, "SMBus read count failed %d\n", ret);
> return ret;
LGTM,
Acked-by: Carlos Song <carlos.song@nxp.com>
--
Best Regards,
Carlos
next prev parent reply other threads:[~2026-11-05 8:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 12:10 [PATCH 1/2] i2c: imx-lpi2c: fix SMBus block read with PEC Michael Walle
2026-11-04 12:10 ` [PATCH 2/2] i2c: imx-lpi2c: don't treat a NACK in SMBus block read as an error Michael Walle
2026-11-05 8:33 ` Carlos Song [this message]
2026-11-05 8:29 ` [PATCH 1/2] i2c: imx-lpi2c: fix SMBus block read with PEC Carlos Song
2026-11-05 8:41 ` Michael Walle
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=aa852e02-41f9-4d06-ba65-3a4145475628@oss.nxp.com \
--to=carlos.song@oss.nxp.com \
--cc=Frank.Li@nxp.com \
--cc=aisheng.dong@nxp.com \
--cc=andi.shyti@kernel.org \
--cc=carlos.song@nxp.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=mwalle@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=wsa+renesas@sang-engineering.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
all inboxes | Powered by JetHome®