openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Negative value returns for sensor in tiogapass
@ 2021-02-26  8:55 Jayashree D
  2021-02-26 16:26 ` Ed Tanous
  0 siblings, 1 reply; 13+ messages in thread
From: Jayashree D @ 2021-02-26  8:55 UTC (permalink / raw)
  To: openbmc

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

Classification: Public
Hi Team,

Recently, I have tested sensors for tiogapass, in which one sensor returns negative value.
After analysing the code in the dbus-sensors repo, I found the following issue.

dbus-sensors/IpmbSensor.cpp at master * openbmc/dbus-sensors (github.com)<https://github.com/openbmc/dbus-sensors/blob/master/src/IpmbSensor.cpp#L267>

From the above link, We need only below line in the code to process the HSC sensors value for tiogapass.

int16_t value = ((data[4] << 8) | data[3]);

Since the below logic is added, the values get shifted and getting negative values as output.

constexpr const size_t shift = 16 - 11; // 11bit into 16bit
value <<= shift;
value >>= shift;

Could you please suggest any idea to resolve this issue.

Regards,
Jayashree

::DISCLAIMER::
________________________________
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
________________________________

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

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

end of thread, other threads:[~2021-03-19 12:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26  8:55 Negative value returns for sensor in tiogapass Jayashree D
2021-02-26 16:26 ` Ed Tanous
2021-03-02  6:16   ` Jayashree D
2021-03-08  6:16   ` Jayashree D
2021-03-08 16:07     ` Ed Tanous
2021-03-09 11:18       ` Jayashree D
2021-03-17  7:38         ` Jayashree D
2021-03-17 18:18           ` Ren, Zhikui
2021-03-18 13:01             ` Jayashree D
2021-03-18 16:10             ` Ed Tanous
2021-03-18 17:26               ` Ren, Zhikui
2021-03-18 17:31                 ` Ed Tanous
2021-03-19 12:31                   ` Jayashree D

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).