2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/i2c/busses
Conor Dooley 49e1f0fd0d i2c: microchip-core: fix "ghost" detections
Running i2c-detect currently produces an output akin to:
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         08 -- 0a -- 0c -- 0e --
10: 10 -- 12 -- 14 -- 16 -- UU 19 -- 1b -- 1d -- 1f
20: -- 21 -- 23 -- 25 -- 27 -- 29 -- 2b -- 2d -- 2f
30: -- -- -- -- -- -- -- -- 38 -- 3a -- 3c -- 3e --
40: 40 -- 42 -- 44 -- 46 -- 48 -- 4a -- 4c -- 4e --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 -- 62 -- 64 -- 66 -- 68 -- 6a -- 6c -- 6e --
70: 70 -- 72 -- 74 -- 76 --

This happens because for an i2c_msg with a len of 0 the driver will
mark the transmission of the message as a success once the START has
been sent, without waiting for the devices on the bus to respond with an
ACK/NAK. Since i2cdetect seems to run in a tight loop over all addresses
the NAK is treated as part of the next test for the next address.

Delete the fast path that marks a message as complete when idev->msg_len
is zero after sending a START/RESTART since this isn't a valid scenario.

CC: stable@vger.kernel.org
Fixes: 64a6f1c498 ("i2c: add support for microchip fpga i2c controllers")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20241218-outbid-encounter-b2e78b1cc707@spud
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2024-12-26 01:54:47 +01:00
..
i2c-acorn.c
i2c-ali15x3.c i2c: ali15x3: reword according to newest specification 2024-07-11 15:13:10 +02:00
i2c-ali1535.c i2c: don't use ',' after delimiters 2024-09-10 00:33:52 +02:00
i2c-ali1563.c i2c: add missing MODULE_DESCRIPTION() macros 2024-07-09 00:46:06 +02:00
i2c-altera.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-amd756.c i2c: Drop legacy muxing pseudo-drivers 2024-11-17 11:58:14 +01:00
i2c-amd8111.c i2c: Don't let i2c adapters declare I2C_CLASS_SPD support if they support I2C_CLASS_HWMON 2024-01-18 21:10:41 +01:00
i2c-amd-asf-plat.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
i2c-amd-mp2-pci.c i2c: amd-mp2: use msix/msi if the hardware supports 2022-11-01 13:41:22 +01:00
i2c-amd-mp2-plat.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-amd-mp2.h i2c: amd-mp2: use msix/msi if the hardware supports 2022-11-01 13:41:22 +01:00
i2c-aspeed.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01: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: at91-master: remove printout on handled timeouts 2024-05-06 00:56:31 +02:00
i2c-at91-slave.c i2c: at91: Fix the functionality flags of the slave-only interface 2024-06-12 17:07:33 +01:00
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: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-bcm2835.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-bcm-iproc.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-bcm-kona.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-brcmstb.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-cadence.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01: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: add missing MODULE_DESCRIPTION() macros 2024-07-09 00:46:06 +02:00
i2c-ccgx-ucsi.h i2c: Introduce common module to instantiate CCGx UCSI 2022-02-15 10:04:53 +01:00
i2c-cgbc.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
i2c-cht-wc.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-cp2615.c i2c: cp2615: reword according to newest specification 2024-07-11 15:13:30 +02:00
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: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-davinci.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-designware-amdpsp.c i2c: designware: Fix spelling and other issues in the comments 2024-11-13 23:29:47 +01:00
i2c-designware-baytrail.c i2c: designware: Add AMD PSP I2C bus support 2022-02-11 15:38:23 +01:00
i2c-designware-common.c module: Convert default symbol namespace to string literal 2024-12-03 08:22:25 -08: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 module: Convert default symbol namespace to string literal 2024-12-03 08:22:25 -08:00
i2c-designware-pcidrv.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
i2c-designware-platdrv.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
i2c-designware-slave.c module: Convert default symbol namespace to string literal 2024-12-03 08:22:25 -08: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: diolan-u2c: reword according to newest specification 2024-07-11 15:14:08 +02:00
i2c-dln2.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-eg20t.c i2c: move drivers from strlcpy to strscpy 2022-08-11 23:02:51 +02:00
i2c-elektor.c i2c: Don't let i2c adapters declare I2C_CLASS_SPD support if they support I2C_CLASS_HWMON 2024-01-18 21:10:41 +01:00
i2c-emev2.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-exynos5.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-fsi.c i2c: fsi: reword according to newest specification 2024-07-11 15:14:09 +02:00
i2c-gpio.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-gxp.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-highlander.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-hisi.c i2c: hisi: reword according to newest specification 2024-07-11 15:14:10 +02:00
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: i801: Add support for Intel Panther Lake 2024-11-13 23:29:46 +01:00
i2c-ibm_iic.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-ibm_iic.h
i2c-icy.c i2c: move drivers from strlcpy to strscpy 2022-08-11 23:02:51 +02:00
i2c-img-scb.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-imx-lpi2c.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-imx.c i2c: imx: add imx7d compatible string for applying erratum ERR007805 2024-12-25 23:45:05 +01: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 to kernel-doc 2024-11-13 23:29:46 +01:00
i2c-ismt.c i2c: ismt: kill transaction in hardware on timeout 2024-09-10 00:36:55 +02:00
i2c-jz4780.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-keba.c i2c: keba: Add KEBA I2C controller support 2024-09-10 11:02:45 +02:00
i2c-kempld.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-ljca.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
i2c-lpc2k.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-ls2x.c i2c: ls2x: reword according to newest specification 2024-07-11 15:14:14 +02:00
i2c-mchp-pci1xxxx.c i2c: mchp-pci1xxxx: Avoid cast to incompatible function type 2023-06-05 10:43:45 +02:00
i2c-meson.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-microchip-corei2c.c i2c: microchip-core: fix "ghost" detections 2024-12-26 01:54:47 +01:00
i2c-mlxbf.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01: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: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-mt7621.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-mv64xxx.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-mxs.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-nforce2.c i2c: Drop legacy muxing pseudo-drivers 2024-11-17 11:58:14 +01:00
i2c-nomadik.c i2c: nomadik: Add missing sentinel to match table 2024-12-10 16:07:53 +01:00
i2c-npcm7xx.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01: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: reword according to newest specification 2024-07-11 15:14:16 +02:00
i2c-octeon-core.h i2c: octeon: reword according to newest specification 2024-07-11 15:14:16 +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: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-opal.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-owl.c i2c: owl: reword according to newest specification 2024-07-11 15:14:17 +02:00
i2c-parport.c parport: Remove parport_driver.devmodel 2024-07-03 16:44:22 +02:00
i2c-pasemi-core.c i2c: pasemi: reword according to newest specification 2024-07-11 15:14:17 +02:00
i2c-pasemi-core.h i2c: /pasemi: PASemi I2C controller IRQ enablement 2022-11-12 21:30:16 +01:00
i2c-pasemi-pci.c i2c: Don't let i2c adapters declare I2C_CLASS_SPD support if they support I2C_CLASS_HWMON 2024-01-18 21:10:41 +01: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 module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08: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: pnx: Fix timeout in wait functions 2024-12-10 15:50:50 +01:00
i2c-powermac.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-pxa-pci.c i2c: don't use ',' after delimiters 2024-09-10 00:33:52 +02:00
i2c-pxa.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-qcom-cci.c i2c: qcom-cci: Remove unused struct member cci_clk_rate 2024-11-17 11:58:56 +01:00
i2c-qcom-geni.c i2c: qcom-geni: Keep comment why interrupts start disabled 2024-11-17 11:58:14 +01:00
i2c-qup.c i2c: qup: use generic device property accessors 2024-11-24 16:03:50 +01:00
i2c-rcar.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-riic.c i2c: riic: Always round-up when calculating bus period 2024-12-12 12:54:02 +01: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: reword according to newest specification 2024-07-11 15:14:20 +02:00
i2c-rtl9300.c i2c: Add driver for the RTL9300 I2C controller 2024-11-17 11:58:57 +01:00
i2c-rzv2m.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-s3c2410.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-scmi.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-sh7760.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-sh_mobile.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-sibyte.c i2c: Don't let i2c adapters declare I2C_CLASS_SPD support if they support I2C_CLASS_HWMON 2024-01-18 21:10:41 +01:00
i2c-simtec.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-sis96x.c i2c: Don't let i2c adapters declare I2C_CLASS_SPD support if they support I2C_CLASS_HWMON 2024-01-18 21:10:41 +01:00
i2c-sis630.c i2c: Don't let i2c adapters declare I2C_CLASS_SPD support if they support I2C_CLASS_HWMON 2024-01-18 21:10:41 +01:00
i2c-sis5595.c i2c: sis5595: reword according to newest specification 2024-07-11 15:14:20 +02:00
i2c-sprd.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-st.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-stm32.c
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: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01: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: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-taos-evm.c i2c: taos-evm: reword according to newest specification 2024-07-11 15:14:22 +02:00
i2c-tegra-bpmp.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-tegra.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-thunderx-pcidrv.c i2c: thunderx-pcidrv: reword according to newest specification 2024-07-11 15:14:23 +02:00
i2c-tiny-usb.c i2c: tiny-usb: reword according to newest specification 2024-07-11 15:14:23 +02:00
i2c-uniphier-f.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-uniphier.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-versatile.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-via.c i2c: Don't let i2c adapters declare I2C_CLASS_SPD support if they support I2C_CLASS_HWMON 2024-01-18 21:10:41 +01:00
i2c-viai2c-common.c i2c: viai2c: reword according to newest specification 2024-07-11 15:14:24 +02:00
i2c-viai2c-common.h i2c: viai2c: turn common code into a proper module 2024-06-26 16:07:21 +02:00
i2c-viai2c-wmt.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-viai2c-zhaoxin.c i2c: viai2c: reword according to newest specification 2024-07-11 15:14:24 +02:00
i2c-viapro.c i2c: Don't let i2c adapters declare I2C_CLASS_SPD support if they support I2C_CLASS_HWMON 2024-01-18 21:10:41 +01:00
i2c-viperboard.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-virtio.c i2c: virtio: Constify struct i2c_algorithm and struct virtio_device_id 2024-09-10 00:36:50 +02:00
i2c-xgene-slimpro.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-xiic.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-xlp9xx.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
Kconfig i2c-for-6.13-rc1 2024-11-21 13:19:29 -08:00
Makefile i2c-for-6.13-rc1 2024-11-21 13:19:29 -08:00
scx200_acb.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00