common: sensor: make pre/post hook api are paired#419
Closed
DelphineChiu wants to merge 1 commit into
Closed
Conversation
Summary: Some operation need pre/post hook api are paired, e.g., mutex lock/unlock. Makesure post hook function will be called after sensor reading. Test plan: Build and test pass on fby35 1. Check sensor reading is functional. root@bmc-oob:~# sensor-util --force slot4 slot4: MB Inlet Temp (0x1) : 24.00 C | (ok) MB Outlet Temp (0x2) : 45.00 C | (ok) FIO Temp (0x3) : 22.00 C | (ok) PCH Temp (0x4) : NA | (na) SOC CPU Temp (0x5) : 44.00 C | (ok) SOC Therm Margin (0x14) : -38.00 C | (ok) CPU TjMax (0x15) : 82.00 C | (ok) DIMMA Temp (0x6) : 41.00 C | (ok) DIMMC Temp (0x7) : 39.00 C | (ok) DIMMD Temp (0x9) : 36.00 C | (ok) DIMME Temp (0xA) : 39.00 C | (ok) DIMMG Temp (0xB) : 35.00 C | (ok) DIMMH Temp (0xC) : 31.00 C | (ok) SSD0 Temp (0xD) : 27.00 C | (ok) HSC Temp (0xE) : 39.05 C | (ok) VCCIN SPS Temp (0xF) : 54.00 C | (ok) FIVRA SPS Temp (0x10) : 49.00 C | (ok) EHV SPS Temp (0x11) : 37.00 C | (ok) VCCD SPS Temp (0x12) : 39.00 C | (ok) FAON SPS Temp (0x13) : 44.00 C | (ok) P12V_STBY Vol (0x20) : 11.98 Volts | (ok) P3V_BAT Vol (0x21) : 3.05 Volts | (ok) P3V3_STBY Vol (0x22) : 3.33 Volts | (ok) P1V8_STBY Vol (0x23) : 1.79 Volts | (ok) P1V05_PCH Vol (0x24) : 1.05 Volts | (ok) P5V_STBY Vol (0x25) : 4.94 Volts | (ok) P12V_DIMM Vol (0x26) : 11.92 Volts | (ok) P1V2_STBY Vol (0x27) : 1.19 Volts | (ok) P3V3_M2 Vol (0x28) : 3.32 Volts | (ok) HSC Input Vol (0x29) : 11.87 Volts | (ok) VCCIN VR Vol (0x2A) : 1.77 Volts | (ok) FIVRA VR Vol (0x2C) : 1.80 Volts | (ok) EHV VR Vol (0x2D) : 1.80 Volts | (ok) VCCD VR Vol (0x2E) : 1.14 Volts | (ok) FAON VR Vol (0x2F) : 1.02 Volts | (ok) HSC Output Cur (0x30) : 11.30 Amps | (ok) VCCIN VR Cur (0x31) : 37.70 Amps | (ok) FIVRA VR Cur (0x32) : 4.10 Amps | (ok) EHV VR Cur (0x33) : 1.20 Amps | (ok) VCCD VR Cur (0x34) : 2.50 Amps | (ok) FAON VR Cur (0x35) : 21.30 Amps | (ok) CPU PWR (0x38) : 97.00 Watts | (ok) HSC Input Pwr (0x39) : 133.10 Watts | (ok) VCCIN VR Pout (0x3A) : 65.00 Watts | (ok) FIVRA VR Pout (0x3C) : 6.00 Watts | (ok) EHV VR Pout (0x3D) : 2.00 Watts | (ok) VCCD VR Pout (0x3E) : 3.00 Watts | (ok) FAON VR Pout (0x3F) : 21.00 Watts | (ok) DIMMA PMIC_Pout (0x1E) : NA | (na) DIMMC PMIC_Pout (0x1F) : NA | (na) DIMMD PMIC_Pout (0x36) : NA | (na) DIMME PMIC_Pout (0x37) : NA | (na) DIMMG PMIC_Pout (0x42) : NA | (na) DIMMH PMIC_Pout (0x47) : NA | (na)
Contributor
|
@GoldenBug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
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.
Summary:
Some operation need pre/post hook api are paired, e.g., mutex lock/unlock.
Makesure post hook function will be called after sensor reading.
Test plan:
Build and test pass on fby35
root@bmc-oob:~# sensor-util --force slot4
slot4:
MB Inlet Temp (0x1) : 24.00 C | (ok)
MB Outlet Temp (0x2) : 45.00 C | (ok)
FIO Temp (0x3) : 22.00 C | (ok)
PCH Temp (0x4) : NA | (na)
SOC CPU Temp (0x5) : 44.00 C | (ok)
SOC Therm Margin (0x14) : -38.00 C | (ok)
CPU TjMax (0x15) : 82.00 C | (ok)
DIMMA Temp (0x6) : 41.00 C | (ok)
DIMMC Temp (0x7) : 39.00 C | (ok)
DIMMD Temp (0x9) : 36.00 C | (ok)
DIMME Temp (0xA) : 39.00 C | (ok)
DIMMG Temp (0xB) : 35.00 C | (ok)
DIMMH Temp (0xC) : 31.00 C | (ok)
SSD0 Temp (0xD) : 27.00 C | (ok)
HSC Temp (0xE) : 39.05 C | (ok)
VCCIN SPS Temp (0xF) : 54.00 C | (ok)
FIVRA SPS Temp (0x10) : 49.00 C | (ok)
EHV SPS Temp (0x11) : 37.00 C | (ok)
VCCD SPS Temp (0x12) : 39.00 C | (ok)
FAON SPS Temp (0x13) : 44.00 C | (ok)
P12V_STBY Vol (0x20) : 11.98 Volts | (ok)
P3V_BAT Vol (0x21) : 3.05 Volts | (ok)
P3V3_STBY Vol (0x22) : 3.33 Volts | (ok)
P1V8_STBY Vol (0x23) : 1.79 Volts | (ok)
P1V05_PCH Vol (0x24) : 1.05 Volts | (ok)
P5V_STBY Vol (0x25) : 4.94 Volts | (ok)
P12V_DIMM Vol (0x26) : 11.92 Volts | (ok)
P1V2_STBY Vol (0x27) : 1.19 Volts | (ok)
P3V3_M2 Vol (0x28) : 3.32 Volts | (ok)
HSC Input Vol (0x29) : 11.87 Volts | (ok)
VCCIN VR Vol (0x2A) : 1.77 Volts | (ok)
FIVRA VR Vol (0x2C) : 1.80 Volts | (ok)
EHV VR Vol (0x2D) : 1.80 Volts | (ok)
VCCD VR Vol (0x2E) : 1.14 Volts | (ok)
FAON VR Vol (0x2F) : 1.02 Volts | (ok)
HSC Output Cur (0x30) : 11.30 Amps | (ok)
VCCIN VR Cur (0x31) : 37.70 Amps | (ok)
FIVRA VR Cur (0x32) : 4.10 Amps | (ok)
EHV VR Cur (0x33) : 1.20 Amps | (ok)
VCCD VR Cur (0x34) : 2.50 Amps | (ok)
FAON VR Cur (0x35) : 21.30 Amps | (ok)
CPU PWR (0x38) : 97.00 Watts | (ok)
HSC Input Pwr (0x39) : 133.10 Watts | (ok)
VCCIN VR Pout (0x3A) : 65.00 Watts | (ok)
FIVRA VR Pout (0x3C) : 6.00 Watts | (ok)
EHV VR Pout (0x3D) : 2.00 Watts | (ok)
VCCD VR Pout (0x3E) : 3.00 Watts | (ok)
FAON VR Pout (0x3F) : 21.00 Watts | (ok)
DIMMA PMIC_Pout (0x1E) : NA | (na)
DIMMC PMIC_Pout (0x1F) : NA | (na)
DIMMD PMIC_Pout (0x36) : NA | (na)
DIMME PMIC_Pout (0x37) : NA | (na)
DIMMG PMIC_Pout (0x42) : NA | (na)
DIMMH PMIC_Pout (0x47) : NA | (na)