i2c: ocores: generate stop condition after timeout in polling mode
In polling mode, no stop condition is generated after a timeout. This causes SCL to remain low and thereby block the bus. If this happens during a transfer it can cause slaves to misinterpret the subsequent transfer and return wrong values. To solve this, pass the ETIMEDOUT error up from ocores_process_polling() instead of setting STATE_ERROR directly. The caller is adjusted to call ocores_process_timeout() on error both in polling and in IRQ mode, which will set STATE_ERROR and generate a stop condition. Fixes: 69c8c0c0 ("i2c: ocores: add polling interface") Signed-off-by:Gregor Herburger <gregor.herburger@tq-group.com> Signed-off-by:
Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Acked-by:
Peter Korsgaard <peter@korsgaard.com> Reviewed-by:
Andrew Lunn <andrew@lunn.ch> Reviewed-by:
Federico Vaga <federico.vaga@cern.ch> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
Showing
Please register or sign in to comment