Patch "i2c: xiic: Don't try to handle more interrupt events after error" has been added to the 5.10-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: xiic: Don't try to handle more interrupt events after error

to the 5.10-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-xiic-don-t-try-to-handle-more-interrupt-events-a.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 513d8061c71348ce38424f08942004a1c7dca1bf
Author: Robert Hancock <robert.hancock@xxxxxxxxxx>
Date:   Tue Jun 6 12:25:58 2023 -0600

    i2c: xiic: Don't try to handle more interrupt events after error
    
    [ Upstream commit cb6e45c9a0ad9e0f8664fd06db0227d185dc76ab ]
    
    In xiic_process, it is possible that error events such as arbitration
    lost or TX error can be raised in conjunction with other interrupt flags
    such as TX FIFO empty or bus not busy. Error events result in the
    controller being reset and the error returned to the calling request,
    but the function could potentially try to keep handling the other
    events, such as by writing more messages into the TX FIFO. Since the
    transaction has already failed, this is not helpful and will just cause
    issues.
    
    This problem has been present ever since:
    
    commit 7f9906bd7f72 ("i2c: xiic: Service all interrupts in isr")
    
    which allowed non-error events to be handled after errors, but became
    more obvious after:
    
    commit 743e227a8959 ("i2c: xiic: Defer xiic_wakeup() and
    __xiic_start_xfer() in xiic_process()")
    
    which reworked the code to add a WARN_ON which triggers if both the
    xfer_more and wakeup_req flags were set, since this combination is
    not supposed to happen, but was occurring in this scenario.
    
    Skip further interrupt handling after error flags are detected to avoid
    this problem.
    
    Fixes: 7f9906bd7f72 ("i2c: xiic: Service all interrupts in isr")
    Signed-off-by: Robert Hancock <robert.hancock@xxxxxxxxxx>
    Acked-by: Andi Shyti <andi.shyti@xxxxxxxxxx>
    Signed-off-by: Wolfram Sang <wsa@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 8b93c22f3c400..568e97c3896d1 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -422,6 +422,8 @@ static irqreturn_t xiic_process(int irq, void *dev_id)
 			wakeup_req = 1;
 			wakeup_code = STATE_ERROR;
 		}
+		/* don't try to handle other events */
+		goto out;
 	}
 	if (pend & XIIC_INTR_RX_FULL_MASK) {
 		/* Receive register/FIFO is full */



[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