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

[Mellanox]Correct reboot cause when reboot via power cycle #3597

Merged

Conversation

stephenxs
Copy link
Collaborator

Ignore reset_sw_reset which indicates rebooted by software.

- What I did
Correct reboot cause when reboot via power cycle by ignoring reset_sw_reset.

process-reboot-cause has the following logic:

  1. check whether there is a hardware reboot cause, if so treats it as the final reboot-cause
  2. otherwise it checks the previously saved reboot cause files in /host/reboot-cause/

Currently we implement "reboot" command via using power cycle. After a power-cycle reboot the reset_sw_reset contains a "1". Originally chassis reboot-cause handling treats it as a hardware-caused reboot and returns it to process-reboot-cause. In this case, the process-reboot-cause treats it as the reboot cause which is wrong.

To resolve that, just don't return hardware reboot cause on reset_sw_reset.

- How I did it
Don't return hardware reboot cause on reset_sw_reset.

- How to verify it
reboot DUT and then check the reboot cause

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Stephen Sun added 2 commits October 10, 2019 06:36
Also check reboot cause file "reset_sw_reset" which indicates the system was rebooted due to software requesting.
@jleveque
Copy link
Contributor

@stephenxs: Should this PR also be cherry-picked into the 201811 branch?

@stephenxs
Copy link
Collaborator Author

@stephenxs: Should this PR also be cherry-picked into the 201811 branch?

No. On 201811 we don't have this issue.

@stephenxs stephenxs closed this Oct 14, 2019
@stephenxs stephenxs reopened this Oct 14, 2019
@stephenxs
Copy link
Collaborator Author

retest this, please.

@sujinmkang sujinmkang merged commit 2e3fb90 into sonic-net:master Oct 15, 2019
@stephenxs stephenxs deleted the fix-reboot-cause-via-powercycle branch October 15, 2019 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants