kernel_samsung_a53x/drivers/i2c/busses
Robert Hancock b66ee2f40f 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: e1d5b6598cdc ("i2c: Add support for Xilinx XPS IIC Bus Interface")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Cc: <stable@vger.kernel.org> # v2.6.34+
Reviewed-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-23 23:21:42 +01:00
..
acpm-mfd-bus.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-acorn.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-ali15x3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-ali1535.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-ali1563.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-altera.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-amd-mp2-pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-amd-mp2-plat.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-amd-mp2.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-amd756-s4882.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-amd756.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-amd8111.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-aspeed.c i2c: aspeed: Update the stop sw state when the bus recovery occurs 2024-11-23 23:21:34 +01:00
i2c-at91-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-at91-master.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-at91-slave.c i2c: at91: Fix the functionality flags of the slave-only interface 2024-11-19 14:19:05 +01:00
i2c-at91.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-au1550.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-axxia.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-bcm-iproc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-bcm-kona.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-bcm2835.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-brcmstb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-cadence.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-cbus-gpio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-cht-wc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-cpm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-cros-ec-tunnel.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-davinci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-designware-baytrail.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-designware-common.c i2c: designware: Fix corrupted memory seen in the ISR 2024-11-18 12:11:18 +01:00
i2c-designware-core.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-designware-master.c i2c: designware: Disable TX_EMPTY irq while waiting for block length byte 2024-11-18 11:43:30 +01:00
i2c-designware-pcidrv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-designware-platdrv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-designware-slave.c i2c: designware: Fix the functionality flags of the slave-only interface 2024-11-19 14:19:05 +01:00
i2c-digicolor.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-diolan-u2c.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-dln2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-efm32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-eg20t.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-elektor.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-emev2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-exynos5.c i2c: exynos5: Silence noisy error and info logs 2024-11-17 17:45:37 +01:00
i2c-exynos5.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-fsi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-gpio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-highlander.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-hix5hd2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-hydra.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-i801.c i2c: i801: Annotate apanel_addr as __ro_after_init 2024-11-19 14:19:40 +01:00
i2c-ibm_iic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-ibm_iic.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-icy.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-img-scb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-imx-lpi2c.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-imx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-iop3xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-iop3xx.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-isch.c i2c: isch: Add missed 'else' 2024-11-23 23:21:34 +01:00
i2c-ismt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-jz4780.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-kempld.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-lpc2k.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-meson.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-mlxbf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-mlxcpld.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-mpc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-mt65xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-mt7621.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-mv64xxx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-mxs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-nforce2-s4985.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-nforce2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-nomadik.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-npcm7xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-nvidia-gpu.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-ocores.c i2c: ocores: set IACK bit after core is enabled 2024-11-19 14:19:10 +01:00
i2c-octeon-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-octeon-core.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-octeon-platdrv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-omap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-opal.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-owl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-parport.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-pasemi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-pca-isa.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-pca-platform.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-piix4.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-pmcmsp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-pnx.c i2c: pnx: Fix potential deadlock warning from del_timer_sync() call in isr 2024-11-19 14:19:42 +01:00
i2c-powermac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-pxa-pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-pxa.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-qcom-cci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-qcom-geni.c i2c: qcom-geni: Use IRQF_NO_AUTOEN flag in request_irq() 2024-11-23 23:21:42 +01:00
i2c-qup.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-rcar.c i2c: rcar: fix error code in probe() 2024-11-19 14:19:46 +01:00
i2c-riic.c i2c: riic: avoid potential division by zero 2024-11-23 23:20:44 +01:00
i2c-rk3x.c i2c: rk3x: fix potential spinlock recursion on poll 2024-11-18 12:12:17 +01:00
i2c-robotfuzz-osif.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-s3c2410.c i2c: s3c24xx: fix transferring more than one message in polling mode 2024-11-18 12:12:52 +01:00
i2c-scmi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-sh7760.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-sh_mobile.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-sibyte.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-simtec.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-sirf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-sis96x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-sis630.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-sis5595.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-sprd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-st.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-stm32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-stm32.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-stm32f4.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-stm32f7.c i2c: stm32f7: Do not prepare/unprepare clock during runtime suspend/resume 2024-11-23 23:21:42 +01:00
i2c-stu300.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-sun6i-p2wi.c i2c: sun6i-p2wi: Prevent potential division by zero 2024-11-18 11:43:14 +01:00
i2c-synquacer.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-taos-evm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-tegra-bpmp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-tegra.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-thunderx-pcidrv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-tiny-usb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-uniphier-f.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-uniphier.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-versatile.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-via.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-viapro.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-viperboard.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-wmt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-xgene-slimpro.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-xiic.c i2c: xiic: Wait for TX empty to avoid missed TX NAKs 2024-11-23 23:21:42 +01:00
i2c-xlp9xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-xlr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i2c-zx2967.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
scx200_acb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00