Hwmon scale timing issue
Hi Matt,
Thanks for solving sensor type issue, but I found another issue, the scale would not apply when
hwmon updated value in first time. For example, my battery 3.051 voltage would record 3051 on dbus instead of 3.051 until hwmon update again. I think this is scale timing issue for hwmon update value in first time. Some sensors interval configuration is so long such as one day that would lead to record wrong value for a long time.
I am not sure this line would lead to hwmon update value with incorrect scale in first time.
https://github.com/openbmc/phosphor-hwmon/blob/master/sensor.cpp#L170
Thanks
Duke
Quoted 9 lines · Duke Du (杜祥嘉)
Hi Matt,
Thanks for solving sensor type issue, but I found another issue, the scale would not apply when
hwmon updated value in first time. For example, my battery 3.051 voltage would record 3051 on dbus
instead of 3.051 until hwmon update again. I think this is scale timing issue for hwmon update value
Quoted 8 lines
in first time. Some sensors interval configuration is so long such as one day that would lead to
record wrong value for a long time.
I am not sure this line would lead to hwmon update value with incorrect scale in first time.
https://github.com/openbmc/phosphor-hwmon/blob/master/sensor.cpp#L170
Hi, nice catch! The bug was that the adjustValue() call that was supposed to apply the scale was running before the _scale variable was set.
I put up a fix at https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-hwmon/+/34983.
Quoted 4 lines
Thanks
Duke