Skip to content
Commit f8160d3b authored by Gregor Herburger's avatar Gregor Herburger Committed by Wolfram Sang
Browse files

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: default avatarGregor Herburger <gregor.herburger@tq-group.com>
Signed-off-by: default avatarMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Acked-by: default avatarPeter Korsgaard <peter@korsgaard.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarFederico Vaga <federico.vaga@cern.ch>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent aa874cdf
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment