From: Wolfram Sang <wsa@the-dreams.de>
To: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
Cc: "oss@buserror.net" <oss@buserror.net>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>
Subject: Re: [PATCHv2] i2c-mpc: Correct I2C reset procedure
Date: Wed, 21 Jun 2017 23:36:47 +0200 [thread overview]
Message-ID: <20170621213647.GA2419@katana> (raw)
In-Reply-To: <1496095395.17446.111.camel@infinera.com>
[-- Attachment #1: Type: text/plain, Size: 1229 bytes --]
> I did my I2C reset analysis many years ago but I found the reason in
> som old code I had lying around, just sending 9 clocks will not
> recover the case when stuck in an I2C write sequence. Adding START
> into the sequence keeps the device in START once it has seen at least
> one START, then the STOP will release the bus in the end.
OK. I had some time to dig into the specs and understand why I was a bit
cautious: Chapter 3.1.16 of the I2C specs describes the procedure of 9x
toggling to be done when SDA is stuck low (which is super bad because
you can't signal a STOP then). SDA can only stuck low in the read case.
In the write case, the master controls SDA, and thus, you should be able
to signal STOP immediately.
So, for the write case, I'd think a single STOP before toggling should
do. Toggling 9x even means you could then write something somewhere
which in case of a PMIC can be really dangerous.
(BTW I just noticed that the generic recovery routines in the I2C core
do not send any STOP. Neither before nor after the toggling. This might
need fixing but is a seperate issue).
This is all from a theoretical point of view. I don't have a test case
for that. Do you have a reproducibly misbehaving device?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-06-21 21:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-11 12:20 [PATCHv2] i2c-mpc: Correct I2C reset procedure Joakim Tjernlund
2017-05-16 15:13 ` Joakim Tjernlund
2017-05-23 13:47 ` Joakim Tjernlund
2017-05-24 0:58 ` Scott Wood
2017-05-29 21:04 ` Wolfram Sang
2017-05-29 22:03 ` Joakim Tjernlund
2017-06-21 21:36 ` Wolfram Sang [this message]
2017-06-21 21:59 ` Wolfram Sang
2017-06-22 8:40 ` Joakim Tjernlund
2017-06-22 10:00 ` Wolfram Sang
2017-06-22 11:39 ` Joakim Tjernlund
2017-06-18 16:27 ` Joakim Tjernlund
2021-11-29 11:51 ` 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=20170621213647.GA2419@katana \
--to=wsa@the-dreams.de \
--cc=Joakim.Tjernlund@infinera.com \
--cc=linux-i2c@vger.kernel.org \
--cc=oss@buserror.net \
/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;
as well as URLs for NNTP newsgroup(s).