linux-stable/drivers/i2c
Javier Martinez Canillas 9ad2247442 i2c: exynos5: Avoid transaction timeouts due TRANSFER_DONE_AUTO not set
After commit 7999eecb7e ("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: 7999eecb7e ("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>
2017-03-09 15:50:16 +01:00
..
algos i2c: algo-bit: declare i2c_bit_quirk_no_clk_stretch as static 2016-05-11 17:16:30 +02:00
busses i2c: exynos5: Avoid transaction timeouts due TRANSFER_DONE_AUTO not set 2017-03-09 15:50:16 +01:00
muxes Merge branch 'i2c-mux/for-next' of https://github.com/peda-r/i2c-mux into i2c/for-4.11 2017-02-10 12:51:23 +01:00
i2c-boardinfo.c i2c: copy device properties when using i2c_register_board_info() 2017-03-08 18:05:09 +01:00
i2c-core.c Merge branch 'i2c/for-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2017-02-25 14:21:18 -08:00
i2c-core.h
i2c-dev.c i2c: fix kernel memory disclosure in dev interface 2017-01-12 20:06:10 +01:00
i2c-mux.c i2c: add missing of_node_put in i2c_mux_del_adapters 2017-03-08 17:59:12 +01:00
i2c-slave-eeprom.c i2c: Drop owner assignment from i2c_driver 2015-08-10 08:37:35 +02:00
i2c-smbus.c i2c: use an IRQ to report Host Notify events, not alert 2016-11-24 16:22:06 +01:00
i2c-stub.c i2c: i2c-stub: sort includes 2016-02-20 23:33:39 +01:00
Kconfig Merge branch 'i2c/for-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2016-12-15 12:56:35 -08:00
Makefile i2c: slave-eeprom: add eeprom simulator driver 2014-12-11 22:25:54 +01:00