From: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
To: "wsa@the-dreams.de" <wsa@the-dreams.de>
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: Thu, 22 Jun 2017 08:40:25 +0000 [thread overview]
Message-ID: <1498120824.14148.27.camel@infinera.com> (raw)
In-Reply-To: <20170621215924.GB2419@katana>
On Wed, 2017-06-21 at 23:59 +0200, Wolfram Sang wrote:
> > Toggling 9x even means you could then write something somewhere
> > which in case of a PMIC can be really dangerous.
>
> I am partly wrong here because you send a START beforehand. And devices
> are required to reset their state machine when they detect a START (I2C
> Specs 3.1.10, Note 4). So, it *shouldn't* be dangerous. If all devices
> follow that rule, that is...
>
> However, you can only send START when SDA is not stuck. And still, this
> whole toggling is to reanimate a stuck SDA. So, it still looks to me
> that it doesn't make sense to have START & STOP around the toggling and
> rather have a single STOP before you try toggling.
>
> Makes sense?
STOP must be last so the bus is released, this was one of the problems the patch fixed as
next transfer would find the bus busy and the went into fixup again.
In general you cannot known if the slave stuck in somewhere in READ/WRITE or
some other state. Stuck is probably the wrong word here, not in sync is a better description.
If you are afraid the slave won't see the the STARTs why would it see any STOPs?
Take this case:
> 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.
Why would a STOP do anything here? The device is not listening until you get to
end of the byte where it will listen to NACK, STOP or START.
The best way to get the slaves attention is the send the 9 clocks with a START,
if possible, in each clock. That will get the slaves attention and place the slave
in START state, then you finish with a STOP so all devices, including any masters,
sees that the bus is free.
Jocke
next prev parent reply other threads:[~2017-06-22 8:40 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
2017-06-21 21:59 ` Wolfram Sang
2017-06-22 8:40 ` Joakim Tjernlund [this message]
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=1498120824.14148.27.camel@infinera.com \
--to=joakim.tjernlund@infinera.com \
--cc=linux-i2c@vger.kernel.org \
--cc=oss@buserror.net \
--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;
as well as URLs for NNTP newsgroup(s).