linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Lawnick <ml.lawnick-Mmb7MZpHnFY@public.gmane.org>
To: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Rodolfo Giometti
	<giometti-AVVDYK/kqiJWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH 1/2] i2c: Multiplexed I2C bus core support.
Date: Mon, 19 Apr 2010 11:29:27 +0200	[thread overview]
Message-ID: <4BCC2277.3090406@gmx.de> (raw)
In-Reply-To: <20100416152329.29f3f90d-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>

Jean Delvare said the following:
> On Fri, 16 Apr 2010 15:10:11 +0200, Michael Lawnick wrote:
>> Jean Delvare said the following:
>> > One thing I forgot:
>> > 
>> >> > +		result = i2c_check_clients(to_i2c_adapter(adapter->dev.parent), addr);
>> >> > +	
>> >> > +	return result;
>> >> > +}
>> > 
>> > As discussed some weeks ago, this isn't actually sufficient. You don't
>> > only need to check the parent segments for address business, you also
>> > need to check all child segments, recursively. If any child segment has
>> > a device using the address in question, then you can't use it.
>> > 
>> > This may be more difficult to implement. In particular, you'll have to
>> > pay attention to locking.
>> > 
>> :-) This can't happen if we keep the part you commented on in the other
>> mail about probing for client one level above. Then this situation can't
>> arise.
> 
> I don't understand. In your code, the probe is done at the parent
> level, where address business had already been tested. What is needed
> is child segments checking, so the other side of the tree. I just can't
> see how your code would help with that.
> 
> Can you please explain why the probe is needed, and what it is doing
> that the standard address business check didn't cover already?
> 
Well, these are my thoughts:

The generic situation is

--- MUXn-1 --- MUXn -+- MUXn+1 ---
                     |
                client/device

A device gets physically visible on all buses beyond the one it is
connected to.

Given the bus tree we can decide whether a device is really present on a
particular bus if we
- H/W probe it on selected level. If does not respond, the current bus
is wrong.
- H/W probe it one level higher. If it responds, the current bus is wrong.
The first probing is already done in standard initialization sequence. I
added the second probing. By recursively calling __i2c_check_addr() it
is possible to reduce H/W-probing to ambiguous cases.

The current implementation implies that mux'es are reset to 'neutral'
after every bus transaction. If this would not be the case, switching of
MUXn+1 to neutral needed to be added.

-- 
KR
Michael

  parent reply	other threads:[~2010-04-19  9:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-25 12:13 [PATCH 1/2] i2c: Multiplexed I2C bus core support Michael Lawnick
     [not found] ` <4B5D8AFC.5060209-Mmb7MZpHnFY@public.gmane.org>
2010-01-25 12:15   ` [PATCH 1/2] i2c: driver for PCA954x I2C multiplexer series Michael Lawnick
     [not found]     ` <4B5D8B5D.9040108-Mmb7MZpHnFY@public.gmane.org>
2010-01-25 13:02       ` Michael Lawnick
2010-01-25 13:00   ` [PATCH 2/2] " Michael Lawnick
     [not found]     ` <4B5D95E7.1000804-Mmb7MZpHnFY@public.gmane.org>
2010-04-16 15:38       ` Jean Delvare
     [not found]         ` <20100416173807.3d86e0d7-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-04-19  9:24           ` Jean Delvare
2010-03-02 14:36   ` [PATCH 1/2] i2c: Multiplexed I2C bus core support Michael Lawnick
     [not found]     ` <4B8D2285.6020203-Mmb7MZpHnFY@public.gmane.org>
2010-03-02 15:05       ` Jean Delvare
     [not found]         ` <20100302160527.7f48f49c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-03  6:41           ` Michael Lawnick
2010-04-15 12:49   ` Jean Delvare
     [not found]     ` <20100415144906.2a20588d-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-04-16 11:21       ` Jean Delvare
     [not found]         ` <20100416132144.5ea8b0b1-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-04-16 13:10           ` Michael Lawnick
     [not found]             ` <4BC861B3.3090806-Mmb7MZpHnFY@public.gmane.org>
2010-04-16 13:23               ` Jean Delvare
     [not found]                 ` <20100416152329.29f3f90d-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-04-19  9:29                   ` Michael Lawnick [this message]
     [not found]                     ` <4BCC2277.3090406-Mmb7MZpHnFY@public.gmane.org>
2010-04-19 12:40                       ` Jean Delvare
     [not found]                         ` <20100419144014.5123b1b4-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-04-20  7:05                           ` Michael Lawnick
2010-04-16 12:44       ` Michael Lawnick
     [not found]         ` <4BC85BBA.5040308-Mmb7MZpHnFY@public.gmane.org>
2010-04-16 12:48           ` 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=4BCC2277.3090406@gmx.de \
    --to=ml.lawnick-mmb7mzphnfy@public.gmane.org \
    --cc=giometti-AVVDYK/kqiJWk0Htik3J/w@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@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;
as well as URLs for NNTP newsgroup(s).