This is an automated email from the ASF dual-hosted git repository.
GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 9f4b66b800d drivers/rpmsg/rpmsg_port: call ns_bound_cb when data
arrives before the ns ack
9f4b66b800d is described below
commit 9f4b66b800d26069025835f5772f4599ee568f53
Author: liaoao <[email protected]>
AuthorDate: Thu May 8 19:58:09 2025 +0800
drivers/rpmsg/rpmsg_port: call ns_bound_cb when data arrives before the ns
ack
An endpoint created on the announcing side learns the peer address from
the first message it receives. When that is a data message instead of
the NS ack, rpmsg_port_rx_callback() only sets ept->dest_addr, so the
service's ns_bound_cb is never called and it never learns that the
endpoint is usable. Call ns_bound_cb in that case too, after setting
dest_addr under rdev->lock, as the NS ack path does.
Signed-off-by: liaoao <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
---
drivers/rpmsg/rpmsg_port.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/rpmsg/rpmsg_port.c b/drivers/rpmsg/rpmsg_port.c
index 2b3feae980f..9fe477abc55 100644
--- a/drivers/rpmsg/rpmsg_port.c
+++ b/drivers/rpmsg/rpmsg_port.c
@@ -450,9 +450,19 @@ static void rpmsg_port_rx_callback(FAR struct rpmsg_port_s
*port,
if (ept != NULL)
{
+ metal_mutex_acquire(&rdev->lock);
if (ept->dest_addr == RPMSG_ADDR_ANY)
{
ept->dest_addr = rphdr->src;
+ metal_mutex_release(&rdev->lock);
+ if (ept->ns_bound_cb != NULL)
+ {
+ ept->ns_bound_cb(ept);
+ }
+ }
+ else
+ {
+ metal_mutex_release(&rdev->lock);
}
rpmsg_trace(ept->name, false, rphdr, len,