-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[E1031] add platform specific reboot command support #15889
[E1031] add platform specific reboot command support #15889
Conversation
Why I did it E1031: add platform specific cold reboot support How I did it Use the CPLD to trigger board level power cycle when cold reboot How to verify it Do reboot stress test and check the reboot cause history
Attach CPLD version info and stress test log.
|
CPLD_SETREG_PATH="/sys/bus/platform/devices/e1031.smc/setreg" | ||
|
||
# Board level power cycle | ||
echo "0x0113 0xAA" > ${CPLD_SETREG_PATH} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qnos is the filesystem unmounted at this stage? if not, it can cause FS corruption
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qnos is the filesystem unmounted at this stage? if not, it can cause FS corruption
Understand your concern, I will add fs umount logic before power cycle. Thanks.
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
/easycla |
ADO: 24651987 |
|
||
echo "User issued 'reboot' with platform-specific command [User: ${REBOOT_USER}, Time: ${REBOOT_TIME}]" > ${REBOOT_CAUSE_FILE} | ||
sync | ||
/sbin/fstrim -av |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qnos why do we need trim at this point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qnos why do we need trim at this point?
Cold reboot is a kind of force power cycle, add fstrim to try reducing the disk segment before force reboot. Commonly in non-test environment, cold reboot wouldn't be called frequently, so it wouldn't do harm to SSD health and lifecycle. Even in test environment, hundreds of reboot test would introduce obvious effect to SSD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qnos reducing the disk segment means? how cold reboot affects SSD health/life?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qnos reducing the disk segment means? how cold reboot affects SSD health/life?
fstrim could be used for disk defragmentation, i meant using fstrim(called by cold reboot script) too frequently would affect SSD health. But in reboot case, that wouldn't be frequent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qnos I think Prince's questions is on why we need do this fstrim here? Since we already have cronjob to do daily fstrim, it seems like unnecessary to do fstrim before power-cycle. Do you have any other concern to have this operation here? If not, I think we'd better remove it since it is not related to the power-cycle.
@yxieca could you merge to master? |
@qiluo-msft please cherry pick to 202012. ADO# 24651987 |
Cherry-pick PR to 202012: #16216 |
* [E1031] add platform specific reboot command support Why I did it E1031: add platform specific cold reboot support How I did it Use the CPLD to trigger board level power cycle when cold reboot How to verify it Do reboot stress test and check the reboot cause history * [E1031] try to umount filesystem before power cycle reboot * [E1031] remove fstrim in customized reboot script
* [E1031] add platform specific reboot command support Why I did it E1031: add platform specific cold reboot support How I did it Use the CPLD to trigger board level power cycle when cold reboot How to verify it Do reboot stress test and check the reboot cause history * [E1031] try to umount filesystem before power cycle reboot * [E1031] remove fstrim in customized reboot script
ADO: 24651987
Why I did it
E1031(HLX): add platform specific cold reboot support, using CPLD board level power cycle functionality for cold reboot.
How I did it
Use the CPLD to trigger board level power cycle when cold reboot
How to verify it
Do reboot stress test and check the reboot cause history
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)