Skip to content

drivers/rpmsg/ping: skip rpmsg ping send if endpoint is not ready#17395

Open
anchao wants to merge 1 commit intoapache:masterfrom
anchao:25112801
Open

drivers/rpmsg/ping: skip rpmsg ping send if endpoint is not ready#17395
anchao wants to merge 1 commit intoapache:masterfrom
anchao:25112801

Conversation

@anchao
Copy link
Contributor

@anchao anchao commented Nov 28, 2025

Summary

drivers/rpmsg/ping: skip rpmsg ping send if endpoint is not ready

rpmsg ping send blocks for 15 seconds until the ept is ready, which
is not ideal for applications that need to monitor ping status.
In this PR, we will check if the ept is ready to avoid prolonged
blocking in the underlying driver.

Signed-off-by: chao an anchao.archer@bytedance.com

Impact

rpmsg ping ioctl

Testing

sim/rpproxy with rpmsg ping, qemu-armv8a(ivshmem) with rpmsg ping

@anchao anchao requested review from jerpelea and yf13 as code owners November 28, 2025 02:33
@github-actions github-actions bot added Area: Drivers Drivers issues Size: XS The size of the change in this PR is very small labels Nov 28, 2025
nxsem_init(&sem, 0, 0);

ret = rpmsg_send_nocopy(ept, msg, msg->len);
ret = rpmsg_sendto_nocopy(ept, msg, msg->len);
Copy link
Contributor

Choose a reason for hiding this comment

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

why change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

send will busy loop in 15s, so we replace to sendto

Copy link
Contributor

Choose a reason for hiding this comment

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

but you already add the check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because endpoint checks can involve race conditions, to avoid holding critical sections, the endpoint state is checked in 2 phases.

Copy link
Contributor

Choose a reason for hiding this comment

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

but rpmsg_send_nocopy call is_rpmsg_ept_ready too.

Copy link
Contributor

Choose a reason for hiding this comment

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

rpmsg_send/rpmsg_send_nocopy sufer the same issue, why do you change the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Emm... my code is rpmsg_sendto_nocopy, sendto !!!!! not rpmsg_send

Copy link
Contributor Author

@anchao anchao Dec 2, 2025

Choose a reason for hiding this comment

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

@xiaoxiang781216
Is this ID handled by a different person, or is it using AI review? It feels like you didn’t even look at the code at all

Copy link
Contributor

Choose a reason for hiding this comment

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

the code already check is_rpmsg_ept_ready, I would prefer to continue use rpmsg_send_nocopy since rpmsg_sendto_nocopy is used to no name channel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but the rpmsg API does not have this limitation. In terms of interface implementation, send will wait 15 seconds, while sendto will only try once:

image

rpmsg ping send blocks for 15 seconds until the ept is ready, which
is not ideal for applications that need to monitor ping status.
In this PR, we will check if the ept is ready to avoid prolonged
blocking in the underlying driver.

Signed-off-by: chao an <anchao.archer@bytedance.com>
@linguini1
Copy link
Contributor

Can you include the logs from your tests?

@anchao
Copy link
Contributor Author

anchao commented Dec 2, 2025

Can you include the logs from your tests?

Thanks for reminding. I've been quite busy lately, so please hold this PR do not merge. I'll submit the log if feel free.

@acassis
Copy link
Contributor

acassis commented Jan 15, 2026

ping @anchao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Drivers Drivers issues Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants