linux-yocto/drivers/i2c
Yang Xiwen a7982a14b3 i2c: qup: jump out of the loop in case of timeout
Original logic only sets the return value but doesn't jump out of the
loop if the bus is kept active by a client. This is not expected. A
malicious or buggy i2c client can hang the kernel in this case and
should be avoided. This is observed during a long time test with a
PCA953x GPIO extender.

Fix it by changing the logic to not only sets the return value, but also
jumps out of the loop and return to the caller with -ETIMEDOUT.

Fixes: fbfab1ab06 ("i2c: qup: reorganization of driver code to remove polling for qup v1")
Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
Cc: <stable@vger.kernel.org> # v4.17+
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20250616-qca-i2c-v1-1-2a8d37ee0a30@outlook.com
2025-07-24 00:38:01 +02:00
..
algos i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
busses i2c: qup: jump out of the loop in case of timeout 2025-07-24 00:38:01 +02:00
muxes i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +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 ELAN06FA touchpad I2C bus freq to 100KHz 2025-01-14 13:01:31 +01:00
i2c-core-base.c i2c: Use str_read_write() helper 2025-05-23 17:28:07 +02: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: dev: Fix memory leak when underlying adapter does not support I2C 2024-11-14 11:22:57 +01:00
i2c-mux.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-slave-eeprom.c i2c: slave-eeprom: Constify 'struct bin_attribute' 2025-01-09 10:48:44 +01: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 i2c: stub: Don't let i2c adapters declare I2C_CLASS_SPD support if they support I2C_CLASS_HWMON 2024-01-18 21:10:41 +01:00
Kconfig i2c: Remove I2C_COMPAT config symbol and related code 2024-09-07 18:31:28 +02:00
Makefile i2c: Introduce OF component probe function 2024-11-27 12:04:10 +01:00