Repository navigation
drivers/rpmsg/rpmsg_virtio: return RPMSG_EOPNOTSUPP from notify_wait - #21582
Merged
Merged
Conversation
rpmsg_virtio_get_tx_payload_buffer() in openamp sleeps and retries only when notify_wait_cb() returns RPMSG_EOPNOTSUPP. rpmsg_virtio_notify_wait() returns -EAGAIN outside the recursive case, so the loop breaks at once and a waiting caller hits metal_assert(!wait || rp_hdr != NULL) whenever all tx buffers are in use. Return RPMSG_EOPNOTSUPP so the caller waits for a buffer as intended. Signed-off-by: Yongrong Wang <[email protected]> Signed-off-by: Bowen Wang <[email protected]>
|
xiaoxiang781216
approved these changes
Nov 10, 2026
GUIDINGLI
approved these changes
Nov 11, 2026
xiaoxiang781216
pushed a commit
that referenced
this pull request
Nov 12, 2026
verdin-mx8mp:rpmsg runs from the 128 KB ITCM. After #21582 and #21542 the image does not fit (CI): arm-none-eabi-ld: region `flash' overflowed by 112 bytes The rpmsg configuration has CONFIG_LIBC_LOCALE from the nsh configuration of the board, where the C++ library needs it. The rpmsg configuration has no C++ and nothing in it uses locale support. Disable it: this saves 352 bytes. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
rpmsg_virtio_notify_wait()returns-EAGAINwhen it cannot wait inplace (not in the recursive rx context). openamp's
rpmsg_virtio_get_tx_payload_buffer()sleeps and retries only whennotify_wait_cb()returnsRPMSG_EOPNOTSUPP; any other value breaksthe loop. So a thread that asks for a tx buffer with
wait = truewhile the peer holds all of them fails at once and hits
in
openamp/open-amp/lib/rpmsg/rpmsg_virtio.c. ReturnRPMSG_EOPNOTSUPPso the caller waits for a buffer as intended.Impact
Only the case where all tx buffers are in use changes: a waiting caller
now waits (up to openamp's
RPMSG_TICK_COUNT) instead of asserting.No API or Kconfig change.
Testing
Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu 13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
Reproducer:
sim:rpserver+sim:rpproxywith an out-of-treeextension of
drivers/rpmsg/rpmsg_test.c(not part of this PR). Itsexisting hold-rx case leaves the peer holding every tx buffer; the added
case then calls
rpmsg_get_tx_payload_buffer(ept, &space, true)andround-trips the buffer with
rpmsg_send_nocopy(). nsh on each side:rpmsg test all.rpmsg_virtio.c:303rpmsg_virtio.c:303before (server)
after (server)
No regression on the fixed rpmsg cases:
results.md
Baseline (
test.sh, cases: baseline.yaml):uname -a(server)rpmsg dump all(server)rpmsg ping all 10 1024 3 0(server)uname -a(proxy)rpmsg ping all 10 1024 3 0(proxy)mount -t rpmsgfs -o cpu=server,fs=/proc /sp(proxy)cat /sp/version(proxy)rpmsg dump all(proxy)uname -a(server)uname -a(proxy)rpmsg dump all(server)rpmsg ping all 10 1024 3 0(server)rpmsg ping all 10 1024 3 0(proxy)mount -t rpmsgfs -o cpu=server,fs=/proc /sp(proxy)cat /sp/version(proxy)