android_kernel_motorola_sm6375/drivers/i2c
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Robert Hancock 33efc8da77 i2c: xiic: Wait for TX empty to avoid missed TX NAKs
commit 521da1e9225450bd323db5fa5bca942b1dc485b7 upstream.

Frequently an I2C write will be followed by a read, such as a register
address write followed by a read of the register value. In this driver,
when the TX FIFO half empty interrupt was raised and it was determined
that there was enough space in the TX FIFO to send the following read
command, it would do so without waiting for the TX FIFO to actually
empty.

Unfortunately it appears that in some cases this can result in a NAK
that was raised by the target device on the write, such as due to an
unsupported register address, being ignored and the subsequent read
being done anyway. This can potentially put the I2C bus into an
invalid state and/or result in invalid read data being processed.

To avoid this, once a message has been fully written to the TX FIFO,
wait for the TX FIFO empty interrupt before moving on to the next
message, to ensure NAKs are handled properly.

Fixes: e1d5b6598c ("i2c: Add support for Xilinx XPS IIC Bus Interface")
Signed-off-by: Robert Hancock <[email protected]>
Cc: <[email protected]> # v2.6.34+
Reviewed-by: Manikanta Guntupalli <[email protected]>
Acked-by: Michal Simek <[email protected]>
Signed-off-by: Andi Shyti <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2024-11-08 16:20:39 +01:00
..
algos
busses i2c: xiic: Wait for TX empty to avoid missed TX NAKs 2024-11-08 16:20:39 +01:00
muxes i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node() 2023-11-08 11:23:36 +01:00
i2c-boardinfo.c
i2c-core-acpi.c
i2c-core-base.c i2c: smbus: fix NULL function pointer dereference 2024-05-02 16:18:37 +02:00
i2c-core-of.c
i2c-core-slave.c
i2c-core-smbus.c
i2c-core.h i2c: core: Fix atomic xfer check for non-preempt config 2024-01-15 18:25:27 +01:00
i2c-dev.c
i2c-mux.c i2c: mux: Avoid potential false error message in i2c_mux_add_adapter 2023-10-25 11:53:23 +02:00
i2c-slave-eeprom.c
i2c-smbus.c i2c: smbus: Send alert notifications to all devices if source not found 2024-08-19 05:33:50 +02:00
i2c-stub.c
Kconfig
Makefile