drivers/rpmsg: unify cpuname handling and fix pm wakelock initialization #18108
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR contains two improvements to the RPMSG subsystem:
Unify cpuname/local_cpuname to struct rpmsg_s: Move the cpuname and local_cpuname fields from individual driver structures (rpmsg_port, rpmsg_virtio, rpmsg_virtio_lite, rpmsg_router_edge) to the common struct rpmsg_s. This eliminates the need for ops->get_cpuname and ops->get_local_cpuname callbacks in struct rpmsg_ops_s, simplifying the code and reducing duplication across different RPMSG backends.
Fix pm wakelock initialization in rpmsg_virtio_lite: Add missing pm wakelock name initialization that was not picked up during the rename from rpmsg_virtio to rpmsg_virtio_lite. This ensures proper power management functionality when CONFIG_RPMSG_VIRTIO_LITE_PM is enabled.
Impact
Code simplification: Removes ~120 lines of duplicated code across multiple RPMSG drivers
API cleanup: Removes two function pointers from struct rpmsg_ops_s
Bug fix: Restores pm wakelock functionality in rpmsg_virtio_lite driver
No breaking changes: Internal refactoring only, public API unchanged
Testing
Build test with qemu-armv8a:v8a_server and qemu-armv8a:v8a_proxy configurations:
RPMSG communication verified between server and proxy cores: