linux-stable/drivers/i2c/busses
Robert Hancock ce5311e79e i2c: xiic: Don't try to handle more interrupt events after error
[ Upstream commit cb6e45c9a0 ]

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 743e227a89 ("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-08-11 11:45:14 +02:00
..
i2c-acorn.c i2c: acorn: fix i2c warning 2019-06-19 08:18:00 +02:00
i2c-ali15x3.c
i2c-ali1535.c
i2c-ali1563.c
i2c-altera.c i2c: altera: Fix race between xfer_msg and isr thread 2020-06-07 13:17:56 +02:00
i2c-amd756-s4882.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
i2c-amd756.c
i2c-amd8111.c i2c: amd8111: Mark expected switch fall-through 2018-08-08 22:28:46 +02:00
i2c-aspeed.c i2c: aspeed: fix invalid clock parameters for very large divisors 2019-11-20 18:47:22 +01:00
i2c-at91.c i2c: at91: Initialize dma_buf in at91_twi_xfer() 2022-06-14 16:59:26 +02:00
i2c-au1550.c
i2c-axxia.c i2c-axxia: check for error conditions first 2019-02-12 19:47:09 +01:00
i2c-bcm-iproc.c
i2c-bcm-kona.c
i2c-bcm2835.c i2c: bcm2835: Avoid clock stretching timeouts 2022-03-08 19:04:06 +01:00
i2c-brcmstb.c i2c: brcmstb: fix support for DSL and CM variants 2022-02-23 11:58:41 +01:00
i2c-cadence.c i2c: cadence: Support PEC for SMBus block read 2022-08-25 11:15:11 +02:00
i2c-cbus-gpio.c
i2c-cht-wc.c i2c-cht-wc: Fix lockdep warning 2019-10-07 18:57:08 +02:00
i2c-cpm.c i2c: cpm: Fix i2c_ram structure 2020-10-07 08:00:08 +02:00
i2c-cros-ec-tunnel.c
i2c-davinci.c Merge branch 'i2c/for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2018-08-21 17:40:46 -07:00
i2c-designware-baytrail.c i2c: designware: Add SPDX license tag 2018-08-20 10:45:45 +02:00
i2c-designware-common.c i2c: designware: Add SPDX license tag 2018-08-20 10:45:45 +02:00
i2c-designware-core.h i2c: designware: Add SPDX license tag 2018-08-20 10:45:45 +02:00
i2c-designware-master.c i2c: designware: Call i2c_dw_clk_rate() only when calculating timings 2018-10-05 13:40:05 +02:00
i2c-designware-pcidrv.c i2c: designware-pci: Fix to change data types of hcnt and lcnt parameters 2022-01-27 09:04:29 +01:00
i2c-designware-platdrv.c i2c: designware: Re-init controllers with pm_disabled set on resume 2018-08-30 23:02:13 +02:00
i2c-designware-slave.c i2c: designware: Synchronize IRQs when unregistering slave client 2019-09-21 07:17:06 +02:00
i2c-digicolor.c
i2c-diolan-u2c.c i2c: busses: make use of i2c_8bit_addr_from_msg 2018-05-29 20:30:49 +02:00
i2c-dln2.c
i2c-efm32.c i2c: busses: make use of i2c_8bit_addr_from_msg 2018-05-29 20:30:49 +02:00
i2c-eg20t.c i2c: eg20t: Load module automatically if ID matches 2020-07-22 09:32:01 +02:00
i2c-elektor.c
i2c-emev2.c i2c: emev2: add IRQ check 2021-05-22 10:59:36 +02:00
i2c-exynos5.c i2c: exynos5: Describe the hardware variant for readability 2018-07-21 00:15:22 +02:00
i2c-fsi.c i2c: fsi: Fix the port number field in status register 2020-06-30 23:17:13 -04:00
i2c-gpio.c i2c: gpio: suppress error on probe defer 2020-03-18 07:14:23 +01:00
i2c-highlander.c i2c: highlander: add IRQ check 2021-09-22 11:47:52 +02:00
i2c-hix5hd2.c i2c: hix5hd2: add missed clk_disable_unprepare in remove 2020-04-02 15:28:16 +02:00
i2c-hydra.c
i2c-i801.c i2c: i801: Don't silently correct invalid transfer size 2022-01-27 09:04:29 +01:00
i2c-ibm_iic.c i2c: ibm_iic: don't check number of messages in the driver 2018-05-24 22:05:54 +02:00
i2c-ibm_iic.h
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:15:32 +02:00
i2c-imx.c i2c: imx: Check for I2SR_IAL after every byte 2020-12-11 13:25:02 +01:00
i2c-iop3xx.c i2c: iop3xx: fix deferred probing 2021-09-22 11:47:54 +02:00
i2c-iop3xx.h
i2c-isch.c i2c: i2c-isch: fix spelling mistake "unitialized" -> "uninitialized" 2018-09-25 00:14:04 +02:00
i2c-ismt.c i2c: ismt: Fix an out-of-bounds bug in ismt_access() 2023-01-18 11:30:28 +01:00
i2c-jz4780.c i2c: jz4780: add IRQ check 2021-05-22 10:59:36 +02:00
i2c-kempld.c i2c: busses: make use of i2c_8bit_addr_from_msg 2018-05-29 20:30:49 +02:00
i2c-lpc2k.c
i2c-meson.c i2c: meson: fixup rate calculation with filter delay 2020-10-14 10:31:23 +02:00
i2c-mlxcpld.c i2c: mlxcpld: check correct size of maximum RECV_LEN packet 2020-07-09 09:37:11 +02:00
i2c-mpc.c i2c: mpc: Correct I2C reset procedure 2022-01-27 09:04:29 +01:00
i2c-mt65xx.c i2c: mt65xx: fix IRQ check 2021-09-22 11:47:54 +02:00
i2c-mv64xxx.c i2c: mv64xxx: Apply errata delay only in standard mode 2018-03-17 21:20:04 +01:00
i2c-mxs.c i2c: mxs: use core to detect 'no zero length' quirk 2018-08-04 23:25:06 +02:00
i2c-nforce2-s4985.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
i2c-nforce2.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
i2c-nomadik.c i2c: busses: remove superfluous ignoring of children for RPM 2018-05-08 23:19:02 +02:00
i2c-ocores.c i2c: ocores: update my email address 2018-08-24 14:46:43 +02:00
i2c-octeon-core.c i2c: octeon: check correct size of maximum RECV_LEN packet 2021-01-27 11:05:38 +01:00
i2c-octeon-core.h i2c: octeon: Prevent error message on bus error 2018-03-02 11:11:15 +01:00
i2c-octeon-platdrv.c
i2c-omap.c i2c: omap: Fix standard mode false ACK readings 2023-05-17 11:13:07 +02:00
i2c-opal.c i2c: opal: don't check number of messages in the driver 2018-05-24 22:06:17 +02:00
i2c-owl.c i2c: owl: Clear NACK and BUS error bits 2020-10-14 10:31:23 +02:00
i2c-parport-light.c
i2c-parport.c
i2c-parport.h
i2c-pasemi.c i2c: pasemi: Wait for write xfers to finish 2022-04-20 09:12:50 +02:00
i2c-pca-isa.c
i2c-pca-platform.c i2c: pca-platform: Fix GPIO lookup code 2019-07-10 09:53:39 +02:00
i2c-piix4.c i2c: piix4: Detect secondary SMBus controller on AMD AM4 chipsets 2020-06-25 15:32:47 +02:00
i2c-pmcmsp.c i2c: pmcmsp: use core to detect 'no zero length' quirk 2018-08-04 23:25:06 +02:00
i2c-pnx.c i2c: pnx: move header into the driver 2018-05-17 16:27:59 +02:00
i2c-powermac.c
i2c-puv3.c
i2c-pxa-pci.c i2c: pxa-pci: fix missing pci_disable_device() on error in ce4100_i2c_probe 2023-01-18 11:30:28 +01:00
i2c-pxa.c i2c: pxa: fix i2c_pxa_scream_blue_murder() debug output 2020-06-25 15:32:55 +02:00
i2c-qcom-geni.c i2c: qcom-geni: Fix runtime PM mismatch with child devices 2018-11-27 16:13:06 +01:00
i2c-qup.c i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc() 2020-12-11 13:25:04 +01:00
i2c-rcar.c i2c: rcar: optimize cacheline to minimize HW race condition 2021-03-17 16:43:45 +01:00
i2c-riic.c i2c: riic: Clear NACK in tend isr 2019-10-05 13:10:12 +02:00
i2c-rk3x.c treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
i2c-robotfuzz-osif.c i2c: robotfuzz-osif: fix control-request directions 2021-06-30 08:48:34 -04:00
i2c-s3c2410.c i2c: s3c2410: fix IRQ check 2021-09-22 11:47:54 +02:00
i2c-scmi.c i2c: scmi: Fix probe error on devices with an empty SMB0001 ACPI device node 2018-12-21 14:15:24 +01:00
i2c-sh7760.c i2c: sh7760: fix IRQ error path 2021-05-22 10:59:37 +02:00
i2c-sh_mobile.c i2c: sh_mobile: Add support for r8a774c0 (RZ/G2E) 2019-02-12 19:47:11 +01:00
i2c-sibyte.c
i2c-simtec.c
i2c-sirf.c i2c: busses: i2c-sirf: Fix spelling: "formular" -> "formula". 2018-02-22 12:12:35 +01:00
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:57:14 +02:00
i2c-st.c i2c: st: fix missing struct parameter description 2020-04-17 10:48:38 +02:00
i2c-stm32.c i2c: stm32f7: report dma error during probe 2020-01-27 14:51:21 +01:00
i2c-stm32.h i2c: i2c-stm32: Add generic DMA API 2018-04-30 10:39:27 +02:00
i2c-stm32f4.c i2c-stm32f4: remove redundant initialization of pointer reg 2018-02-27 13:51:05 +01:00
i2c-stm32f7.c i2c: stm32f7: stop dma transfer in case of NACK 2021-12-08 08:50:13 +01:00
i2c-stu300.c i2c: stu300: use core to detect 'no zero length' quirk 2018-08-04 23:25:07 +02:00
i2c-sun6i-p2wi.c
i2c-synquacer.c i2c: synquacer: fix synquacer_i2c_doxfer() return value 2019-06-09 09:17:19 +02:00
i2c-taos-evm.c
i2c-tegra-bpmp.c i2c: bpmp-tegra: Ignore unknown I2C_M flags 2021-01-27 11:05:34 +01:00
i2c-tegra.c i2c: tegra: Fix Maximum transfer size 2020-06-30 23:17:02 -04:00
i2c-thunderx-pcidrv.c drivers: i2c: thunderx: Allow driver to work with ACPI defined TWSI controllers 2022-06-06 08:24:20 +02:00
i2c-tiny-usb.c
i2c-uniphier-f.c i2c: uniphier-f: fix timeout error after reading 8 bytes 2019-12-01 09:17:34 +01:00
i2c-uniphier.c i2c: uniphier: fix violation of tLOW requirement for Fast-mode 2018-12-21 14:15:24 +01:00
i2c-versatile.c
i2c-via.c
i2c-viapro.c
i2c-viperboard.c i2c: viperboard: return message count on master_xfer success 2018-05-15 09:31:26 +02:00
i2c-wmt.c
i2c-xgene-slimpro.c i2c: xgene-slimpro: Fix out-of-bounds bug in xgene_slimpro_i2c_xfer() 2023-04-05 11:15:38 +02:00
i2c-xiic.c i2c: xiic: Don't try to handle more interrupt events after error 2023-08-11 11:45:14 +02:00
i2c-xlp9xx.c i2c: xlp9xx: Fix case where SSIF read transaction completes early 2018-08-09 17:41:13 +02:00
i2c-xlr.c i2c: xlr: Fix a resource leak in the error handling path of 'xlr_i2c_probe()' 2021-11-26 11:36:15 +01:00
i2c-zx2967.c i2c: zx2967: use core to detect 'no zero length' quirk 2019-11-24 08:20:27 +01:00
Kconfig i2c: qup: allow COMPILE_TEST 2022-03-08 19:04:06 +01:00
Makefile i2c: Add Actions Semiconductor Owl family S900 I2C driver 2018-08-04 22:56:02 +02:00
scx200_acb.c