public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
Cc: Clifford Wolf <clifford-cPpHkPqGOEfk7+2FdBfRIA@public.gmane.org>,
	Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
	Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
Subject: Re: Handling of i2c arbitration loss (Was: i2c-fix-i2c-mpc-driver-for-multi-master-i2c-busses.patch  added to -mm tree)
Date: Mon, 16 Feb 2009 14:08:09 +0100	[thread overview]
Message-ID: <20090216140809.01acaea1@hyperion.delvare> (raw)
In-Reply-To: <200902160358.48176.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>

Hi Dave,

On Mon, 16 Feb 2009 03:58:47 -0800, David Brownell wrote:
> On Monday 16 February 2009, Jean Delvare wrote:
> > > There's no guarantee of idempotency in messages; only
> > > callers can know if retrying a given partially completed
> > > message is safe.  And since fault reporting is still goofy,
> > > we can't know just where arbitration was lost... in the
> > > first master transmit, second (after repeated START),
> > > third, etc.
> > 
> > As already explained by Clifford, arbitration loss is about messages
> > which have not been transmitted at all. So retrying is always OK.
> 
> I must have missed that.  It's not correct, in any case.
> Messages can easily have been *partially* transmitted.

Sorry, but no, really. On bus error or device error, yes, but not on
arbitration loss, by definition of arbitration on I2C buses.

> Loss of arbitration appears at the first transmitted bit
> where one master sends '0' and overrides another, which
> is sending '1' instead.  Ideally it's while addressing a
> device, but it could be after some data bytes have been
> sent ... and, depending on the slave, acted upon.  Even
> after one or more repeated starts.

Please think about it all again. If two masters talk at the same time,
as long as they send the same bits, none loses arbitration. The
addressed slave OTOH has no clue that there are two masters talking, it
sees the exact same data as if only one master was talking. At the
moment one of the master loses arbitration it'll stop talking, and from
the slave's point of view everything is as if it had never talked in
the first place.

The funny case being if both masters actually send the exact same
message, because neither will lose arbitration, both think they
succeeded, but the slave has really only received the message once, not
twice. Which may or may not be a problem depending on what the slave is
supposed to do out of the message in question - but this is a hardware
limitation and up to the designers to think of and deal with.

-- 
Jean Delvare

  parent reply	other threads:[~2009-02-16 13:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200812222101.mBML1kn7021201@imap1.linux-foundation.org>
     [not found] ` <20090108154604.2cade06e@hyperion.delvare>
     [not found] ` <20090109100145.GA12376@clifford.at>
     [not found]   ` <20090214121745.39dfddf9@hyperion.delvare>
     [not found]     ` <200902151653.36860.david-b@pacbell.net>
     [not found]       ` <200902151653.36860.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2009-02-16  8:20         ` + i2c-fix-i2c-mpc-driver-for-multi-master-i2c-busses.patch added to -mm tree Jean Delvare
     [not found]           ` <20090216092000.13af2d74-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-02-16 11:58             ` David Brownell
     [not found]               ` <200902160358.48176.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2009-02-16 12:41                 ` Clifford Wolf
2009-02-16 13:08                 ` Jean Delvare [this message]
     [not found]                   ` <20090216140809.01acaea1-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-02-19 19:15                     ` Handling of i2c arbitration loss (Was: i2c-fix-i2c-mpc-driver-for-multi-master-i2c-busses.patch added to -mm tree) David Brownell
     [not found]                       ` <200902191115.07289.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2009-02-19 21:08                         ` Clifford Wolf
2009-02-19 21:31                         ` Jean Delvare
     [not found]     ` <20090214180014.GA19352@clifford.at>
     [not found]       ` <20090215113122.5bcc3f3d@hyperion.delvare>
     [not found]         ` <20090216131026.GA17437@clifford.at>
     [not found]           ` <20090216131026.GA17437-cPpHkPqGOEfk7+2FdBfRIA@public.gmane.org>
2009-02-19 16:26             ` Handling of i2c arbitration loss Jean Delvare
     [not found]               ` <20090219172605.7e70a797-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-02-19 21:23                 ` Clifford Wolf
     [not found]                   ` <20090219212325.GC16107-cPpHkPqGOEfk7+2FdBfRIA@public.gmane.org>
2009-02-20 11:45                     ` Jean Delvare
     [not found]                       ` <20090220124546.193e49f2-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-04-09  6:47                         ` Jean Delvare
     [not found]                           ` <20090409084726.3f2bd193-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-04-09  8:35                             ` Clifford Wolf
     [not found]                               ` <20090409083553.GA20058-cPpHkPqGOEfk7+2FdBfRIA@public.gmane.org>
2009-04-23 12:24                                 ` Jean Delvare

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=20090216140809.01acaea1@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
    --cc=clifford-cPpHkPqGOEfk7+2FdBfRIA@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.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