OrangePi_CM5/drivers/i2c/busses
Martin Povišer 84837f43e5 i2c: pasemi: Wait for write xfers to finish
commit bd8963e602c77adc76dbbbfc3417c3cf14fed76b upstream.

Wait for completion of write transfers before returning from the driver.
At first sight it may seem advantageous to leave write transfers queued
for the controller to carry out on its own time, but there's a couple of
issues with it:

 * Driver doesn't check for FIFO space.

 * The queued writes can complete while the driver is in its I2C read
   transfer path which means it will get confused by the raising of
   XEN (the 'transaction ended' signal). This can cause a spurious
   ENODATA error due to premature reading of the MRXFIFO register.

Adding the wait fixes some unreliability issues with the driver. There's
some efficiency cost to it (especially with pasemi_smb_waitready doing
its polling), but that will be alleviated once the driver receives
interrupt support.

Fixes: beb58aa39e ("i2c: PA Semi SMBus driver")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Reviewed-by: Sven Peter <sven@svenpeter.dev>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-20 09:23:30 +02:00
..
Kconfig i2c: qup: allow COMPILE_TEST 2022-03-08 19:09:30 +01:00
Makefile i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC 2020-09-27 19:58:38 +02:00
i2c-acorn.c
…
i2c-ali15x3.c i2c: Use separate MODULE_AUTHOR() statements for multiple authors 2020-07-04 08:25:13 +02:00
i2c-ali1535.c i2c: Use separate MODULE_AUTHOR() statements for multiple authors 2020-07-04 08:25:13 +02:00
i2c-ali1563.c
…
i2c-altera.c
…
i2c-amd-mp2-pci.c
…
i2c-amd-mp2-plat.c i2c: amd_mp2: handle num is 0 input for i2c_amd_xfer 2020-09-21 11:45:43 +02:00
i2c-amd-mp2.h
…
i2c-amd756-s4882.c
…
i2c-amd756.c
…
i2c-amd8111.c i2c: busses: Use fallthrough pseudo-keyword 2020-07-23 22:04:08 +02:00
i2c-aspeed.c i2c: aspeed: Mask IRQ status to relevant bits 2020-09-14 08:55:44 +02:00
i2c-at91-core.c
…
i2c-at91-master.c i2c: at91: Move to generic GPIO bus recovery 2020-08-05 11:52:27 +02:00
i2c-at91-slave.c
…
i2c-at91.h i2c: at91: Move to generic GPIO bus recovery 2020-08-05 11:52:27 +02:00
i2c-au1550.c
…
i2c-axxia.c
…
i2c-bcm-iproc.c i2c: iproc: handle master read request 2021-03-04 11:37:53 +01:00
i2c-bcm-kona.c
…
i2c-bcm2835.c i2c: bcm2835: Avoid clock stretching timeouts 2022-03-08 19:09:29 +01:00
i2c-brcmstb.c i2c: brcmstb: fix support for DSL and CM variants 2022-02-23 12:01:08 +01:00
i2c-cadence.c i2c: cadence: add IRQ check 2021-05-14 09:50:37 +02:00
i2c-cbus-gpio.c i2c: cbus-gpio: set atomic transfer callback 2021-12-08 09:03:23 +01:00
i2c-cht-wc.c
…
i2c-cpm.c i2c: cpm: Fix i2c_ram structure 2020-09-27 15:14:16 +02:00
i2c-cros-ec-tunnel.c
…
i2c-davinci.c
…
i2c-designware-baytrail.c
…
i2c-designware-common.c i2c: designware: Adjust bus speed independently of ACPI 2020-06-23 21:24:33 +02:00
i2c-designware-core.h i2c: designware: Adjust bus speed independently of ACPI 2020-06-23 21:24:33 +02:00
i2c-designware-master.c i2c: designware: Adjust bus_freq_hz when refuse high speed mode set 2021-04-14 08:42:11 +02:00
i2c-designware-pcidrv.c i2c: designware-pci: Fix to change data types of hcnt and lcnt parameters 2022-01-27 10:54:23 +01:00
i2c-designware-platdrv.c i2c: designware: Add device HID for Hygon I2C controller 2020-08-07 20:07:44 +02:00
i2c-designware-slave.c i2c: designware: slave should do WRITE_REQUESTED before WRITE_RECEIVED 2020-11-06 16:02:00 +01:00
i2c-digicolor.c i2c: busses: Use fallthrough pseudo-keyword 2020-07-23 22:04:08 +02:00
i2c-diolan-u2c.c
…
i2c-dln2.c
…
i2c-efm32.c i2c: efm32: Use devm_platform_get_and_ioremap_resource() 2020-09-29 21:37:46 +02:00
i2c-eg20t.c i2c: eg20t: use generic power management 2020-08-10 15:47:38 +02:00
i2c-elektor.c
…
i2c-emev2.c i2c: emev2: add IRQ check 2021-05-14 09:50:37 +02:00
i2c-exynos5.c i2c: exynos5: Preserve high speed master code 2021-03-04 11:38:20 +01:00
i2c-fsi.c i2c: fsi: Prevent adding adapters for ports without dts nodes 2020-07-24 21:31:33 +02:00
i2c-gpio.c
…
i2c-highlander.c i2c: highlander: add IRQ check 2021-09-15 09:50:36 +02:00
i2c-hix5hd2.c i2c: hix5hd2: fix IRQ check 2021-09-15 09:50:42 +02:00
i2c-hydra.c
…
i2c-i801.c i2c: i801: Don't silently correct invalid transfer size 2022-01-27 10:54:21 +01:00
i2c-ibm_iic.c
…
i2c-ibm_iic.h
…
i2c-icy.c
…
i2c-img-scb.c i2c: img-scb: fix reference leak when pm_runtime_get_sync fails 2021-05-14 09:50:36 +02:00
i2c-imx-lpi2c.c i2c: imx-lpi2c: fix reference leak when pm_runtime_get_sync fails 2021-05-14 09:50:36 +02:00
i2c-imx.c i2c: imx: fix reference leak when pm_runtime_get_sync fails 2021-05-14 09:50:36 +02:00
i2c-iop3xx.c i2c: iop3xx: fix deferred probing 2021-09-15 09:50:42 +02:00
i2c-iop3xx.h
…
i2c-isch.c
…
i2c-ismt.c i2c: ismt: Add support for Intel Emmitsburg PCH 2020-09-21 11:58:49 +02:00
i2c-jz4780.c i2c: jz4780: add IRQ check 2021-05-14 09:50:37 +02:00
i2c-kempld.c
…
i2c-lpc2k.c
…
i2c-meson.c i2c: meson: Fix wrong speed use from probe 2022-04-08 14:40:22 +02:00
i2c-mlxbf.c i2c: mlxbf: add IRQ check 2021-05-14 09:50:37 +02:00
i2c-mlxcpld.c i2c: mlxcpld: check correct size of maximum RECV_LEN packet 2020-07-04 08:20:38 +02:00
i2c-mpc.c i2c: mpc: Correct I2C reset procedure 2022-01-27 10:54:21 +01:00
i2c-mt65xx.c i2c: mediatek: fixing the incorrect register offset 2021-11-18 14:04:22 +01:00
i2c-mt7621.c
…
i2c-mv64xxx.c i2c: busses: replace spin_lock_irqsave by spin_lock in hard IRQ 2020-09-29 21:40:03 +02:00
i2c-mxs.c i2c: mxs: use MXS_DMA_CTRL_WAIT4END instead of DMA_CTRL_ACK 2020-09-18 23:11:44 +02:00
i2c-nforce2-s4985.c
…
i2c-nforce2.c
…
i2c-nomadik.c amba: Make the remove callback return void 2022-04-08 14:40:02 +02:00
i2c-npcm7xx.c i2c: npcm7xx: Clear LAST bit after a failed transaction. 2020-09-27 20:05:27 +02:00
i2c-nvidia-gpu.c i2c: nvidia-gpu: Use put_unaligned_be24() 2020-09-21 12:05:40 +02:00
i2c-ocores.c
…
i2c-octeon-core.c i2c: octeon: check correct size of maximum RECV_LEN packet 2021-01-27 11:55:09 +01:00
i2c-octeon-core.h
…
i2c-octeon-platdrv.c
…
i2c-omap.c i2c: omap: fix reference leak when pm_runtime_get_sync fails 2021-05-14 09:50:37 +02:00
i2c-opal.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
i2c-owl.c Merge branch 'i2c/for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2020-10-21 10:54:05 -07:00
i2c-parport.c
…
i2c-pasemi.c i2c: pasemi: Wait for write xfers to finish 2022-04-20 09:23:30 +02:00
i2c-pca-isa.c
…
i2c-pca-platform.c
…
i2c-piix4.c i2c: Use separate MODULE_AUTHOR() statements for multiple authors 2020-07-04 08:25:13 +02:00
i2c-pmcmsp.c
…
i2c-pnx.c i2c: Use separate MODULE_AUTHOR() statements for multiple authors 2020-07-04 08:25:13 +02:00
i2c-powermac.c
…
i2c-pxa-pci.c
…
i2c-pxa.c
…
i2c-qcom-cci.c i2c: qcom-cci: don't put a device tree node before i2c_add_adapter() 2022-02-23 12:01:07 +01:00
i2c-qcom-geni.c i2c: qcom-geni: Suspend and resume the bus during SYSTEM_SLEEP_PM ops 2021-06-10 13:39:29 +02:00
i2c-qup.c i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc() 2020-12-02 16:42:09 +01:00
i2c-rcar.c i2c: rcar: add IRQ check 2021-05-14 09:50:38 +02:00
i2c-riic.c
…
i2c-rk3x.c i2c: rk3x: Handle a spurious start completion interrupt flag 2021-12-17 10:14:40 +01:00
i2c-robotfuzz-osif.c i2c: robotfuzz-osif: fix control-request directions 2021-06-30 08:47:25 -04:00
i2c-s3c2410.c i2c: s3c2410: fix IRQ check 2021-09-15 09:50:42 +02:00
i2c-scmi.c
…
i2c-sh7760.c i2c: sh7760: fix IRQ error path 2021-05-14 09:50:39 +02:00
i2c-sh_mobile.c i2c: sh_mobile: Use new clock calculation formulas for RZ/G2E 2021-06-03 09:00:39 +02:00
i2c-sibyte.c i2c: Use separate MODULE_AUTHOR() statements for multiple authors 2020-07-04 08:25:13 +02:00
i2c-simtec.c
…
i2c-sirf.c i2c: Use separate MODULE_AUTHOR() statements for multiple authors 2020-07-04 08:25:13 +02:00
i2c-sis96x.c
…
i2c-sis630.c
…
i2c-sis5595.c
…
i2c-sprd.c i2c: sprd: fix reference leak when pm_runtime_get_sync fails 2021-05-14 09:50:37 +02:00
i2c-st.c
…
i2c-stm32.c i2c: stm32: Simplify with dev_err_probe() 2020-09-21 11:45:43 +02:00
i2c-stm32.h
…
i2c-stm32f4.c i2c: stm32: Simplify with dev_err_probe() 2020-09-21 11:45:43 +02:00
i2c-stm32f7.c i2c: stm32f7: stop dma transfer in case of NACK 2021-12-08 09:03:23 +01:00
i2c-stu300.c
…
i2c-sun6i-p2wi.c
…
i2c-synquacer.c i2c: synquacer: fix deferred probing 2021-09-15 09:50:41 +02:00
i2c-taos-evm.c
…
i2c-tegra-bpmp.c i2c: bpmp-tegra: Ignore unknown I2C_M flags 2021-01-27 11:54:50 +01:00
i2c-tegra.c i2c: tegra: Create i2c_writesl_vi() to use with VI I2C for filling TX FIFO 2021-02-07 15:37:15 +01:00
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: busses: Use fallthrough pseudo-keyword 2020-07-23 22:04:08 +02:00
i2c-viperboard.c
…
i2c-wmt.c
…
i2c-xgene-slimpro.c
…
i2c-xiic.c i2c: xiic: Make bus names unique 2022-04-08 14:40:19 +02:00
i2c-xlp9xx.c i2c: xlp9xx: fix main IRQ check 2021-09-15 09:50:44 +02:00
i2c-xlr.c i2c: xlr: Fix a resource leak in the error handling path of 'xlr_i2c_probe()' 2021-11-18 14:04:25 +01:00
i2c-zx2967.c
…
scx200_acb.c i2c: busses: Use fallthrough pseudo-keyword 2020-07-23 22:04:08 +02:00