Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hw-mgmt: scripts: Delete psuN_i2c_bus files when PSUs are plugged out #1458

Open
wants to merge 1 commit into
base: V.7.0040.3000_BR
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions usr/usr/bin/hw-management-thermal-events.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,9 @@ else
rm -f "$config_path"/"$psu_name"_power_slope
rm -f "$config_path"/"$psu_name"_power_capacity
fi
if [ -e "$config_path"/"$psu_name"_i2c_bus ]; then
rm -f "$config_path"/"$psu_name"_i2c_bus
fi
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Isn't it better to retain the config files to know the platform specific i2c bus number for PSUs?
    PSU presence is anyway available in the events folder.

  2. Are we sure that NOSs are not using this config attribute?

Copy link
Collaborator Author

@felixradensky felixradensky Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The psuN_i2c_bus files are generated when PSU is detected, so they exist only for real PSUs, not for all possible PSUs. Using the same logic, they should be deleted when PSU is removed, just like all other files related to this PSU are deleted. NVOS will check the existence of these files to know if PSU is real or dummy.

fi
if [ "$2" == "sxcore" ]; then
/usr/bin/hw-management.sh chipdown 0 "$4/$5"
Expand Down