Skip to content

Commit cb6e45c

Browse files
robhancocksedwsakernel
authored andcommitted
i2c: xiic: Don't try to handle more interrupt events after error
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 7f9906b ("i2c: xiic: Service all interrupts in isr") which allowed non-error events to be handled after errors, but became more obvious after: commit 743e227 ("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: 7f9906b ("i2c: xiic: Service all interrupts in isr") Signed-off-by: Robert Hancock <[email protected]> Acked-by: Andi Shyti <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 7b82e90 commit cb6e45c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/i2c/busses/i2c-xiic.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,8 @@ static irqreturn_t xiic_process(int irq, void *dev_id)
721721
wakeup_req = 1;
722722
wakeup_code = STATE_ERROR;
723723
}
724+
/* don't try to handle other events */
725+
goto out;
724726
}
725727
if (pend & XIIC_INTR_RX_FULL_MASK) {
726728
/* Receive register/FIFO is full */

0 commit comments

Comments
 (0)