• Sonic Zhang's avatar
    i2c: i2c-bfin-twi: Improve the patch for bug "Illegal i2c bus lock upon... · a20a64d2
    Sonic Zhang authored
    i2c: i2c-bfin-twi: Improve the patch for bug "Illegal i2c bus lock upon certain transfer scenarios".
    
    For transfer counts > 255 bytes i2c-bfin-twi sets the data
    transfer counter DCNT to 0xFF indicating unlimited transfers.
    It then uses a flag iface->manual_stop to manually issue the STOP
    condition, once the required amount of bytes are received.
    
    We found that on I2C receive operation issuing the STOP condition
    together with a FULL RCV FIFO (2bytes) will cause SDA and SCL be
    constantly driven low.
    
    This patch stops receiving operation immediately in last rx interrupt.
    This patch also wakes up waiting process when transfer completes.
    Signed-off-by: default avatarSonic Zhang <sonic.zhang@analog.com>
    Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
    a20a64d2
i2c-bfin-twi.c 20.2 KB