linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: plagnioj@jcrosoft.com (Jean-Christophe PLAGNIOL-VILLARD)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] at91sam9g45: fix i2c bus speed
Date: Thu, 23 Sep 2010 13:07:33 +0200	[thread overview]
Message-ID: <20100923110733.GY32018@game.jcrosoft.org> (raw)
In-Reply-To: <20100923103645.GA23295@n2100.arm.linux.org.uk>

On 11:36 Thu 23 Sep     , Russell King - ARM Linux wrote:
> On Thu, Sep 23, 2010 at 12:21:14PM +0200, Peter Korsgaard wrote:
> > >>>>> "Russell" == Russell King <- ARM Linux <linux@arm.linux.org.uk>> writes:
> > 
> >  Russell> udelay(5) should always give something approximating a 5us
> >  Russell> delay, as we calibrate this delay loop against the system
> >  Russell> timer.  What I could believe is probably going on here is that
> >  Russell> writing to the hardware is adding additional delays - but
> >  Russell> that's nothing to do with the CPU speed itself.
> > 
> > Well, the gpio handling (sw) overhead is to a certain degree related to
> > the CPU speed.
> 
> Isn't that what I said?
> 
> Jean is right - if you want to care this much about getting the I2C
> transfer rate as close to 100kHz or 400kHz (without exceeding it),
> you need to pass the required speed and run some sort of calibration
> in the driver to calculate the correct delay.
> 
> Howver, the danger of using 3us instead of 5us is that you may measure
> 3us using the bus conditions at the time of measurement - which may be
> contributing to the delay.  What happens if these bus conditions change?
> For example, if you move to a different operating point and the bus speed
> increases ?
> 
> Note that the calibration approach will also suffer from this problem.
I was thinking of a pseudo clock maybe that we will make evolving depending of
the bus clock typically PM
but I'm still afraid that will also depend on the cpu load but it we take a
max boundry when the cpu load is low at least we will not increase the bus max
speed

Best Regards,
J.

      parent reply	other threads:[~2010-09-23 11:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-22  9:31 [PATCH] at91sam9g45: fix i2c bus speed Peter Korsgaard
2010-09-22 10:48 ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-22 11:08   ` Peter Korsgaard
2010-09-22 14:34     ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-22 14:54       ` Wolfgang Wegner
2010-09-22 16:09         ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-22 15:18       ` Peter Korsgaard
2010-09-22 16:05         ` Nicolas Ferre
2010-09-22 16:10         ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-22 16:06 ` Nicolas Ferre
2010-09-23  8:18 ` Nicolas Ferre
2010-09-23  9:22   ` Peter Korsgaard
2010-09-23  9:31     ` Russell King - ARM Linux
2010-09-23 10:09       ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-23 10:24         ` Peter Korsgaard
2010-09-23 10:21       ` Peter Korsgaard
2010-09-23 10:36         ` Russell King - ARM Linux
2010-09-23 10:54           ` Peter Korsgaard
2010-09-23 11:16             ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-23 11:32               ` Peter Korsgaard
2010-09-23 12:00                 ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-23 11:07           ` Jean-Christophe PLAGNIOL-VILLARD [this message]

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=20100923110733.GY32018@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=linux-arm-kernel@lists.infradead.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).