| commit | 19c962b8d2f324408250229053eb4d7abacc4865 | [log] [tgz] |
|---|---|---|
| author | YouPengWu <twpeng50606@gmail.com> | Fri Oct 17 19:00:18 2025 +0800 |
| committer | George Liu <liuxiwei@ieisystem.com> | Fri Oct 31 00:35:01 2025 +0000 |
| tree | c87a8092edbac61bf0e4b3e90e9c3227705b69a6 | |
| parent | 11c569208ed4a584aecc9330635f7dccda03cb0e [diff] |
sensorhandler: Fix Get Sensor Reading threshold bit mapping
IPMI v2.0 (Spec rev 1.1), Table 35 "Get Sensor Reading" defines the
Present threshold comparison status byte as:
[7:6] = 1b (reserved, must read as 1)
[5] = >= Upper Non-Recoverable (UNR)
[4] = >= Upper Critical (UC)
[3] = >= Upper Non-Critical (UNC)
[2] = <= Lower Non-Recoverable (LNR)
[1] = <= Lower Critical (LC)
[0] = <= Lower Non-Critical (LNC)
Previous implementation packed UC/UNC/LC/LNC into bits [3:0] and left
[7:6] unset. This is out of spec and causes the IPMI raw Get Sensor
Reading response to return an incorrect threshold status byte, leading
to misinterpretation by clients.
This change:
* Sets bits [7:6] to 1 as required by the spec.
* Maps UC/UNC/LC/LNC to bits [4]/[3]/[1]/[0], respectively.
* Leaves UNR/LNR ([5]/[2]) as 0 for now (unused in OpenBMC).
Impact: fixes the byte returned by IPMI raw Get Sensor Reading and
makes threshold status reporting spec compliant. No D-Bus or API change.
Testing:
- bitbake phosphor-host-ipmid builds successfully
- on target, ipmitool raw 0x04 0x2d <sensor#> and ipmitool sensor get
show [7:6] = 11b and expected UC, UNC, LC, LNC bit positions
Change-Id: I0a0b07e8fe82357d39329054fed7966bb67f6f91
Signed-off-by: You Peng Wu <twpeng50606@gmail.com>
meson builddir ninja -C builddir
meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled ninja -C builddir
If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in ipmid/subprojects.
meson builddir -Dwrap_mode=nofallback ninja -C builddir
meson builddir -Dbuildtype=debug ninja -C builddir
meson builddir -Db_coverage=true -Dtests=enabled ninja -C builddir test ninja -C builddir coverage