Re: [lm-sensors] i2c multimaster and the device driver detect function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 08, 2013 at 09:50:44PM -0400, Jean-François Dagenais wrote:
> 
> On 2013-05-08, at 13:54, Guenter Roeck wrote:
> 
> > [...]
> > Isn't it the point of having multiple masters on the same bus, that each of
> > them can manage the same devices ?
> 
> I wouldn't think so. You mention why in your last paragraph and I totally see
> and agree with that. So that is not my intention at all.
> 
Guess the real conclusion is that one should avoid two active masters
in the first place if possible.

> > 
> > Question for me is why you would want two masters in the same system context
> > point to the same I2C bus. Usually the second master would be something like an
> > IPMI controller or a second CPU/controller board in a redundant system.
> 
> I guess that's one scenario. In our scenario, we have an assambled board stack.
> The main board has a sub-par i2c master onto which heavy slaves such as the
> ad7147 capacitive input device consumes too much cpu power (cpu has to poll the
> Kontron PLD which houses the i2c master core). Our hoped solution was to
> allocate an i2c IP core in our FPGA. But board inter-connect budget didn't allow
> for separate i2c segments, especially in the light that both master are said to
> support multimaster operation. I got this working experimentally right now, I
> just stumbled on jc42's detect, and am trying to project this kind of design to
> the future. Right now, my only solution is to patch my version of jc42 not to
> auto-detect, and explicitely enumerate my temperature sensors like my other
> slaves in arch setup... yikes.
> 
Is one of the I2C adapter drivers your own ? If so, you can disable auto-detection
in the adapter code by setting the adapter class to 0 (specifically, don't set it
to I2C_CLASS_HWMON). You can do the same in the Kontron driver if you have the
source (it is GPL so you should be able to find it). While not perfect, that should
be better than disabling auto-detection in the affected chip drivers.
Note that the Kontron driver also sets I2C_CLASS_SPD, which means EEPROMs are
auto-detected on address 0x50.

> > 
> > Even then the multi-master scenario is problematic, as you still end up with
> > multiple masters controlling the same device. That is a problem inherent to I2C,
> > and especially problematic with multi-page devices (typical problem: master 1
> > sets page, master 2 sets page, master 1 accesses wrong data). I don't think there
> > is a clean solution to solve that, other than to block i2c access for one of the
> > masters entirely.
> 
> Other than the redundant/resiliency scenario, why would you setup the same slave
> on two different masters? Right now I have a working setup where some slaves are
> declared on bus 0 (PLD i2c master) and others on bus 1 (FPGA i2c master). I have
> yet to stress test the setup within the next day or so, but so far, it seems to
> work ok.
> 
Sure, it does work, I am just not sure what the benefits are of having two
masters in this scenario. Guess you are saying that the I2C master in the
Kontron PLD can not drive the AD7147 - is that correct ? If so, and if that
means you have to use your own I2C core anyway, why bother using the Kontron
PLD's I2C bus to start with ? You could just ignore it (ie not instantiate
or build it at all) and use your own.

Did you tell Kontron about the problems with their PLD ? Maybe they have a
solution.

Thanks,
Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux