All of lore.kernel.org
 help / color / mirror / Atom feed
* Hwmon scale timing issue
@ 2020-07-22  9:00 Duke Du (杜祥嘉)
  2020-07-22 20:23 ` Matt Spinler
  0 siblings, 1 reply; 2+ messages in thread
From: Duke Du (杜祥嘉) @ 2020-07-22  9:00 UTC (permalink / raw)
  To: Matt Spinler
  Cc: openbmc, Fran Hsu (徐誌謙),
	George Hung (洪忠敬),
	Eddie Lu (陸宇岡)

[-- Attachment #1: Type: text/plain, Size: 630 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 3230 bytes --]

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

* Re: Hwmon scale timing issue
  2020-07-22  9:00 Hwmon scale timing issue Duke Du (杜祥嘉)
@ 2020-07-22 20:23 ` Matt Spinler
  0 siblings, 0 replies; 2+ messages in thread
From: Matt Spinler @ 2020-07-22 20:23 UTC (permalink / raw)
  To: Duke Du (杜祥嘉)
  Cc: openbmc, Eddie Lu (陸宇岡),
	Fran Hsu (徐誌謙),
	George Hung (洪忠敬)



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
>

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

end of thread, other threads:[~2020-07-22 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-22  9:00 Hwmon scale timing issue Duke Du (杜祥嘉)
2020-07-22 20:23 ` Matt Spinler

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.