Skip to content

Commit 31367b8

Browse files
committed
Revert "i2c: at91: Read all available bytes at once"
This reverts commit e8f39e9. This commit makes linux go in infinite loop inside IRQ context if any i2c device is stuck. Linux will keep receiving RXRDY. So this is not a good way to handle reading from the controller
1 parent e318512 commit 31367b8

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

drivers/i2c/busses/i2c-at91.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -518,16 +518,8 @@ static irqreturn_t atmel_twi_interrupt(int irq, void *dev_id)
518518
* the RXRDY interrupt first in order to not keep garbage data in the
519519
* Receive Holding Register for the next transfer.
520520
*/
521-
if (irqstatus & AT91_TWI_RXRDY) {
522-
/*
523-
* Read all available bytes at once by polling RXRDY usable w/
524-
* and w/o FIFO. With FIFO enabled we could also read RXFL and
525-
* avoid polling RXRDY.
526-
*/
527-
do {
528-
at91_twi_read_next_byte(dev);
529-
} while (at91_twi_read(dev, AT91_TWI_SR) & AT91_TWI_RXRDY);
530-
}
521+
if (irqstatus & AT91_TWI_RXRDY)
522+
at91_twi_read_next_byte(dev);
531523

532524
/*
533525
* When a NACK condition is detected, the I2C controller sets the NACK,

0 commit comments

Comments
 (0)