Hwmon scale timing issue

Matt Spinler mspinler at linux.ibm.com
Thu Jul 23 06:23:39 AEST 2020



On 7/22/2020 4:00 AM, Duke Du (杜祥嘉) wrote:
>
> 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
>

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.

> Thanks
>
> Duke
>



More information about the openbmc mailing list