All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH 4/5] hwmon: (lm75) Tune resolution and sample time per chip
Date: Wed, 13 Mar 2013 11:15:16 +0000	[thread overview]
Message-ID: <20130313121516.294df50d@endymion.delvare> (raw)
In-Reply-To: <20130312155108.054dd75e@endymion.delvare>

Hi Guenter,

On Tue, 12 Mar 2013 10:26:51 -0700, Guenter Roeck wrote:
> On Tue, Mar 12, 2013 at 05:34:11PM +0100, Jean Delvare wrote:
> > Indeed. The LM90 case is a little different though, as the update rate
> > has an effect primarily on power consumption, and for extreme values on
> > accuracy if I remember correctly (due to less/no averaging.) While in
> > the LM75 case it has no effect on power consumption but on resolution.
>
> There are always multiple dimensions. Sample time, resolution, accuracy,
> and power consumption all interact with each other. I have been using
> update_interval so far to report/configure it all. "resolution" (or possibly
> tempX_resolution) was suggested as possible additional sysfs attribute
> at some point.
> 
> > Are you suggesting that I should rename lm75_data.sample_time to
> > update_interval, and change it from jiffies to ms, for consistency?
>
> Would be a start.

I slept over it and I don't think I'll do that change. lm90's
update_interval refers to how frequently the chip starts a new
measurement. The chips supported by this driver don't do continuous
sampling, they sleep between measurements. The conversion time is
constant.

lm75's sample_time is for how long the driver can cache the values. I
ensured that it was always larger than the maximum possible conversion
time, but for some of the supported chips this maximum is a lot more
than the typical conversion time. LM75-like chips do continuous
sampling, and we don't know the exact conversion time, so we simply
don't know the update_interval value. All we can do is estimate its
maximum.

So it's not as simple as renaming a variable, changing its unit and
exporting it to sysfs. Some more thinking and care is required, which I
have no time for ATM.

> > That I should add a read-only update_interval to report the update
> > interval to user-space?
> > 
> > That I should make the update_interval attribute writable and change
> > the resolution on the fly accordingly, on a per-chip basis? This
> > would be non-trivial, as each chip have their own conversion times for
> > each supported resolution.
>
> Actually that was the idea, though I did not think about complexity.
> If it is too complex it might not be worth the effort.

For me it's not worth it. I think my patches already represent a
significant improvement to the lm75 driver, it will make readings
faster and more accurate out of the box. I don't want to spend more
time on this, I'd rather spend time reviewing pending patches ;)

Of course if someone else steps up later to work on this, I have no
objection.

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  parent reply	other threads:[~2013-03-13 11:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12 14:51 [lm-sensors] [PATCH 4/5] hwmon: (lm75) Tune resolution and sample time per chip Jean Delvare
2013-03-12 15:55 ` Guenter Roeck
2013-03-12 16:34 ` Jean Delvare
2013-03-12 17:26 ` Guenter Roeck
2013-03-13 11:15 ` Jean Delvare [this message]
2013-03-13 21:50 ` Guenter Roeck
2013-03-13 21:56 ` Jean Delvare
2013-03-13 23:16 ` Guenter Roeck
2013-03-14  7:28 ` Jean Delvare
2013-03-14 15:16 ` Guenter Roeck
2013-03-14 15:22 ` Jean Delvare
2013-03-14 16:00 ` Guenter Roeck

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=20130313121516.294df50d@endymion.delvare \
    --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.