Skip to content

Commit

Permalink
hw-mgmt: scripts: Fix module reading for independent mode
Browse files Browse the repository at this point in the history
Ignore module temperature reading if it configured to independent mode
(SW reading)
Check /sys/module/sx_core/asic{}/module{}/mode  value

Software control - 1
Firmware control - 0

Bug: 4201043

Signed-off-by: Oleksandr Shamray <[email protected]>
  • Loading branch information
sholeksandr committed Dec 22, 2024
1 parent a915602 commit 8919f44
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions usr/usr/bin/hw_management_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@
]
}

class CONST(object):
# inde1pendent mode - module reading temperature via SDK sysfs
SDK_FW_CONTROL = 0
# inde1pendent mode - module reading temperature via EEPROM
SDK_SW_CONTROL = 1

REDFISH_OBJ = None

"""
Expand Down Expand Up @@ -598,10 +604,10 @@ def module_temp_populate(arg_list, _dummy):
read_mode = int(f.read().strip())
except:
# by default use SW control
read_mode = 1
read_mode = CONST.SDK_FW_CONTROL

# If control mode is FW, skip temperature reading
if read_mode == 0:
if read_mode == CONST.SDK_SW_CONTROL:
continue

f_src_input = os.path.join(f_src_path, "temperature/input")
Expand Down

0 comments on commit 8919f44

Please sign in to comment.