From: "Albrecht Dreß" <albrecht.dress@arcor.de>
To: Ben Dooks <ben-linux@fluff.org>
Cc: Linux PPC Development <linuxppc-dev@ozlabs.org>,
Devicetree Discussions <devicetree-discuss@lists.ozlabs.org>
Subject: Re: [PATCH/RFC 1/2] 5200: improve i2c bus error recovery
Date: Mon, 25 Jan 2010 21:21:57 +0100 [thread overview]
Message-ID: <1264450925.2315.0@antares> (raw)
In-Reply-To: <20100125040653.GS10014@trinity.fluff.org> (from ben-linux@fluff.org on Mon Jan 25 05:06:53 2010)
[-- Attachment #1: Type: text/plain, Size: 2746 bytes --]
Am 25.01.10 05:06 schrieb(en) Ben Dooks:
> On Fri, Jan 22, 2010 at 09:17:55PM +0100, Albrecht Dreß wrote:
>> Improve the recovery of the MPC5200B's I2C bus from errors like bus hangs.
>
> This is very sparse comapred to the large comment below the --- line, maybe some more description should be living up here.
Hmm, that was my interpretation of #15 in Documentation/SubmittingPatches... ;-) Maybe it should read
<snip>
Improve the recovery of the MPC5200B's I2C bus from errors like bus hangs. This includes making the bus timeout configurable, a better detection of cases where the bus has to be "fixed" after a timeout, and a more thorough fixup sequence.
</snip>
> Is thios a candidate for an -rc or should it be left to merge window?
Well, basically it was a rfc. I apparently need it on my 5200B board, but I hoped to get some more insight from the Freescale/I2C gurus (see "open questions" in the post). Thus merge window, IMHO...
Thanks, Albrecht.
>
> > Signed-off-by: Albrecht Dreß <albrecht.dress@arcor.de>
> >
> > ---
> >
> > This patch introduces several improvements to the MPC5200B's I2C driver
> > as to improve the recovery from error conditions I encountered when
> > testing a custom board with several I2C devices attached (eeprom, io
> > expander, rtc, sensors). The error conditions included cases where the
> > bus if logic of one slave apparently went south, blocking the bus
> > completely.
> >
> > My fixes include:
> > 1. make the bus timeout configurable in fsl_i2c_probe(); the default of
> > one second is *way* too long for my use case;
> > 2. if a timeout condition occurs in mpc_xfer(), mpc_i2c_fixup() the bus
> > if *any* of the CF, BB and RXAK flags in the MSR is 1. I actually
> > saw different combinations with hangs, not only all three set;
> > 3. improve the fixup procedure by calculating the timing needed from the
> > real (configured) bus clock, calculated in mpc_i2c_setclock_52xx().
> > Furthermore, I issue 9 instead of one cycle, as I experienced cases
> > where the single one is not enough (found this tip in a forum). As a
> > side effect, the new scheme needs only 81us @375kHz bus clock instead
> > of 150us. I recorded waveforms for 18.4kHz, 85.9kHz and 375kHz, all
> > looking fine, which I can provide if anyone is interested.
> >
> > Open questions:
> > - is the approach correct at all, in particular the interpretation of
> > the flags (#2)?
> > - could this code also be used on non-5200 processors?
> >
> > --- linux-2.6.32-orig/drivers/i2c/busses/i2c-mpc.c 2009-12-03 04:51:21.000000000 +0100
> > +++ linux-2.6.32/drivers/i2c/busses/i2c-mpc.c 2010-01-22 16:05:13.000000000 +0100
[snip]
[-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --]
next prev parent reply other threads:[~2010-01-25 20:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-22 20:17 [PATCH/RFC 1/2] 5200: improve i2c bus error recovery Albrecht Dreß
2010-01-25 4:06 ` Ben Dooks
2010-01-25 20:21 ` Albrecht Dreß [this message]
2010-02-16 19:31 ` Grant Likely
2010-02-16 19:49 ` Ira W. Snyder
2010-02-16 20:02 ` Albrecht Dreß
2010-02-16 20:14 ` Albrecht Dreß
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=1264450925.2315.0@antares \
--to=albrecht.dress@arcor.de \
--cc=ben-linux@fluff.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).