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

Conversation

felixradensky
Copy link
Collaborator

These files are generated when PSUs are detected on I2C bus. However they are not removed when PSUs are plugged out. This makes it difficult to differentiate between real and dummy PSUs since dummy PSUs are not visible on I2C.

These files are generated when PSUs are detected on I2C bus.
However they are not removed when PSUs are plugged out. This
makes it difficult to differentiate between real and dummy PSUs
since dummy PSUs are not visible on I2C.

Signed-off-by: Felix Radensky <[email protected]>
@felixradensky
Copy link
Collaborator Author

RERUN

@@ -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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants