i2c: testunit: on errors, repeat NACK until STOP
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 15 Jan 2025 16:23:47 +0000 (17:23 +0100)
committerWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 15 Jan 2025 18:44:21 +0000 (19:44 +0100)
commit6ad30f7890423341f4b79329af1f9b9bb3cdec03
treeaa5d1472315839041c0516952b3ae23b071ab17d
parent093f70c134f70e4632b295240f07d2b50b74e247
i2c: testunit: on errors, repeat NACK until STOP

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: a8335c64c5f0 ("i2c: add slave testunit driver")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
drivers/i2c/i2c-slave-testunit.c