From: Eric Anholt <eric@anholt.net>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Stephen Warren <swarren@wwwdotorg.org>,
Lee Jones <lee@kernel.org>,
linux-i2c@vger.kernel.org
Subject: Re: [PATCH] i2c: bcm2835: Set up the clock stretching timeout at boot.
Date: Mon, 03 Oct 2016 12:50:27 -0700 [thread overview]
Message-ID: <87int9nrek.fsf@eliezer.anholt.net> (raw)
In-Reply-To: <20160722072740.GG1605@katana>
[-- Attachment #1: Type: text/plain, Size: 1472 bytes --]
Wolfram Sang <wsa@the-dreams.de> writes:
> On Sun, Jul 03, 2016 at 06:02:32PM -0700, Eric Anholt wrote:
>> Wolfram Sang <wsa@the-dreams.de> writes:
>>
>> >> + /*
>> >> + * SMBUS says "Devices participating in a transfer will
>> >> + * timeout when any clock low exceeds the value of
>> >> + * T_TIMEOUT,MIN of 25 ms."
>> >> + */
>> >
>> > SMBus has that timeout, but I2C doesn't. How about disabling the timeout
>> > simply? Or using the max value if you want to keep the timeout
>> > detection?
>>
>> Disabling the timeout seems fine to me. We still have a 1-second
>> timeout around the entire transfer. I'll be back on my DSI branch this
>> week and test it out then.
>
> Did it work?
Sorry for the long-delayed feedback: It turned out that the reason I was
getting timeouts and looking into i2c in the first place was that the
firmware was driving that controller behind my back, so I couldn't do
useful testing anyway.
I put together a patch
(https://github.com/anholt/linux/commit/894200276239d2e4c60b378bdc52164fcb13af8d)
but I'm a bit concerned by it: I don't see a way to get the controller
back to its idle state without continuing through the I2C state machine,
and if the clock is still being stretched it doesn't continue unless CLK
is triggered.
What is supposed to happen when adap->timeout times out while the clock
is being stretched? Should we be able to try starting a fresh new I2C
transaction cleanly?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]
prev parent reply other threads:[~2016-10-03 19:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-01 22:07 [PATCH] i2c: bcm2835: Set up the clock stretching timeout at boot Eric Anholt
2016-06-02 16:35 ` Stefan Wahren
[not found] ` <25336b03-76d1-2466-fbc0-9f363d3e7638@i2se.com>
2016-06-02 18:02 ` Eric Anholt
2016-07-04 0:31 ` Wolfram Sang
2016-07-04 1:02 ` Eric Anholt
2016-07-22 7:27 ` Wolfram Sang
2016-10-03 19:50 ` Eric Anholt [this message]
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=87int9nrek.fsf@eliezer.anholt.net \
--to=eric@anholt.net \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=swarren@wwwdotorg.org \
--cc=wsa@the-dreams.de \
/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