linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: 回复: Re: [PATCH v1] hwmon: (scpi-hwmon) shows the negative temperature properly
       [not found] <v3besyi6n3-v3coqrx8gw@nsmail6.0>
@ 2021-05-24 14:03 ` Guenter Roeck
  0 siblings, 0 replies; only message in thread
From: Guenter Roeck @ 2021-05-24 14:03 UTC (permalink / raw)
  To: 卢日文, jdelvare; +Cc: linux-hwmon, linux-kernel, Xin Chen

On 5/23/21 6:48 PM, 卢日文 wrote:
>  > What did you test ? Did you really manage to run the system
>  > in such an environment ?
> 
>  > 'value' is declared as u64, not as s64.
>  > I can not evaluate what the firmware actually reports. The API
>  > reports an u64. Do you have any evidence for your claim that
>  > it returns a signed value under any circumstances ?
> 
> 
> Yes, the comsumer of my company test their machines in harsh environment including the very low temperature.
> 
I tried to look this up, but the ARM developer documentation is vague when
it comes to describing the content of sensor readings. Is it documented
somewhere that the temperature is actually returned as signed value ?
If so, can you point me to it ?

I'll need to have some confirmation that this is legitimate.

> The first picture below shows that the temp returned as a unsigned value when it is a negtive value with sensors tool.
> 
> And the second picture shows the real value after applyed my changes in scpi hwmon.
> 
> 1234.jpg
> 
> 2345.jpg
> 
Pictures are not attached.

> 
>  > On top of that, your change affects not only temperature values,
>  > but all attributes. It is highly unlikely that the firmware would
>  > report negative power or energy values. It is, however, possible
>  > that energy values have the upper bit of an u64 set after a
>  > long runtime. Your change would result in a negative energy value
>  > if that is ever the case.
> 
> 
> Sorry for not considered this situation before.
> 
> But I think it can be judged by sensor->info.class. if it is TEMPERATURE situation, return the value as a signed value,  otherwise it returned as a unsigned value.
> 
Correct.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-24 14:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <v3besyi6n3-v3coqrx8gw@nsmail6.0>
2021-05-24 14:03 ` 回复: Re: [PATCH v1] hwmon: (scpi-hwmon) shows the negative temperature properly Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).