From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] lm-sensors 3.0.0-rc1 has been released!
Date: Sat, 29 Sep 2007 13:39:19 +0000 [thread overview]
Message-ID: <20070929153919.0f522233@hyperion.delvare> (raw)
In-Reply-To: <20070925233316.7afaa297@hyperion.delvare>
On Fri, 28 Sep 2007 17:13:35 -0300, Henrique de Moraes Holschuh wrote:
> I am assuming that any distro that is going to change stuff for lm-sensors
> 3.0.0 ahead of upstream will also ship with lm-sensors 3.0.0 (so userland
> support will be there), and a new enough kernel in their next stable
> release. If I am wrong, then yes, one should not remove old
> ibm-acpi/thinkpad-acpi procfs support.
Your assumptions are about right, however the added support for
lm-sensors 3.0.0 will be sent upstream quickly, while a patch removing
support for the old interface can't be sent upstream, so distributions
would have to maintain it forever. My experience is that
distributions avoid that kind of patch and extra work as much as
possible, especially when this doesn't add significant value (the extra
code is simply unused).
> > libsensors4 returns -SENSORS_ERR_KERNEL ("Kernel interface error")
> > if it can't read a value from a sysfs attribute file.
> > -SENSORS_ERR_ACCESS_R ("Can't read") would probably be preferable. It
> > doesn't read the actual error value returned by the underlying driver,
> > so all errors are handled the same way. The application could probably
> > check the value of errno to find out, but this is not documented, and
> > mixing proprietary error codes with standard ones could be confusing.
> >
> > Do you think that we should allocate new proprietary error codes for
> > specific errors returned by the drivers on failed reads?
>
> I think we should differentiate ENXIO (sensor is not there right now) from
> EIO (real IO error).
ENXIO should probably not be returned in the first place. Missing,
disabled or otherwise non-working sensors are reported through
fooN_fault files. When a fault is reported, user-space doesn't make use
of the (invalid or missing) input sensor value.
> We can tack missing sysfs attributes along with ENXIO
> as they are about the same thing, I think.
What "missing sysfs attributes"? libsensors gets the list of attributes
from sysfs, it doesn't expect any file (except "name") to be there. So,
unless files disappear afterwards, attributes can't be missing.
> I don't know about what should
> be done on EBUSY and EINTR/EAGAIN. Probably the lib should retry by itself
> on EINTR/EAGAIN (if it doesn't do it already -- I didn't read the code), and
> just return an error on EBUSY.
No, libsensors doesn't retry on EBUSY and EINTR/EAGAIN (as I said it
ignores the returned error code at the moment), and I don't think it
should. For how long would it wait? How many times would it retry
before giving up? If we are going to hard-code a policy in libsensors,
giving applications no control, then we might as well let the drivers
handle the retries by themselves, at least they know how much they
should wait between retries and when to give up depending on the
hardware (some drivers do that already, e.g. w83l785ts.)
Most monitoring applications are repeatedly polling the sensor values
every few seconds anyway, so if one measurement is missing, it will
probably be back on the next cycle. In other words, the retry mechanism
is already in place there, at the application level. Reimplementing it
in libsensors sounds wrong to me.
> > Rejected writes are silently ignored. Not good. We should detect these
> > and return some error code. I'll commit a fix for that.
>
> Yeah, we definately need to know in userspace if a write fails, and often we
> need to know why, too. I can think of at least three classes of errors to
> differentiate for userland: "not there (file not found and ENXIO)", IO
> errors, and "permission denied" errors. EINTR/EAGAIN should be handled by
> the lib itself, I think.
I've committed my fix now. Permission denied is notified by
-SENSORS_ERR_KERNEL, other errors (including invalid value and I/O
error) are notified by -SENSORS_ERR_ACCESS_W. File not there is
unlikely (as explained above) and would be handled as a permission
problem.
So, from the above, it seems that what we both agree on is that a
separate error value for I/O errors would be needed. I'll work up a
patch implementing this.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2007-09-29 13:39 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-25 21:33 [lm-sensors] lm-sensors 3.0.0-rc1 has been released! Jean Delvare
2007-09-25 21:45 ` Philip Edelbrock
2007-09-26 21:02 ` Hans de Goede
2007-09-27 14:35 ` Jean Delvare
2007-09-27 14:42 ` Jean Delvare
2007-09-27 17:53 ` Henrique de Moraes Holschuh
2007-09-28 17:07 ` Jean Delvare
2007-09-28 20:13 ` Henrique de Moraes Holschuh
2007-09-29 13:39 ` Jean Delvare [this message]
2007-09-30 0:56 ` Henrique de Moraes Holschuh
2007-09-30 11:54 ` Jean Delvare
2007-09-30 12:10 ` Jean Delvare
2007-09-30 14:54 ` Henrique de Moraes Holschuh
2007-10-03 10:36 ` Jean Delvare
2007-10-03 11:38 ` Henrique de Moraes Holschuh
2007-10-04 9:45 ` Jean Delvare
2007-10-04 12:49 ` Henrique de Moraes Holschuh
2007-10-04 13:42 ` Jean Delvare
2007-10-07 11:21 ` Axel Thimm
2007-10-17 21:44 ` Jean Delvare
2007-10-18 7:17 ` Hans de Goede
2007-10-18 8:18 ` Aurelien Jarno
2007-10-19 14:46 ` Jean Delvare
2007-10-19 20:18 ` Hans de Goede
2007-10-20 18:13 ` Jean Delvare
2007-10-20 22:41 ` Hans de Goede
2007-10-21 19:08 ` Jean Delvare
2007-10-21 19:13 ` Hans de Goede
2007-10-21 21:12 ` Jean Delvare
2007-10-22 7:06 ` Hans de Goede
2007-10-22 7:48 ` Jean Delvare
2007-10-22 8:13 ` Hans de Goede
2007-10-22 8:23 ` Jean Delvare
2007-10-22 9:40 ` Hans de Goede
2007-10-22 11:55 ` Jean Delvare
2007-10-22 13:15 ` Hans de Goede
2007-10-22 13:55 ` Jean Delvare
2007-10-22 19:27 ` Hans de Goede
2007-10-22 22:25 ` Aurelien Jarno
2007-10-24 15:30 ` Jean Delvare
2007-10-24 17:09 ` Hans de Goede
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=20070929153919.0f522233@hyperion.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.