linux/drivers/i2c/busses
Sven Eckelmann 82b350dd81 i2c: rtl9300: Add missing count byte for SMBus Block Ops
The expected on-wire format of an SMBus Block Write is

  S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P

Everything starting from the Count byte is provided by the I2C subsystem in
the array data->block. But the driver was skipping the Count byte
(data->block[0]) when sending it to the RTL93xx I2C controller.

Only the actual data could be seen on the wire:

  S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P

This wire format is not SMBus Block Write compatible but matches the format
of an I2C Block Write. Simply adding the count byte to the buffer for the
I2C controller is enough to fix the transmission.

This also affects read because the I2C controller must receive the count
byte + $count * data bytes.

Fixes: c366be7202 ("i2c: Add driver for the RTL9300 I2C controller")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: <stable@vger.kernel.org> # v6.13+
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20250810-i2c-rtl9300-multi-byte-v5-4-cd9dca0db722@narfation.org
2025-08-19 20:21:03 -01:00
..
Kconfig i2c: apple: Drop default ARCH_APPLE in Kconfig 2025-08-03 22:29:42 +02:00
Makefile i2c: amd-isp: Add ISP i2c-designware driver 2025-05-19 22:23:56 +02:00
i2c-acorn.c
i2c-ali15x3.c i2c: ali15x3: Fix an error handling path in ali15x3_probe() 2025-03-12 12:24:52 +01:00
i2c-ali1535.c i2c: ali1535: Fix an error handling path in ali1535_probe() 2025-03-12 12:24:52 +01:00
i2c-ali1563.c
i2c-altera.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-amd-asf-plat.c i2c: amd-asf: Set cmd variable when encountering an error 2025-03-18 21:53:53 +01:00
i2c-amd-mp2-pci.c i2c: amd-mp2: drop free_irq() of devm_request_irq() allocated irq 2025-03-20 14:37:47 +01:00
i2c-amd-mp2-plat.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-amd-mp2.h
i2c-amd756.c i2c: amd756: Remove superfluous TODO 2025-01-14 11:09:47 +01:00
i2c-amd8111.c
i2c-aspeed.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-at91-core.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-at91-master.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-at91-slave.c
i2c-at91.h
i2c-au1550.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-axxia.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-bcm-iproc.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-bcm-kona.c i2c: bcm-kona: Use i2c_10bit_addr_*_from_msg() helpers 2025-03-18 21:53:54 +01:00
i2c-bcm2835.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-brcmstb.c i2c: brcmstb: Use i2c_10bit_addr_*_from_msg() helpers 2025-03-18 21:53:54 +01:00
i2c-cadence.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-cbus-gpio.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-ccgx-ucsi.c
i2c-ccgx-ucsi.h
i2c-cgbc.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-cht-wc.c i2c: Switch to irq_domain_create_linear() 2025-05-16 21:06:09 +02:00
i2c-cp2615.c
i2c-cpm.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-cros-ec-tunnel.c i2c: cros-ec-tunnel: defer probe if parent EC is not present 2025-04-13 21:33:44 +02:00
i2c-davinci.c i2c: davinci: add I2C_FUNC_PROTOCOL_MANGLING to feature list 2025-05-19 22:23:57 +02:00
i2c-designware-amdisp.c i2c: amd-isp: Initialize unique adapter name 2025-06-25 23:38:33 +02:00
i2c-designware-amdpsp.c i2c: amd: Switch to guard(mutex) 2025-03-18 21:53:53 +01:00
i2c-designware-baytrail.c
i2c-designware-common.c i2c: designware: Don't warn about missing get_clk_rate_khz 2025-05-23 10:02:27 +02:00
i2c-designware-core.h i2c: designware: determine HS tHIGH and tLOW based on HW parameters 2024-11-24 16:03:51 +01:00
i2c-designware-master.c i2c/designware: Fix an initialization issue 2025-06-30 19:57:08 +02:00
i2c-designware-pcidrv.c i2c: designware: Fix an error handling path in i2c_dw_pci_probe() 2025-05-14 17:28:24 +02:00
i2c-designware-platdrv.c i2c: designware: Add quirk for Intel Xe 2025-07-10 10:19:24 -04:00
i2c-designware-slave.c i2c: designware: Invoke runtime suspend on quick slave re-registration 2025-05-23 10:02:27 +02:00
i2c-digicolor.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-diolan-u2c.c
i2c-dln2.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-eg20t.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-elektor.c
i2c-emev2.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-exynos5.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-fsi.c
i2c-gpio.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-gxp.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-highlander.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-hisi.c
i2c-hix5hd2.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-hydra.c
i2c-i801.c i2c: smbus: introduce Write Disable-aware SPD instantiating functions 2025-05-19 22:23:57 +02:00
i2c-ibm_iic.c i2c: ibm_iic: Use i2c_*bit_addr*_from_msg() helpers 2025-03-18 21:53:54 +01:00
i2c-ibm_iic.h
i2c-icy.c
i2c-img-scb.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-imx-lpi2c.c i2c: lpi2c: implement xfer_atomic callback 2025-07-25 23:15:39 +02:00
i2c-imx.c i2c: imx: use guard to take spinlock 2025-07-24 00:37:59 +02:00
i2c-iop3xx.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-iop3xx.h
i2c-isch.c i2c: isch: Convert comma to semicolon 2025-01-07 23:46:10 +01:00
i2c-ismt.c i2c: ismt: Use non-hybrid PCI devres API 2025-05-19 22:23:57 +02:00
i2c-jz4780.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-k1.c i2c: k1: check for transfer error 2025-06-21 22:17:02 +02:00
i2c-keba.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-kempld.c i2c: kempld: Use i2c_10bit_addr_*_from_msg() helpers 2025-03-18 21:53:54 +01:00
i2c-ljca.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
i2c-lpc2k.c i2c: lpc2k: Add check for clk_enable() 2025-05-19 22:23:54 +02:00
i2c-ls2x.c i2c: ls2x: Fix frequency division register access 2025-02-26 23:23:33 +01:00
i2c-mchp-pci1xxxx.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-meson.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-microchip-corei2c.c i2c: microchip-core: re-fix fake detections w/ i2cdetect 2025-07-01 18:37:38 +02:00
i2c-mlxbf.c i2c: mlxbf: avoid 64-bit division 2025-05-23 10:02:27 +02:00
i2c-mlxcpld.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-mpc.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-mt65xx.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-mt7621.c i2c: mt7621: Use i2c_10bit_addr_*_from_msg() helpers 2025-03-18 21:53:54 +01:00
i2c-mv64xxx.c i2c: mv64xxx: Use i2c_*bit_addr*_from_msg() helpers 2025-03-18 21:53:54 +01:00
i2c-mxs.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-nforce2.c i2c: Drop legacy muxing pseudo-drivers 2024-11-17 11:58:14 +01:00
i2c-nomadik.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-npcm7xx.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-nvidia-gpu.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
i2c-ocores.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-octeon-core.c i2c: octeon: add block-mode i2c operations 2025-05-19 22:23:55 +02:00
i2c-octeon-core.h i2c: octeon: add block-mode i2c operations 2025-05-19 22:23:55 +02:00
i2c-octeon-platdrv.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-omap.c i2c: omap: Fix an error handling path in omap_i2c_probe() 2025-07-10 11:58:33 +02:00
i2c-opal.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-owl.c
i2c-parport.c
i2c-pasemi-core.c i2c: pasemi: Log bus reset causes 2025-05-19 22:23:57 +02:00
i2c-pasemi-core.h
i2c-pasemi-pci.c i2c: pasemi: Sort includes alphabetically 2025-05-19 22:23:55 +02:00
i2c-pasemi-platform.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-pca-isa.c
i2c-pca-platform.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-piix4.c Move FCH header to a location accessible by all archs 2025-06-30 13:42:11 +03:00
i2c-piix4.h i2c: piix4: Export i2c_piix4 driver functions as library 2024-11-13 23:29:46 +01:00
i2c-pnx.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-powermac.c i2c: powermac: convert of_node usage to fwnode 2025-05-20 22:49:21 +02:00
i2c-pxa-pci.c
i2c-pxa.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-qcom-cci.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-qcom-geni.c i2c: qcom-geni: fix I2C frequency table to achieve accurate bus rates 2025-07-30 00:39:54 +02:00
i2c-qup.c i2c: qup: jump out of the loop in case of timeout 2025-07-24 00:38:01 +02:00
i2c-rcar.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-riic.c i2c: riic: Add support for RZ/T2H SoC 2025-07-24 00:37:59 +02:00
i2c-rk3x.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-robotfuzz-osif.c i2c: robotfuzz-osif: disable zero-length read messages 2025-06-25 22:45:48 +02:00
i2c-rtl9300.c i2c: rtl9300: Add missing count byte for SMBus Block Ops 2025-08-19 20:21:03 -01:00
i2c-rzv2m.c i2c: rzv2m: Constify struct i2c_algorithm 2025-05-19 22:23:54 +02:00
i2c-s3c2410.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-scmi.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-sh7760.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-sh_mobile.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-sibyte.c
i2c-simtec.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-sis96x.c
i2c-sis630.c i2c: sis630: Fix an error handling path in sis630_probe() 2025-03-12 12:24:53 +01:00
i2c-sis5595.c
i2c-sprd.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-st.c i2c: st: Use min() to improve code 2025-07-25 23:15:23 +02:00
i2c-stm32.c i2c: stm32: fix the device used for the DMA map 2025-07-10 11:58:33 +02:00
i2c-stm32.h
i2c-stm32f4.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-stm32f7.c i2c: stm32f7: support i2c_*_dma_safe_msg_buf APIs 2025-07-30 00:30:43 +02:00
i2c-sun6i-p2wi.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-synquacer.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-taos-evm.c
i2c-tegra-bpmp.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-tegra.c i2c: tegra: Remove dma_sync_*() calls 2025-07-30 00:30:54 +02:00
i2c-thunderx-pcidrv.c i2c: thunderx: Use non-hybrid PCI devres API 2025-05-19 22:23:57 +02:00
i2c-tiny-usb.c i2c: tiny-usb: disable zero-length read messages 2025-06-25 22:49:57 +02:00
i2c-uniphier-f.c i2c: uniphier(-f): Replace dev_err() with dev_err_probe() in probe function 2025-05-19 22:23:55 +02:00
i2c-uniphier.c i2c: uniphier: Replace dev_err() with dev_err_probe() in probe function 2025-05-19 22:23:55 +02:00
i2c-versatile.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-via.c i2c: via: Replace dev_err() with dev_err_probe() in probe function 2025-05-19 22:23:55 +02:00
i2c-viai2c-common.c
i2c-viai2c-common.h
i2c-viai2c-wmt.c i2c: viai2c-wmt: Replace dev_err() with dev_err_probe() in probe function 2025-05-23 10:02:27 +02:00
i2c-viai2c-zhaoxin.c
i2c-viapro.c i2c: viapro: Replace dev_err() with dev_err_probe() in probe function 2025-05-19 22:23:55 +02:00
i2c-viperboard.c i2c: Use str_read_write() helper 2025-05-23 17:28:07 +02:00
i2c-virtio.c i2c: virtio: Avoid hang by using interruptible completion wait 2025-07-24 00:38:01 +02:00
i2c-xgene-slimpro.c i2c: xgene-slimpro: Replace dev_err() with dev_err_probe() in probe function 2025-05-23 10:02:27 +02:00
i2c-xiic.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-xlp9xx.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
scx200_acb.c i2c: scx200_acb: Replace dev_err() with dev_err_probe() in probe function 2025-05-19 22:23:55 +02:00