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] [patches pc87360]  printk-format, magic-init
Date: Fri, 22 Jul 2005 21:20:36 +0000	[thread overview]
Message-ID: <20050722212020.7a87774e.khali@linux-fr.org> (raw)

Hi Jim,

> 1st is self-explanatory.

And obviously correct, but it happens that I already have a patch
pending solving 5 more of this type of error in 4 different drivers:

http://khali.linux-fr.org/devel/i2c/linux-2.6/linux-2.6.13-rc3-i2c-missing-space-in-split-strings.diff

Note that since 2.6.13-rc3, hardware monitoring drivers are in
drivers/hwmon and no more in drivers/i2c/chips. Thus I'd invite you to
send any future patch at least based on 2.6.13-rc3.

> 2nd adds some missing parts of the magic init sequence.

The missing part is thiner than you seem to think, and is additionally
missing on purpose. You seem to have missed the fact that:

  pc87360_write_value(data, LD_TEMP, 0xF, 0xA, 0x08);

actually writes *two* bytes, one at 0x9 and one at 0xA. And the 0x00
write to 0x08 I voluntarily omitted, because it would force the chip to
use an internal vref, while the system manufacturer may provide an
external one instead. Instead, my code carefully forces *only* bit 0 to
0 so as to start monitoring if needs be.

Of course, if anyone ever proves that restoring the missing write helps
in any way, I'll reconsider.

> Incidentally, the reason I got into this that,
> despite the fact that Ive got an 'ignore fan2' in my config,
> Im getting this error:
> 
>     prog/sensors/chips.c:    printf("ERROR: Can't get FAN2 data!\n");

Fixed in CVS:

revision 1.158
date: 2005/04/22 18:08:06;  author: khali;  state: Exp;  lines: +1 -2
(Khali) No error on missing pc87360 fan2, as this can happen with the
Linux 2.6 version of the driver. Reported by Christian Schwamborn.

The fix is in the "sensors" program, file chips.c.

> fwiw, my soekris board has no fans, so I think the module-code
> detects that lack via extra_isa, and sets fannr = 0, so never creates
> the sysfs files.  The lib code apparently doesnt handle a missing
> sysfs node well.

Yes, your analysis is correct. libsensors was written for the old procfs
interface which always created files even when the features were
missing, and was hacked later for sysfs, just enough to make it work for
most cases. We know that not all corner cases are handled, we currently
hack the "sensors" program to hide most errors, until the library is
rewritten from scratch with the sysfs interface in mind.

-- 
Jean Delvare

             reply	other threads:[~2005-07-22 21:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-22 21:20 Jean Delvare [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-07-22 15:41 [lm-sensors] [patches pc87360] printk-format, magic-init Jim Cromie
2005-07-22 15:58 ` Jim Cromie

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=20050722212020.7a87774e.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.