All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH 4/5] hwmon: (lm75) Tune resolution and sample time per chip
Date: Tue, 12 Mar 2013 17:26:51 +0000	[thread overview]
Message-ID: <20130312172651.GG30269@roeck-us.net> (raw)
In-Reply-To: <20130312155108.054dd75e@endymion.delvare>

On Tue, Mar 12, 2013 at 05:34:11PM +0100, Jean Delvare wrote:
> On Tue, 12 Mar 2013 08:55:16 -0700, Guenter Roeck wrote:
> > On Tue, Mar 12, 2013 at 03:51:08PM +0100, Jean Delvare wrote:
> > > Most LM75-compatible chips can either sample much faster or with a
> > > much better resolution than the original LM75 chip. So far the lm75
> > > driver did not let the user take benefit of these improvements. Do it
> > > now.
> > > 
> > > I decided to almost always configure the chip to use the best
> > > resolution possible, which also means the longest sample time. The
> > > only chips for which I didn't are the DS75, DS1775 and STDS75, because
> > > they are really too slow in 12-bit mode (1.2 to 1.5 second worst case)
> > > so I went for 11-bit mode as a more reasonable tradeoff. This choice is
> > > dictated by the fact that the hwmon subsystem is meant for system
> > > monitoring, it has never been supposed to be ultra-fast, and as a
> > > matter of fact we do cache the sampled values in almost all drivers.
> > > 
> > > If anyone isn't pleased with these default settings, they can always
> > > introduce a platform data structure or DT support for the lm75. That
> > > being said, it seems nobody ever complained that the driver wouldn't
> > > refresh the value faster than every 1.5 second, and the change made
> > > it faster for all chips even in 12-bit mode, so I don't expect any
> > > complaint.
> > > 
> > I have been using update-interval to make it configurable.
> > Good example is the LM90 driver.
> 
> 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.
> 
Hi Jean,

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.

> 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.

Thanks,
Guenter

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

  parent reply	other threads:[~2013-03-12 17:26 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 [this message]
2013-03-13 11:15 ` Jean Delvare
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=20130312172651.GG30269@roeck-us.net \
    --to=linux@roeck-us.net \
    --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.