linux/drivers/i2c
Jonas Jelonek ede965fd55 i2c: rtl9300: remove broken SMBus Quick operation support
Remove the SMBus Quick operation from this driver because it is not
natively supported by the hardware and is wrongly implemented in the
driver.

The I2C controllers in Realtek RTL9300 and RTL9310 are SMBus-compliant
but there doesn't seem to be native support for the SMBus Quick
operation. It is not explicitly mentioned in the documentation but
looking at the registers which configure an SMBus transaction, one can
see that the data length cannot be set to 0. This suggests that the
hardware doesn't allow any SMBus message without data bytes (except for
those it does on it's own, see SMBus Block Read).

The current implementation of SMBus Quick operation passes a length of
0 (which is actually invalid). Before the fix of a bug in a previous
commit, this led to a read operation of 16 bytes from any register (the
one of a former transaction or any other value.

This caused issues like soft-bricked SFP modules after a simple probe
with i2cdetect which uses Quick by default. Running this with SFP
modules whose EEPROM isn't write-protected, some of the initial bytes
are overwritten because a 16-byte write operation is executed instead of
a Quick Write. (This temporarily soft-bricked one of my DAC cables.)

Because SMBus Quick operation is obviously not supported on these
controllers (because a length of 0 cannot be set, even when no register
address is set), remove that instead of claiming there is support. There
also shouldn't be any kind of emulated 'Quick' which just does another
kind of operation in the background. Otherwise, specific issues occur
in case of a 'Quick' Write which actually writes unknown data to an
unknown register.

Fixes: c366be7202 ("i2c: Add driver for the RTL9300 I2C controller")
Cc: stable@vger.kernel.org # v6.13+
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Tested-by: Sven Eckelmann <sven@narfation.org>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # On RTL9302C based board
Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20250831100457.3114-4-jelonek.jonas@gmail.com
2025-09-04 00:31:34 +02:00
..
algos i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
busses i2c: rtl9300: remove broken SMBus Quick operation support 2025-09-04 00:31:34 +02:00
muxes treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
i2c-atr.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-boardinfo.c
i2c-core-acpi.c i2c: Force DLL0945 touchpad i2c freq to 100khz 2025-08-03 22:36:42 +02:00
i2c-core-base.c i2c-for-6.17-rc1 2025-07-29 11:35:24 -07:00
i2c-core-of-prober.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
i2c-core-of.c i2c: core: Do not dereference fwnode in struct device 2025-04-16 18:08:32 +02:00
i2c-core-slave.c i2c: core: Unify the firmware node type check 2025-04-16 18:05:47 +02:00
i2c-core-smbus.c i2c: Use str_read_write() helper 2025-05-23 17:28:07 +02:00
i2c-core.h i2c: Unexport i2c_of_match_device() 2025-02-13 16:47:52 +01:00
i2c-dev.c
i2c-mux.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-slave-eeprom.c sysfs: treewide: switch back to bin_attribute::read()/write() 2025-06-17 10:44:13 +02:00
i2c-slave-testunit.c i2c: testunit: on errors, repeat NACK until STOP 2025-01-15 19:44:21 +01:00
i2c-smbus.c i2c: smbus: introduce Write Disable-aware SPD instantiating functions 2025-05-19 22:23:57 +02:00
i2c-stub.c
Kconfig
Makefile