android_kernel_xiaomi_sm8350/drivers/i2c/busses
Robert Hancock c64fda48a3 i2c: xiic: Don't try to handle more interrupt events after error
[ Upstream commit cb6e45c9a0ad9e0f8664fd06db0227d185dc76ab ]

In xiic_process, it is possible that error events such as arbitration
lost or TX error can be raised in conjunction with other interrupt flags
such as TX FIFO empty or bus not busy. Error events result in the
controller being reset and the error returned to the calling request,
but the function could potentially try to keep handling the other
events, such as by writing more messages into the TX FIFO. Since the
transaction has already failed, this is not helpful and will just cause
issues.

This problem has been present ever since:

commit 7f9906bd7f ("i2c: xiic: Service all interrupts in isr")

which allowed non-error events to be handled after errors, but became
more obvious after:

commit 743e227a8959 ("i2c: xiic: Defer xiic_wakeup() and
__xiic_start_xfer() in xiic_process()")

which reworked the code to add a WARN_ON which triggers if both the
xfer_more and wakeup_req flags were set, since this combination is
not supposed to happen, but was occurring in this scenario.

Skip further interrupt handling after error flags are detected to avoid
this problem.

Fixes: 7f9906bd7f ("i2c: xiic: Service all interrupts in isr")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Acked-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:37:24 +02:00
..
i2c-acorn.c
i2c-ali15x3.c
i2c-ali1535.c
i2c-ali1563.c
i2c-altera.c
i2c-amd756-s4882.c
i2c-amd756.c
i2c-amd8111.c
i2c-amd-mp2-pci.c
i2c-amd-mp2-plat.c
i2c-amd-mp2.h
i2c-aspeed.c
i2c-at91-core.c
i2c-at91-master.c
i2c-at91-slave.c
i2c-at91.h
i2c-au1550.c
i2c-axxia.c
i2c-bcm2835.c
i2c-bcm-iproc.c
i2c-bcm-kona.c
i2c-brcmstb.c
i2c-cadence.c
i2c-cbus-gpio.c
i2c-cht-wc.c
i2c-cpm.c
i2c-cros-ec-tunnel.c
i2c-davinci.c
i2c-designware-baytrail.c
i2c-designware-common.c
i2c-designware-core.h
i2c-designware-master.c
i2c-designware-pcidrv.c
i2c-designware-platdrv.c
i2c-designware-slave.c
i2c-digicolor.c
i2c-diolan-u2c.c
i2c-dln2.c
i2c-efm32.c
i2c-eg20t.c
i2c-elektor.c
i2c-emev2.c
i2c-exynos5.c
i2c-fsi.c
i2c-gpio.c
i2c-highlander.c
i2c-hix5hd2.c
i2c-hydra.c
i2c-i801.c
i2c-ibm_iic.c
i2c-ibm_iic.h
i2c-icy.c
i2c-img-scb.c
i2c-imx-lpi2c.c i2c: imx-lpi2c: fix type char overflow issue when calculating the clock cycle 2023-06-28 10:18:42 +02:00
i2c-imx.c
i2c-iop3xx.c
i2c-iop3xx.h
i2c-isch.c
i2c-ismt.c
i2c-jz4780.c
i2c-kempld.c
i2c-lpc2k.c
i2c-meson.c
i2c-mlxcpld.c
i2c-mpc.c
i2c-mt65xx.c
i2c-mt7621.c
i2c-mv64xxx.c
i2c-mxs.c
i2c-nforce2-s4985.c
i2c-nforce2.c
i2c-nomadik.c
i2c-nvidia-gpu.c
i2c-ocores.c i2c: ocores: generate stop condition after timeout in polling mode 2023-04-20 12:07:37 +02:00
i2c-octeon-core.c
i2c-octeon-core.h
i2c-octeon-platdrv.c
i2c-omap.c i2c: omap: Fix standard mode false ACK readings 2023-05-17 11:35:33 +02:00
i2c-opal.c
i2c-owl.c
i2c-parport-light.c
i2c-parport.c
i2c-parport.h
i2c-pasemi.c
i2c-pca-isa.c
i2c-pca-platform.c
i2c-piix4.c
i2c-pmcmsp.c
i2c-pnx.c
i2c-powermac.c
i2c-puv3.c
i2c-pxa-pci.c
i2c-pxa.c
i2c-qcom-geni.c
i2c-qup.c
i2c-rcar.c
i2c-riic.c
i2c-rk3x.c treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
i2c-robotfuzz-osif.c
i2c-s3c2410.c
i2c-scmi.c
i2c-sh7760.c
i2c-sh_mobile.c
i2c-sibyte.c
i2c-simtec.c
i2c-sirf.c
i2c-sis96x.c
i2c-sis630.c
i2c-sis5595.c
i2c-sprd.c i2c: sprd: Delete i2c adapter in .remove's error path 2023-06-14 10:59:58 +02:00
i2c-st.c
i2c-stm32.c
i2c-stm32.h
i2c-stm32f4.c
i2c-stm32f7.c
i2c-stu300.c
i2c-sun6i-p2wi.c
i2c-synquacer.c
i2c-taos-evm.c
i2c-tegra-bpmp.c
i2c-tegra.c
i2c-thunderx-pcidrv.c
i2c-tiny-usb.c
i2c-uniphier-f.c
i2c-uniphier.c
i2c-versatile.c
i2c-via.c
i2c-viapro.c
i2c-viperboard.c
i2c-wmt.c
i2c-xgene-slimpro.c i2c: xgene-slimpro: Fix out-of-bounds bug in xgene_slimpro_i2c_xfer() 2023-04-05 11:16:41 +02:00
i2c-xiic.c i2c: xiic: Don't try to handle more interrupt events after error 2023-07-27 08:37:24 +02:00
i2c-xlp9xx.c
i2c-xlr.c
i2c-zx2967.c
Kconfig
Makefile
scx200_acb.c