All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [lm-sensors] [PATCH] sensord: do not fail if some sensor does not return data
@ 2014-06-09 16:23 Pali Rohár
  0 siblings, 0 replies; 3+ messages in thread
From: Pali Rohár @ 2014-06-09 16:23 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: Text/Plain, Size: 1629 bytes --]

On Saturday 17 May 2014 22:02:12 Pali Rohár wrote:
> Hello,
> 
> I see very annoying bug in sensord. When some hwmon driver
> returns -EINVAL (for any reason), sensord daemon will stop
> reading next sensors values. This means if first hwmon device
> fail to return value, sensord daemon will not log anything.
> 
> Returning -EINVAL from kernel driver is normal (e.g. when
> graphic card with has internal temperature sensor is turned
> off) and sensord should not fail on this.
> 
> Program sensors already handling this problem and will print
> N/A if there is reading error.
> 
> I'm sending simple patch which just report NaN value when
> kernel report error. And also sensord will continue to
> reading next hwmon interfaces.
> 
> Without this patch I see only these lines logged:
> 
> sensord: Chip: radeon-pci-0100
> sensord: Adapter: PCI adapter
> sensord: Error getting sensor data: radeon/#0: Can't read
> sensord: sensor read error (-1)
> 
> And all other sensors are ignored and nothing more is logged.
> 
> After my patch all hwmon sensors data are logged:
> 
> sensord: Chip: radeon-pci-0100
> sensord: Adapter: PCI adapter
> sensord:   temp1: nan C
> sensord: Chip: i8k-virtual-0
> sensord: Adapter: Virtual device
> sensord:   Left Fan: 2685 RPM
> sensord:   CPU: 49.0 C
> sensord:   temp2: 55.0 C
> sensord:   temp3: 39.0 C
> sensord: Chip: coretemp-isa-0000
> sensord: Adapter: ISA adapter
> sensord:   Physical id 0: 50.0 C
> sensord:   Core 0: 47.0 C
> sensord:   Core 1: 50.0 C

BUMP!

Can somebody review my patch?

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [lm-sensors] [PATCH] sensord: do not fail if some sensor does not return data
@ 2014-10-28 14:54 Pali Rohár
  0 siblings, 0 replies; 3+ messages in thread
From: Pali Rohár @ 2014-10-28 14:54 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: Text/Plain, Size: 1796 bytes --]

On Monday 09 June 2014 18:23:31 Pali Rohár wrote:
> On Saturday 17 May 2014 22:02:12 Pali Rohár wrote:
> > Hello,
> > 
> > I see very annoying bug in sensord. When some hwmon driver
> > returns -EINVAL (for any reason), sensord daemon will stop
> > reading next sensors values. This means if first hwmon
> > device fail to return value, sensord daemon will not log
> > anything.
> > 
> > Returning -EINVAL from kernel driver is normal (e.g. when
> > graphic card with has internal temperature sensor is turned
> > off) and sensord should not fail on this.
> > 
> > Program sensors already handling this problem and will print
> > N/A if there is reading error.
> > 
> > I'm sending simple patch which just report NaN value when
> > kernel report error. And also sensord will continue to
> > reading next hwmon interfaces.
> > 
> > Without this patch I see only these lines logged:
> > 
> > sensord: Chip: radeon-pci-0100
> > sensord: Adapter: PCI adapter
> > sensord: Error getting sensor data: radeon/#0: Can't read
> > sensord: sensor read error (-1)
> > 
> > And all other sensors are ignored and nothing more is
> > logged.
> > 
> > After my patch all hwmon sensors data are logged:
> > 
> > sensord: Chip: radeon-pci-0100
> > sensord: Adapter: PCI adapter
> > sensord:   temp1: nan C
> > sensord: Chip: i8k-virtual-0
> > sensord: Adapter: Virtual device
> > sensord:   Left Fan: 2685 RPM
> > sensord:   CPU: 49.0 C
> > sensord:   temp2: 55.0 C
> > sensord:   temp3: 39.0 C
> > sensord: Chip: coretemp-isa-0000
> > sensord: Adapter: ISA adapter
> > sensord:   Physical id 0: 50.0 C
> > sensord:   Core 0: 47.0 C
> > sensord:   Core 1: 50.0 C
> 
> BUMP!
> 
> Can somebody review my patch?

PING.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [lm-sensors] [PATCH] sensord: do not fail if some sensor does not return data
@ 2014-05-17 20:02 Pali Rohár
  0 siblings, 0 replies; 3+ messages in thread
From: Pali Rohár @ 2014-05-17 20:02 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1.1: Type: Text/Plain, Size: 1456 bytes --]

Hello,

I see very annoying bug in sensord. When some hwmon driver 
returns -EINVAL (for any reason), sensord daemon will stop 
reading next sensors values. This means if first hwmon device 
fail to return value, sensord daemon will not log anything.

Returning -EINVAL from kernel driver is normal (e.g. when graphic 
card with has internal temperature sensor is turned off) and 
sensord should not fail on this.

Program sensors already handling this problem and will print N/A 
if there is reading error.

I'm sending simple patch which just report NaN value when kernel 
report error. And also sensord will continue to reading next 
hwmon interfaces.

Without this patch I see only these lines logged:

sensord: Chip: radeon-pci-0100
sensord: Adapter: PCI adapter
sensord: Error getting sensor data: radeon/#0: Can't read
sensord: sensor read error (-1)

And all other sensors are ignored and nothing more is logged.

After my patch all hwmon sensors data are logged:

sensord: Chip: radeon-pci-0100
sensord: Adapter: PCI adapter
sensord:   temp1: nan C
sensord: Chip: i8k-virtual-0
sensord: Adapter: Virtual device
sensord:   Left Fan: 2685 RPM
sensord:   CPU: 49.0 C
sensord:   temp2: 55.0 C
sensord:   temp3: 39.0 C
sensord: Chip: coretemp-isa-0000
sensord: Adapter: ISA adapter
sensord:   Physical id 0: 50.0 C
sensord:   Core 0: 47.0 C
sensord:   Core 1: 50.0 C

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #1.1.2: sensord_nan.patch --]
[-- Type: text/x-patch, Size: 768 bytes --]

--- lm-sensors-3.3.1/prog/sensord/sense.c.orig	2014-05-17 21:14:21.000000000 +0200
+++ lm-sensors-3.3.1/prog/sensord/sense.c	2014-05-17 21:45:27.677299361 +0200
@@ -93,11 +93,14 @@ static int get_features(const sensors_ch
 		ret = sensors_get_value(chip, feature->dataNumbers[i],
 					val + i);
 		if (ret) {
+#if 0
 			sensorLog(LOG_ERR,
 				  "Error getting sensor data: %s/#%d: %s",
 				  chip->prefix, feature->dataNumbers[i],
 				  sensors_strerror(ret));
 			return -1;
+#endif
+			val[i] = nan("");
 		}
 	}
 
@@ -168,8 +171,10 @@ static int doKnownChip(const sensors_chi
 
 	for (i = 0; features[i].format; i++) {
 		ret = do_features(chip, features + i, action);
+#if 0
 		if (ret == -1)
 			break;
+#endif
 	}
 
 	return ret;

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-28 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-09 16:23 [lm-sensors] [PATCH] sensord: do not fail if some sensor does not return data Pali Rohár
  -- strict thread matches above, loose matches on Subject: below --
2014-10-28 14:54 Pali Rohár
2014-05-17 20:02 Pali Rohár

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.