Patch "i2c: mpc: Restore reread of I2C status register" has been added to the 5.13-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: mpc: Restore reread of I2C status register

to the 5.13-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-mpc-restore-reread-of-i2c-status-register.patch
and it can be found in the queue-5.13 subdirectory.

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



commit 1df5ad62286cb1a2cb8b180a29a62f70e2fb49f4
Author: Chris Packham <chris.packham@xxxxxxxxxxxxxxxxxxx>
Date:   Fri Jul 2 15:27:24 2021 +1200

    i2c: mpc: Restore reread of I2C status register
    
    [ Upstream commit 763778cd79267dadf0ec7e044caf7563df0ab597 ]
    
    Prior to commit 1538d82f4647 ("i2c: mpc: Interrupt driven transfer") the
    old interrupt handler would reread MPC_I2C_SR after checking the CSR_MIF
    bit. When the driver was re-written this was removed as it seemed
    unnecessary. However as it turns out this is necessary for i2c devices
    which do clock stretching otherwise we end up thinking the bus is still
    busy when processing the interrupt.
    
    Fixes: 1538d82f4647 ("i2c: mpc: Interrupt driven transfer")
    Signed-off-by: Chris Packham <chris.packham@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Wolfram Sang <wsa@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index dcca9c2396db..6d5014ebaab5 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -635,6 +635,8 @@ static irqreturn_t mpc_i2c_isr(int irq, void *dev_id)
 
 	status = readb(i2c->base + MPC_I2C_SR);
 	if (status & CSR_MIF) {
+		/* Read again to allow register to stabilise */
+		status = readb(i2c->base + MPC_I2C_SR);
 		writeb(0, i2c->base + MPC_I2C_SR);
 		mpc_i2c_do_intr(i2c, status);
 		return IRQ_HANDLED;



[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