Patch "i2c: imx-lpi2c: check only for enabled interrupt flags" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    i2c: imx-lpi2c: check only for enabled interrupt flags

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     i2c-imx-lpi2c-check-only-for-enabled-interrupt-flags.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1944eae1de117b336846fe8a0ef285edd88f49b7
Author: Alexander Stein <alexander.stein@xxxxxxxxxxxxxxx>
Date:   Mon Jan 30 16:32:47 2023 +0100

    i2c: imx-lpi2c: check only for enabled interrupt flags
    
    [ Upstream commit 1c7885004567e8951d65a983be095f254dd20bef ]
    
    When reading from I2C, the Tx watermark is set to 0. Unfortunately the
    TDF (transmit data flag) is enabled when Tx FIFO entries is equal or less
    than watermark. So it is set in every case, hence the reset default of 1.
    This results in the MSR_RDF _and_ MSR_TDF flags to be set thus trying
    to send Tx data on a read message.
    Mask the IRQ status to filter for wanted flags only.
    
    Fixes: a55fa9d0e42e ("i2c: imx-lpi2c: add low power i2c bus driver")
    Signed-off-by: Alexander Stein <alexander.stein@xxxxxxxxxxxxxxx>
    Tested-by: Emanuele Ghidoli <emanuele.ghidoli@xxxxxxxxxxx>
    Signed-off-by: Wolfram Sang <wsa@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index 8b9ba055c4186..2018dbcf241e9 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -502,10 +502,14 @@ static int lpi2c_imx_xfer(struct i2c_adapter *adapter,
 static irqreturn_t lpi2c_imx_isr(int irq, void *dev_id)
 {
 	struct lpi2c_imx_struct *lpi2c_imx = dev_id;
+	unsigned int enabled;
 	unsigned int temp;
 
+	enabled = readl(lpi2c_imx->base + LPI2C_MIER);
+
 	lpi2c_imx_intctrl(lpi2c_imx, 0);
 	temp = readl(lpi2c_imx->base + LPI2C_MSR);
+	temp &= enabled;
 
 	if (temp & MSR_RDF)
 		lpi2c_imx_read_rxfifo(lpi2c_imx);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux