sensor: fix lower-critical threshold status mask#55
Merged
datdenkikniet merged 1 commit intoJul 10, 2026
Merged
Conversation
The Get Sensor Reading threshold-status decoder tested lower critical with 0x20. That is bit 5, so lower critical incorrectly mirrored upper non-recoverable: an isolated lower-critical status (0x02) was missed, while an upper-non-recoverable status (0x20) produced a false lower-critical result. IPMI v2.0 specification reference: - Section 35.14, Get Sensor Reading Command - Table 35-15 - Printed page 468 (PDF page 494) - Response data byte 4, “Present threshold comparison status” The specification defines: [5] upper non-recoverable [4] upper critical [3] upper non-critical [2] lower non-recoverable [1] lower critical [0] lower non-critical Therefore: lower_critical = (status & 0x02) != 0; The previous ipmi-rs implementation used 0x20 in ipmi-rs-core/src/sensor_event/sensor_reading/mod.rs, which is bit 5: upper non-recoverable. Use the correct 0x02 mask and add a regression test proving that bits 1 and 5 independently set lower-critical and upper-non-recoverable status.
datdenkikniet
force-pushed
the
fix/lower-critical-threshold-mask
branch
from
July 10, 2026 19:21
ccd950a to
feb5c2d
Compare
datdenkikniet
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Get Sensor Reading threshold-status decoder tested lower critical with 0x20. That is bit 5, so lower critical incorrectly mirrored upper non-recoverable: an isolated lower-critical status (0x02) was missed, while an upper-non-recoverable status (0x20) produced a false lower-critical result.
IPMI v2.0 specification reference:
For threshold-based sensors Present threshold comparison statusThe specification defines:
[7:6 reserved]
[5] upper non-recoverable
[4] upper critical
[3] upper non-critical
[2] lower non-recoverable
[1] lower critical
[0] lower non-critical
Therefore:
lower_critical = (status & 0x02) != 0;
ipmi-rs implementation used 0x20 in ipmi-rs-core/src/sensor_event/sensor_reading/mod.rs, which is bit 5: upper non-recoverable, so it need minor fix.
Use the correct 0x02 mask and add a regression test proving that bits 1 and 5 independently set lower-critical and upper-non-recoverable status.