Proposal: configurable per-sensor error behavior in phosphor-hwmon

Kun Yi kunyi at
Sat Jul 13 08:27:19 AEST 2019

Hi there,

Current phosphor-hwmon code is filled with preprocessor macros to branch
error condition for sysfs reads, and it seems to me that adding a
per-sensor configuration would solve two issues at least:
1. code can be greatly simplified
2. we can code more flexible sensor reading behavior

Why 2) is needed: with many types of sensors that BMC controls, having an
one-size-fits-all policy will always have cases that it can't handle. Each
flaky sensor is flaky in its own way.

Rough proposal on how this will work:

add properties to each sensor group's configuration file:

"error behavior": can be one of
- always keep
- remove from D-Bus on error

"error condition":  can be combination of
- certain sysfs return codes
- timeout
- invalid value

"error retries": number of retries before declaring the sensor has an error

Happy to hear any feedback.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the openbmc mailing list