]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
i2c: exynos5: Avoid transaction timeouts due TRANSFER_DONE_AUTO not set
authorJavier Martinez Canillas <javier@osg.samsung.com>
Thu, 9 Mar 2017 14:05:33 +0000 (11:05 -0300)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 9 Mar 2017 14:50:16 +0000 (15:50 +0100)
commit9ad224744218a352964f31007a1420f2420a08a0
tree04edfe6e90608d0c8f37c1aefc5472e94ad6b087
parentab809fd81fde3d416f8656d8f814a0777fb9b65e
i2c: exynos5: Avoid transaction timeouts due TRANSFER_DONE_AUTO not set

After commit 7999eecb7e56 ("i2c: exynos5: fix arbitration lost handling"),
some I2C transactions are failing because the TRANSFER_DONE_AUTO field is
not set in the I2C_TRANS_STATUS register so the i2c->status value is left
to -EINVAL causing the i2c->msg_complete completion to never be signaled.

For example, when reading the time of an I2C rtc on an Exynos5800 machine:

$ cat /sys/class/rtc/rtc0/time
[   25.924594] exynos5-hsi2c 12e10000.i2c: rx timeout
[   65.028365] max77686-rtc max77802-rtc: Fail to read time reg(-22)
cat: /sys/class/rtc/rtc0/time: Invalid argument

The Exynos5422 manual states clearly that most I2C_TRANS_STATUS reg bits
(including TRANSFER_DONE_AUTO) are cleared after the register is read. So
reading has side effects and should only be done if HSI2C_INT_I2C was set.

Fixes: 7999eecb7e56 ("i2c: exynos5: fix arbitration lost handling")
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-exynos5.c