linux-stable/drivers/i2c
Martin Povišer bdbbb9ceb9 i2c: pasemi: Wait for write xfers to finish
commit bd8963e602 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:08:33 +02:00
..
algos i2c: algo: pca: Reapply i2c bus settings after reset 2020-09-23 10:46:34 +02:00
busses i2c: pasemi: Wait for write xfers to finish 2022-04-20 09:08:33 +02:00
muxes i2c: mux: demux-pinctrl: do not deactivate a master that is not active 2022-04-20 09:08:19 +02:00
i2c-boardinfo.c
i2c-core-acpi.c i2c: acpi: fix resource leak in reconfiguration device addition 2021-10-17 10:08:33 +02:00
i2c-core-base.c i2c: core: Disable client irq on reboot/shutdown 2021-07-20 16:17:51 +02:00
i2c-core-of.c i2c: core: fix use after free in of_i2c_notify 2019-12-17 20:37:32 +01:00
i2c-core-slave.c i2c: slave: add sanity check when unregistering 2020-08-21 09:47:59 +02:00
i2c-core-smbus.c
i2c-core.h
i2c-dev.c i2c: dev: zero out array used for i2c reads from userspace 2021-08-26 08:37:00 -04:00
i2c-mux.c
i2c-slave-eeprom.c
i2c-smbus.c
i2c-stub.c
Kconfig
Makefile