From: Peter Korsgaard <peter@korsgaard.com>
To: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Federico Vaga <federico.vaga@cern.ch>,
Wolfram Sang <wsa@kernel.org>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
linux@ew.tq-group.com,
Gregor Herburger <gregor.herburger@tq-group.com>
Subject: Re: [PATCH v2] i2c: ocores: generate stop condition after timeout in polling mode
Date: Thu, 13 Apr 2023 11:58:26 +0200 [thread overview]
Message-ID: <87ile0qf25.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <20230413093737.15303-1-matthias.schiffer@ew.tq-group.com> (Matthias Schiffer's message of "Thu, 13 Apr 2023 11:37:37 +0200")
>>>>> "Matthias" == Matthias Schiffer <matthias.schiffer@ew.tq-group.com> writes:
> From: Gregor Herburger <gregor.herburger@tq-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@tq-group.com>
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
> v2: style improvements based on feedback from Federico and Andrew. I went
> with a slightly different solution than Andrew suggested to avoid using
> the ret variable for two different kinds of returns.
Acked-by: Peter Korsgaard <peter@korsgaard.com>
--
Bye, Peter Korsgaard
next prev parent reply other threads:[~2023-04-13 9:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-13 9:37 [PATCH v2] i2c: ocores: generate stop condition after timeout in polling mode Matthias Schiffer
2023-04-13 9:58 ` Peter Korsgaard [this message]
2023-04-13 11:54 ` Andrew Lunn
2023-04-13 14:05 ` Federico Vaga
2023-04-13 16:33 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ile0qf25.fsf@dell.be.48ers.dk \
--to=peter@korsgaard.com \
--cc=andrew@lunn.ch \
--cc=federico.vaga@cern.ch \
--cc=gregor.herburger@tq-group.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@ew.tq-group.com \
--cc=matthias.schiffer@ew.tq-group.com \
--cc=wsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox