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

Adding helper functions for switching of devtree backend in the same process #74

Closed
wants to merge 3 commits into from

Conversation

Swarnendu-R-C
Copy link
Contributor

@Swarnendu-R-C Swarnendu-R-C commented May 30, 2023

Context: It is now required that the devtree backend in BMC systems should be able to switch in the same process on runtime e.g.; from KERNEL to SBEFIFO or vice-versa. This is to support running extract SBE RC hardware procedure. This commit introduces the necessary changes in order to achieve that.

Solution: It basically introduces few functions which will clear the pdbg_dt_root and its associated children subsequently if the pdbg_targets_init function is called more than once now (earlier it was not allowed to call pdbg_targets_init function twice in the same process)

Test-1: The switching of the backend in the same process was tested through a standalone application which runs in a loop for multiple times and each time it sets the intial backend to SBEFIFO first and then switched it to KERNEL. Trace log is attached along with the PR

Test-2: While booting BMC up injected a clock error dueing IPL in between istep0 to istep2 and call the SBR RC extract procedure to get the error code after switching the backend from SBEFIFO to KERNEL. Once the extraction is done switched back to SBEFIFO for further processing. Journal log is attached with the PR.

Signed-off-by: swarnendu.roy.chowdhury@ibm.com

journalLog.txt
TraceLog_KARNEL_First.txt
TraceLog_SBEFIFO_First.txt
Screenshot 2023-06-23 at 7 39 30 PM
Screenshot 2023-06-23 at 7 39 54 PM

@Swarnendu-R-C Swarnendu-R-C force-pushed the master branch 2 times, most recently from 4f6f233 to 4579008 Compare May 30, 2023 07:17
libpdbg/device.c Outdated Show resolved Hide resolved
libpdbg/dtb.c Outdated Show resolved Hide resolved
libpdbg/libpdbg.h Outdated Show resolved Hide resolved
Copy link
Contributor

@devenrao devenrao left a comment

Choose a reason for hiding this comment

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

minor comments looks good

libpdbg/dtb.c Outdated Show resolved Hide resolved
Context: It is now required that the devtree backend in BMC systems should be
able to switch in the same process on runtime e.g.; from KERNEL to
SBEFIFO or vice-versa. This is to support running extract SBE RC hardware procedure.
This commit introduces the necessary changes in order to achieve that.

Solution: It basically introduces few functions which
will clear the pdbg_dt_root and its associated children subsequently
if the pdbg_targets_init function is called more than once now
(earlier it was not allowed to call pdbg_targets_init function twice
in the same process)

Test-1: The switching of the backend in the same process was tested
through a standalone application which runs in a loop for multiple times
and each time it sets the intial backend to SBEFIFO first and then
switched it to KERNEL. Trace log is attached along with the PR

Test-2: While booting BMC up injected a clock error dueing IPL in
between istep0 to istep2 and call the SBR RC extract procedure
to get the error code after switching the backend from SBEFIFO to
KERNEL. Once the extraction is done switched back to SBEFIFO for
further processing. Journal log is attached with the PR.

Signed-off-by: swarnendu.roy.chowdhury@ibm.com
Adding Unit test cases for newly added function pdbg_release_dt_root()

Signed-off-by: swarnendu.roy.chowdhury@ibm.com
pdbg_targets_init function had a FD leaks issue. This commit fixes that
by making sure before it returns it closes all the FDs when it is done
@Swarnendu-R-C
Copy link
Contributor Author

Opened the same in a new branch #76 so closing this as not needed anymore

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.

4 participants