public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Peter Tyser <ptyser@xes-inc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Odd value for I2C_TIMEOUT in fsl_i2c.c
Date: Fri, 04 Sep 2009 11:04:00 -0500	[thread overview]
Message-ID: <1252080240.6005.86.camel@localhost.localdomain> (raw)
In-Reply-To: <4AA132B3.3050004@freescale.com>

On Fri, 2009-09-04 at 10:30 -0500, Timur Tabi wrote:
> Peter Tyser wrote:
> > If this is the case, the timeout should be the maximum (or reasonable
> > maximum) time an I2C transaction could take.
> 
> How long is that?  Is one millisecond good enough?

The timeout in i2c_wait4bus() could potentially be pretty large.  The
I2C bus could in theory be ran at very slow speeds, 1 cycle could be
many bytes, etc.  You'd have to dig into the spec to get a definitive
answer about how long a maximum cycle is (if there is even a value), but
I think it would have to be much longer than 1ms.  Looks like the linux
driver has a timeout of 1 second (for the equivalent of i2c_wait4bus()).
I'd be fine with that for U-Boot too.  99% of boards don't have multiple
masters so a large timeout shouldn't affect them at all.

As far as the I2C_TIMEOUT in general I'm not sure either:)  1ms might be
OK, but for reference the SMBus has a specified timeout of minimum 25ms,
max 35ms.  I'd tend to lean towards the conservative side as for devices
that are working correctly, they will never timeout.  If i2c
transactions are timing out, I'd be more concerned about why than the
extra 2 seconds my board took to boot:)  I guess the i2c probe command
might take a while too, but that personally doesn't bother me.

In any case, I'd vote for a different, very large timeout value for
i2c_wait4bus() and a few millisecond (or larger) timeout for
I2C_TIMEOUT.

Best,
Peter

  reply	other threads:[~2009-09-04 16:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-03 15:22 [U-Boot] Odd value for I2C_TIMEOUT in fsl_i2c.c Timur Tabi
2009-09-04  7:16 ` Heiko Schocher
2009-09-04  9:25   ` Wolfgang Denk
2009-09-04 14:09     ` Timur Tabi
2009-09-04 15:01       ` Wolfgang Denk
2009-09-04 15:12         ` Timur Tabi
2009-09-04 15:28           ` Peter Tyser
2009-09-04 15:30             ` Timur Tabi
2009-09-04 16:04               ` Peter Tyser [this message]
2009-09-04 18:30               ` Wolfgang Denk
2009-09-04 18:39                 ` Timur Tabi
2009-09-04 19:28                   ` Wolfgang Denk
2009-09-04 18:28             ` Wolfgang Denk
2009-09-04 15:29           ` Wolfgang Denk
2009-09-04 18:34             ` Scott Wood
2009-09-04 19:23               ` Wolfgang Denk
2009-09-04 19:28                 ` Scott Wood
2009-09-04  8:31 ` Wolfgang Denk
2009-09-04 18:36   ` Scott Wood
2009-09-04 19:27     ` Wolfgang Denk

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=1252080240.6005.86.camel@localhost.localdomain \
    --to=ptyser@xes-inc.com \
    --cc=u-boot@lists.denx.de \
    /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