Skip to content

Commit b981634

Browse files
committed
hw-mgmt: scripts: fix asic_ready state on hw-mgmt init.
If the SDK is already loaded when hw-mgmt initializes, the asic_ready attribute remains in its default state (0). As a result, the system reports an incorrect ASIC readiness status ("not ready") even though the ASIC is actually ready. Fix: Detect the current ASIC state during initialization and set asicX_ready to the correct initial value. bug: 4851807 Signed-off-by: Oleksandr Shamray <oleksandrs@nvidia.com>
1 parent 0e9d191 commit b981634

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

usr/usr/bin/hw-management.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3050,9 +3050,17 @@ set_config_data()
30503050
fi
30513051
[ -f "$config_path/asic_num" ] && asic_num=$(< $config_path/asic_num)
30523052
for ((asic_id=1; asic_id<=asic_num; asic_id+=1)); do
3053-
echo 0 > $config_path/asic"$asic_id"_ready
3053+
# If SDK already started during hw-mgmt init we should update asic_ready to 1
3054+
# Use temperature label file as flag to check if SDK already started
3055+
sdk_asic_idx=$((asic_id-1))
3056+
if [ -f "/sys/module/sx_core/asic${sdk_asic_idx}/temperature/label" ]; then
3057+
asic_ready_status=1
3058+
else
3059+
asic_ready_status=0
3060+
fi
3061+
echo "$asic_ready_status" > "$config_path"/asic"$asic_id"_ready
30543062
if [ $asic_id -eq 1 ]; then
3055-
echo 0 > $config_path/asic_ready
3063+
echo "$asic_ready_status" > "$config_path"/asic_ready
30563064
fi
30573065
done
30583066
}

0 commit comments

Comments
 (0)