From 18266487dd4009151e9a25a4a2056759cca18509 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Fri, 13 Sep 2024 10:39:12 +0300 Subject: [PATCH] arch/arm64/src/imx9/imx9_lpi2c.c: Ignore spurious RX interrupts Check remaining data count, just in case an extra RX interrupt occurs after receiving a message Signed-off-by: Jukka Laitinen --- arch/arm64/src/imx9/imx9_lpi2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/src/imx9/imx9_lpi2c.c b/arch/arm64/src/imx9/imx9_lpi2c.c index e9fc37b1edc1e..1d662986e24d5 100644 --- a/arch/arm64/src/imx9/imx9_lpi2c.c +++ b/arch/arm64/src/imx9/imx9_lpi2c.c @@ -1576,7 +1576,7 @@ static int imx9_lpi2c_isr_process(struct imx9_lpi2c_priv_s *priv) /* Check if there are received bytes */ - else if ((status & LPI2C_MSR_RDF) != 0) + else if ((status & LPI2C_MSR_RDF) != 0 && priv->dcnt > 0) { imx9_lpi2c_traceevent(priv, I2CEVENT_RCVBYTE, priv->dcnt);