]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i2c: omap: Fix standard mode false ACK readings
authorReid Tonking <reidt@ti.com>
Wed, 26 Apr 2023 19:49:56 +0000 (14:49 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:10:54 +0000 (23:10 +0900)
commit c770657bd2611b077ec1e7b1fe6aa92f249399bd upstream.

Using standard mode, rare false ACK responses were appearing with
i2cdetect tool. This was happening due to NACK interrupt triggering
ISR thread before register access interrupt was ready. Removing the
NACK interrupt's ability to trigger ISR thread lets register access
ready interrupt do this instead.

Cc: <stable@vger.kernel.org> # v3.7+
Fixes: 3b2f8f82dad7 ("i2c: omap: switch to threaded IRQ support")
Signed-off-by: Reid Tonking <reidt@ti.com>
Acked-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-omap.c

index f9ae520aed22863ba19e98c99a640115bec91f90..7ec2521997061e69d699508aac624629cb6f808c 100644 (file)
@@ -1058,7 +1058,7 @@ omap_i2c_isr(int irq, void *dev_id)
        u16 stat;
 
        stat = omap_i2c_read_reg(omap, OMAP_I2C_STAT_REG);
-       mask = omap_i2c_read_reg(omap, OMAP_I2C_IE_REG);
+       mask = omap_i2c_read_reg(omap, OMAP_I2C_IE_REG) & ~OMAP_I2C_STAT_NACK;
 
        if (stat & mask)
                ret = IRQ_WAKE_THREAD;