All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Jean Delvare <khali@linux-fr.org>
Subject: i2c algo bit timeout question
Date: Thu, 23 Apr 2009 09:19:21 +1000	[thread overview]
Message-ID: <21d7e9970904221619v7d7990bfq697cfca64a7ed6d2@mail.gmail.com> (raw)

Hi to any i2c people,

So I've been debugging some EDID fetching failures and wanted to ask
about the use of time_after_eq in the i2c bit banging code.

EDID specification recommends 2ms timeout for the ack on the initial
read, so we set the timeout in our code to usecs_to_jiffies(2200) (10%
margin of error). On my systems this ends up as 1, and we seem to fail
to retrieve EDID one in 10-20 times. Changing the value to 2, always
gets me the EDID I want.

So looking at drivers/i2c/algos/i2c-algo-bit.c it appears it uses
time_after_eq on jiffies, start + timeout value. So if we have a 10ms
jiffie resolution and enter this at the 9ms point in the 10ms window,
we will seem to exit the loop after 1ms instead of the minimum which I
asked for which is 2.2ms. Should this code use time_after instead of
time_after_eq?

or am I missing something else.
Dave.

             reply	other threads:[~2009-04-22 23:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-22 23:19 Dave Airlie [this message]
2009-04-23  6:57 ` i2c algo bit timeout question Jean Delvare
2009-04-23  6:57   ` 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=21d7e9970904221619v7d7990bfq697cfca64a7ed6d2@mail.gmail.com \
    --to=airlied@gmail.com \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.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.