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] Added sysfs support for decode-dimms.pl
Date: Thu, 16 Jun 2005 11:04:12 +0000	[thread overview]
Message-ID: <dp3KEJQm.1118911965.8288000.khali@localhost> (raw)
In-Reply-To: <000201c571f9$ac2fb410$4d01a8c0@BURKART>


Hallo Burkart,

On 2005-06-15, Burkart Lingner:
> I needed to take a closer look at my RAM's SPD-EEPROMs today. Too bad
> the sysfs of Kernel 2.6 wasn't supported by decode-dimms.pl, so I had
> to add support for that myself. Since there probably are more people
> out there who'd like to use this tool on a Kernel 2.6 system, it might
> be a good idea to include the patched file in the next release of
> lm_sensors.

Yes, definitely.

> The new version can be found at http://www.bollchen.de/decode-dimms.pl.
> Of course the "ADDED" comments should be removed then, I just left them
> in for now and I can strip them later on demand. The new version does
> work with Kernel 2.6 and it should as well work with older Kernels and
> their proc-fs. Since I only have a system running 2.6, could anyone
> with an older Kernel please do a test run? That would be greatly
> appreciated, to make sure I didn't mess anything up.

I just took a look at your script. It's not bad but I would like the
sysfs support to be added in a cleaner manner if possible. Rather than
having a if(sysfs) test on each read, we could have a single function
returning the wanted bytes, and all the checks would be in there. The
advantage is that it would avoid code duplication, would make the code
easier to read, and would allow for yet others access methods to be
added more easily in the future (e.g. reading from a dump file). Could
you try to modify your script to do that? You're probably not that far.
You may check how I did this in decode-vaio.pl, although you should be
able to do something more simple.

Other comments on the code itself:

1* Your sysfs version doesn't print the guessed bank number anymore?

2* Your sysfs version reads the whole EEPROM contents while only the
lower half is used. This will make the script twice as slow, so it
should be avoided if possible. Maybe the read method I implemented in
decode-vaio.pl may help (or use head -c, but I'm not sure it's
portable).

So it would be great if you could work on this. If you come up with a new
version, I'll test it on my systems (both 2.4 and 2.6 kernels).

Last point, when submitting changes, the best method is to provide the
output of diff -u between the original and modified file. This is way
easier than looking at "ADDED" and "MODIFIED" tags, and can be
applied to CVS directly.

Thanks,
--
Jean Delvare

  parent reply	other threads:[~2005-06-16 11:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-16  0:28 [lm-sensors] Added sysfs support for decode-dimms.pl Burkart Lingner
2005-06-16  2:15 ` Grant Coady
2005-06-16  9:10 ` Per Jessen
2005-06-16 10:39 ` Jean Delvare
2005-06-16 11:04 ` Jean Delvare [this message]
2005-06-16 16:07 ` Burkart Lingner
2005-06-20 17:05 ` Burkart Lingner
2005-06-20 22:50 ` Jean Delvare
2005-07-15 19:35 ` 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=dp3KEJQm.1118911965.8288000.khali@localhost \
    --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.