-
Notifications
You must be signed in to change notification settings - Fork 171
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
Linux system internal refactoring #288
Conversation
This code is legacy code. some of the APIs can be used by AMD on using the libmetal in Linux user space |
OpenAMP is one of the client of Libmetal library but not only client of libmetal library. Libmetal can be used by other userspace drivers as well. I see usage of libmetal here on github wide search: https://github.com/Xilinx/embeddedsw/blob/c9a0ee31b2a14cbcfcb56ca369037319b4ad4847/XilinxProcessorIPLib/drivers/rfdc/src/xrfdc_sinit.c#L150 While I agree I am on leave right now, but this can be discussed once I am back. |
This pull request has been marked as a stale pull request because it has been open (more than) 45 days with no activity. |
These functions are labeled METAL_INTERNAL so should have no external users, but they are not used internally either. Remove these functions. Signed-off-by: Andrew Davis <afd@ti.com>
This return code is for system calls only, and checkpatch warns about the same. Remove the use of this return code. Signed-off-by: Andrew Davis <afd@ti.com>
This function is only used by shmem. Move it to where it is used to reduce internal-only "API" functions. Signed-off-by: Andrew Davis <afd@ti.com>
This is a one-line one user internal function, just use mlock directly. Signed-off-by: Andrew Davis <afd@ti.com>
This is not used, remove to prevent failures related to getting a path that is not needed. Signed-off-by: Andrew Davis <afd@ti.com>
The declaration metal_linux_bus_close() is not needed, it is already defined at this point. Signed-off-by: Andrew Davis <afd@ti.com>
I'll drop the patch that removes |
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.
My big concern is that there are users of libmetal outside of the OpenAMP library. There are several within Xilinx/AMD, and potentially more that we don't know about.
I would prefer to see these API changes go through the deprecation process, so potential outside users have at least some warning.
These functions are not exposed externally as they are wrapped in an ifdef check for METAL_INTERNAL. This is only to be defined when building libmetal. If anyone defines that in their build to get access to these lib internal-only function then they are abusing the API this library provides. So external user already have a warning not to use these function, it is METAL_INTERNAL. |
This pull request has been marked as a stale pull request because it has been open (more than) 45 days with no activity. |
Discussed 2024/09/05: Need to move this stuff to a legacy header and mark it obsolete. |
As stated in the above comment (2 months ago): These functions are not exposed externally as they are wrapped in an ifdef check for METAL_INTERNAL. There is nothing to add to this deprecation file as no external facing API is being deprecated. We are only removing internal use only code. This is a completely internal refactor/cleanup. |
I mainly agree with @glneo's analysis. However, I suppose that these functions were initially added by AMD for a reason. This point should be clarified to determine if the functions can be removed or if they are not truly internal. |
Correct. I am not sure why they were exported, it is pretty old code. Just for reference, libmetal is not only used for OpenAMP backend, but also used in a standalone fashion. I agree with commits presented in this PR. However, I see functions are exported via sys.h header, and it's not really possible to know how these are being used by users. Hence, as per code of conduct, we should follow deprecation process. From next time, we can make sure not to export functions that are internal to libmetal. Once functions are exported, it is assumed that users are using them. |
The point highlighted by @glneo is that these functions are under the specific METAL_INTERNAL condition, so we should consider them as "non-exported." I would be in favor of first confirming whether AMD uses them outside of libmetal (as they are the owners of this part of the legacy code).
|
That is what I was originally working on when I came across these unused functions, moving the remaining used internal functions out of the exported headers is the next PR in my queue :) |
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.
LGTM.
Set of interface cleanups for the Linux system. Mostly removing dead code. Should result in no functional change.