linux/drivers/i2c/i2c-slave-testunit.c
Wolfram Sang 9e2d61c4dc i2c: testunit: on errors, repeat NACK until STOP
[ Upstream commit 6ad30f7890 ]

This backend requests a NACK from the controller driver when it detects
an error. If that request gets ignored from some reason, subsequent
accesses will wrongly be handled OK. To fix this, an error now changes
the state machine, so the backend will report NACK until a STOP
condition has been detected. This make the driver more robust against
controllers which will sadly apply the NACK not to the current byte but
the next one.

Fixes: a8335c64c5 ("i2c: add slave testunit driver")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-01-23 17:22:54 +01:00

283 lines
6.8 KiB