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] sensord exits on any error
Date: Fri, 05 Dec 2008 20:27:41 +0000	[thread overview]
Message-ID: <20081205212741.6cf7ea3a@hyperion.delvare> (raw)
In-Reply-To: <alpine.DEB.2.00.0812051215080.9967@andydesk.realbig.com>

Hi Andy,

On Fri, 5 Dec 2008 12:34:47 -0600 (CST), Andy Poling wrote:
> We are using lm-sensors in an embedded system, and have noticed that when
> errors occur, sensord exits.

This is an known issue, tracked as ticket #2330:
http://www.lm-sensors.org/ticket/2330

> We occasionally encounter SMBus collisions which cause transient errors on
> SMBus reads by the sensor chip driver.

Multi-master bus?

> We modified the most recent w83793 driver (which is much improved in dealing
> with SMBus issues) to return cached data for up to 30 seconds in the case of
> SMBus errors, and then to return EAGAIN on the sysfs file read if the SMBus
> errors persist.
> 
> However sensord exits when it gets EAGAIN.  We have patched sensord not to
> exit on errors, but instead to log them and continue.  This seems to us to be
> the robust behavior for an important system monitoring daemon - if the error
> is transient it rides it out, and if it is permanent it complains to get
> attention.  It's about a 2-line change in the main loop of sensord.
> 
> I'd like to push these patches upstream, but wanted to first see if it is
> acceptable to change the behavior of the w83793 driver and sensord in this
> way.

Your changes to the w83793d drivers are IMHO not acceptable. It is up
to user-space to decide what to do when a sensor value can't be read.
Silently caching the values for an arbitrary period of 30 seconds isn't
nice. Returning errors immediately, OTOH would probably be better than
returning 0 as the driver does at the moment. Whether the error value
should be -EAGAIN or -EIO can be discussed. This is however a
non-trivial change due to the 2-second caching strategy that the driver
implements. But you probably already know that if you modified the
driver for your own use already. An easier approach would be to simply
retry on read failures, as I suspect the second read attempt would
almost always succeed.

Your fix to sensord is totally welcome. I could never find the time to
work on ticket #2330, so if you have a working patch I will be very
happy to review and apply it.

Thanks,
-- 
Jean Delvare

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

  reply	other threads:[~2008-12-05 20:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-05 18:34 [lm-sensors] sensord exits on any error Andy Poling
2008-12-05 20:27 ` Jean Delvare [this message]
2008-12-06  0:34 ` Andy Poling
2008-12-06  8:48 ` Jean Delvare
2008-12-12  8:01 ` Jean Delvare
2008-12-12 21:45 ` Andy Poling
2008-12-14 15:44 ` Jean Delvare
2008-12-16  9:05 ` Andy Poling
2008-12-16  9:29 ` 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=20081205212741.6cf7ea3a@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.