From: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
To: "Jean-François Dagenais"
<jeff.dagenais-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org,
wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [lm-sensors] i2c multimaster and the device driver detect function
Date: Thu, 9 May 2013 06:30:03 -0700 [thread overview]
Message-ID: <20130509133003.GA898@roeck-us.net> (raw)
In-Reply-To: <3322BACE-9434-4249-8621-C1AD0D340A8A-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Thu, May 09, 2013 at 08:38:28AM -0400, Jean-François Dagenais wrote:
>
> On 2013-05-08, at 11:53 PM, Guenter Roeck wrote:
>
> > Guess the real conclusion is that one should avoid two active masters
> > in the first place if possible.
>
> I agree, I can't think of any benefits worth the trouble.
>
> > 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.
>
> That's great advice!! I will look into this, thanks!
>
> > Note that the Kontron driver also sets I2C_CLASS_SPD, which means EEPROMs are
> > auto-detected on address 0x50.
>
> Funny, I had to explicitly inject "I2C_BOARD_INFO("24c32", 0x50)" to see
> Kontron's JIDA chip.
>
Interesting.
> >> [...] 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.
>
> My thoughts exactly. I would have avoided it. Right now I am trying to improve
> and existing design.
>
> > Guess you are saying that the I2C master in the
> > Kontron PLD can not drive the AD7147 - is that correct ?
>
> Well no, it does drive it, we have it in stable production. It's just that when
> you have your finger on the wheel, CPU usage goes up to 5-15%. More intense
> polling of the sensors also takes a toll on the CPU. For different reasons other
> than the ad714x, the FPGA i2c core option suddenly became attractive.
>
> > 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.
>
> Yeah, we already considered that... our FPGA's reset and flash select are
> controlled by an i2c I/O expander! Hehe, so this I/O expander needs to be
> mastered from the kempld. Reality is a bummer ;)
>
> >
> > Did you tell Kontron about the problems with their PLD ? Maybe they have a
> > solution.
>
> Yes we did. If I remember correctly, the problem is the absence of an interrupt
> line from the PLD to the CPU, which explains the high CPU since the driver
> sleeps-polls for async PLD completions and statuses. ... I know...
>
Ah, that one. Yes, the higher CPU utilization is an indication that this is due
to polling, not due to power draw on the I2C lines. You might try to increase
the usleep_range interval in the Kontron driver to reduce the load a bit.
Anyway (kind of) good news - newer Kontron boards do support interrupts and no
longer have to revert to polling.
Thanks,
Guenter
WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: "Jean-François Dagenais"
<jeff.dagenais-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org,
wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [lm-sensors] i2c multimaster and the device driver detect function
Date: Thu, 09 May 2013 13:30:03 +0000 [thread overview]
Message-ID: <20130509133003.GA898@roeck-us.net> (raw)
In-Reply-To: <3322BACE-9434-4249-8621-C1AD0D340A8A-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Thu, May 09, 2013 at 08:38:28AM -0400, Jean-François Dagenais wrote:
>
> On 2013-05-08, at 11:53 PM, Guenter Roeck wrote:
>
> > Guess the real conclusion is that one should avoid two active masters
> > in the first place if possible.
>
> I agree, I can't think of any benefits worth the trouble.
>
> > 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.
>
> That's great advice!! I will look into this, thanks!
>
> > Note that the Kontron driver also sets I2C_CLASS_SPD, which means EEPROMs are
> > auto-detected on address 0x50.
>
> Funny, I had to explicitly inject "I2C_BOARD_INFO("24c32", 0x50)" to see
> Kontron's JIDA chip.
>
Interesting.
> >> [...] 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.
>
> My thoughts exactly. I would have avoided it. Right now I am trying to improve
> and existing design.
>
> > Guess you are saying that the I2C master in the
> > Kontron PLD can not drive the AD7147 - is that correct ?
>
> Well no, it does drive it, we have it in stable production. It's just that when
> you have your finger on the wheel, CPU usage goes up to 5-15%. More intense
> polling of the sensors also takes a toll on the CPU. For different reasons other
> than the ad714x, the FPGA i2c core option suddenly became attractive.
>
> > 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.
>
> Yeah, we already considered that... our FPGA's reset and flash select are
> controlled by an i2c I/O expander! Hehe, so this I/O expander needs to be
> mastered from the kempld. Reality is a bummer ;)
>
> >
> > Did you tell Kontron about the problems with their PLD ? Maybe they have a
> > solution.
>
> Yes we did. If I remember correctly, the problem is the absence of an interrupt
> line from the PLD to the CPU, which explains the high CPU since the driver
> sleeps-polls for async PLD completions and statuses. ... I know...
>
Ah, that one. Yes, the higher CPU utilization is an indication that this is due
to polling, not due to power draw on the I2C lines. You might try to increase
the usleep_range interval in the Kontron driver to reduce the load a bit.
Anyway (kind of) good news - newer Kontron boards do support interrupts and no
longer have to revert to polling.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2013-05-09 13:30 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-04 9:03 [RFC] i2c: Providing hooks for i2c multimaster bus arbitration Yuvaraj Kumar C D
2013-02-04 9:03 ` Yuvaraj Kumar C D
2013-02-04 11:13 ` Yuvaraj Kumar
2013-02-04 11:13 ` Yuvaraj Kumar
2013-02-06 0:23 ` Doug Anderson
2013-02-06 0:23 ` Doug Anderson
[not found] ` <CAD=FV=VQywwQ3YAFb=1qFmd3UEW39Xu=ok6fdjhvBXdwOQOa1Q@mail.gmail.com>
[not found] ` <CAD=FV=VQywwQ3YAFb=1qFmd3UEW39Xu=ok6fdjhvBXdwOQOa1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-06 5:28 ` Yuvaraj Kumar
2013-02-06 5:28 ` Yuvaraj Kumar
2013-02-06 5:33 ` Yuvaraj Kumar
2013-02-06 5:33 ` Yuvaraj Kumar
2013-02-06 6:00 ` Simon Glass
2013-02-06 6:00 ` Simon Glass
2013-02-10 18:17 ` Wolfram Sang
2013-02-10 18:17 ` Wolfram Sang
2013-02-11 23:53 ` Doug Anderson
2013-02-11 23:53 ` Doug Anderson
2013-02-12 0:17 ` Simon Glass
2013-02-12 0:17 ` Simon Glass
[not found] ` <CAPnjgZ3HnXDp9ErsbZEfpc-NexuAt1C5cUWbFn=BW2TMGiMJEg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-12 10:03 ` Wolfram Sang
2013-02-12 10:03 ` Wolfram Sang
2013-02-12 10:49 ` Ben Dooks
2013-02-12 16:48 ` Uwe Kleine-König
[not found] ` <20130212164811.GV8668-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-05-08 15:57 ` i2c multimaster and the device driver detect function Jean-François Dagenais
2013-05-08 15:57 ` [lm-sensors] " Jean-François Dagenais
[not found] ` <3D8D1B67-2846-4B78-B402-6B9FD1CB10E6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-05-08 17:54 ` Guenter Roeck
2013-05-08 17:54 ` Guenter Roeck
[not found] ` <20130508175417.GB29689-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-05-09 1:50 ` Jean-François Dagenais
2013-05-09 1:50 ` Jean-François Dagenais
2013-05-09 3:53 ` Guenter Roeck
2013-05-09 3:53 ` [lm-sensors] " Guenter Roeck
[not found] ` <20130509035313.GA26817-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-05-09 12:38 ` Jean-François Dagenais
2013-05-09 12:38 ` Jean-François Dagenais
[not found] ` <3322BACE-9434-4249-8621-C1AD0D340A8A-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-05-09 13:30 ` Guenter Roeck [this message]
2013-05-09 13:30 ` Guenter Roeck
2013-05-13 8:11 ` Jean Delvare
2013-05-13 8:11 ` Jean Delvare
[not found] ` <20130513101150.0c9e4d30-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2013-05-13 13:54 ` Jean-François Dagenais
2013-05-13 13:54 ` Jean-François Dagenais
[not found] ` <E43DA0E6-A130-4837-8343-EEC182A12EE6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-05-13 14:14 ` Jean Delvare
2013-05-13 14:14 ` Jean Delvare
[not found] ` <20130513161413.58ebc9e8-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2013-05-13 14:56 ` Guenter Roeck
2013-05-13 14:56 ` Guenter Roeck
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=20130509133003.GA898@roeck-us.net \
--to=linux-0h96xk9xttrk1umjsbkqmq@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=jeff.dagenais-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.