[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f6a1ee9c-73bc-4e0c-b67e-6d8ade26e636@lunn.ch>
Date: Thu, 13 Apr 2023 13:54:00 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Matthias Schiffer <matthias.schiffer@...tq-group.com>
Cc: Peter Korsgaard <peter@...sgaard.com>,
Federico Vaga <federico.vaga@...n.ch>,
Wolfram Sang <wsa@...nel.org>, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org, linux@...tq-group.com,
Gregor Herburger <gregor.herburger@...group.com>
Subject: Re: [PATCH v2] i2c: ocores: generate stop condition after timeout in
polling mode
On Thu, Apr 13, 2023 at 11:37:37AM +0200, Matthias Schiffer wrote:
> From: Gregor Herburger <gregor.herburger@...group.com>
>
> 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: 69c8c0c0efa8 ("i2c: ocores: add polling interface")
> Signed-off-by: Gregor Herburger <gregor.herburger@...group.com>
> Signed-off-by: Matthias Schiffer <matthias.schiffer@...tq-group.com>
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Andrew
Powered by blists - more mailing lists