All of lore.kernel.org
 help / color / mirror / Atom feed
From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] How can I skip i2c detection?
Date: Thu, 09 Jun 2005 18:52:16 +0000	[thread overview]
Message-ID: <20050609185116.18f1e7fb.khali@linux-fr.org> (raw)
In-Reply-To: <F06EB2894F3F0D45AD9BEA7246DE9C90854F15@WCSEXCMBS1.ad.wabtec.com>

Hi Ben,

> I have a custom motherboard with four i2c devices on it.
>  - lm83 @ 0x4c

Let me know if you have problems with this one. There aren't many LM83s
out there, so it might not have been fully tested.

>  - max6875 @ 0x50
>  - pca9539 @ 0x74
>  - ds2484 @ 0x18
> 
> Right now it takes 15.5 seconds to load those four modules.
> I see the "i2c-adapter i2c-0: timeout is state write" kernel message
> ten times.
> When I build those modules with only the correct addresses, the load
> time is 5.5 seconds.

scx200_acb bus driver? Even 5.5 seconds is more than I would accept. I
suspect that you still have a 4 timeouts on the second i2c adapter (one
per address you kept).

> So, it takes 10 seconds to probe addresses that don't exist.
> 
> I'd like to speed up the module loading without modifying the source.
> 
> Is there a way to tell an i2c module to load only for a specific
> address?
> I looked at the i2c_detect() function and did not see a way, but
> perhaps I just missed it.

You can't remove the default address list altogether. However, there is
a way to ignore addresses. Try for example:

modprobe lm83 ignore=0,0x18,0,0x19,0,0x1a,0,0x29,0,0x2a,0,0x2b,0,0x4d,0,0x4e

Not exactly convenient to type (/etc/modprobe.conf will help), but it
should work. And you should do the same with all addresses on bus 1,
else you'll have timeout on this one too.

The other way would be to lower the timeout in the scx200_acb. It is
currently set to 1 second:

#define POLL_TIMEOUT (HZ)

Changing this to say HZ/10 would be more reasonable.

Also, in scx200_acb_poll(), polling is done first, then msleep(10), then
retry if needed. I would do some stats on the number of cycles actually
required to retrieve a value. If it happens to be one cycle most of the
time (which I suspect), performance could probably be improved by
lowering the msleep value and possibly swapping the test and the msleep.
SMBus drivers which use polling (i2c-i801, i2c-viapro) do msleep(1)
first, and poll the value after that.

-- 
Jean Delvare

  reply	other threads:[~2005-06-09 18:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-09 17:52 [lm-sensors] How can I skip i2c detection? BGardner
2005-06-09 18:52 ` Jean Delvare [this message]
2005-06-09 22:04 ` BGardner
2005-06-09 22:27 ` Jean Delvare
2005-06-09 22:55 ` BGardner
2005-06-09 23:08 ` Jean Delvare
2005-06-09 23:47 ` BGardner
2005-06-10  9:22 ` Jean Delvare
2005-06-10 16:55 ` BGardner
2005-06-10 20:43 ` Jean Delvare
2005-06-10 21:49 ` BGardner
2005-06-12  9:15 ` 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=20050609185116.18f1e7fb.khali@linux-fr.org \
    --to=khali@linux-fr.org \
    --cc=lm-sensors@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.