2022-11-05 15:16:58 +01:00
|
|
|
From 0e77783658066c02903cc6693460f3bb577e3030 Mon Sep 17 00:00:00 2001
|
2022-08-02 10:44:59 +02:00
|
|
|
From: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
|
|
|
|
Date: Mon, 11 Apr 2022 13:31:35 +0800
|
2022-11-05 15:16:58 +01:00
|
|
|
Subject: [PATCH 7/9] openamp: avoid double calling ns_bound when each other
|
2022-08-02 10:44:59 +02:00
|
|
|
calls create_ept
|
|
|
|
|
|
|
|
VELAPLATFO-1522
|
|
|
|
|
|
|
|
Change-Id: I78c027e3fcaf54126b75358b91b557e477955964
|
|
|
|
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
|
|
|
|
---
|
|
|
|
lib/rpmsg/rpmsg_virtio.c | 17 +++++++++++------
|
|
|
|
1 file changed, 11 insertions(+), 6 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/lib/rpmsg/rpmsg_virtio.c open-amp/lib/rpmsg/rpmsg_virtio.c
|
2022-11-05 15:16:58 +01:00
|
|
|
index efbcd68d..49817799 100644
|
2022-08-02 10:44:59 +02:00
|
|
|
--- a/lib/rpmsg/rpmsg_virtio.c
|
|
|
|
+++ open-amp/lib/rpmsg/rpmsg_virtio.c
|
2022-11-05 15:16:58 +01:00
|
|
|
@@ -652,7 +652,7 @@ static int rpmsg_virtio_ns_callback(struct rpmsg_endpoint *ept, void *data,
|
2022-08-02 10:44:59 +02:00
|
|
|
metal_mutex_release(&rdev->lock);
|
|
|
|
if (rdev->ns_bind_cb)
|
|
|
|
rdev->ns_bind_cb(rdev, name, dest);
|
|
|
|
- } else {
|
|
|
|
+ } else if (_ept->dest_addr == RPMSG_ADDR_ANY) {
|
|
|
|
_ept->dest_addr = dest;
|
|
|
|
metal_mutex_release(&rdev->lock);
|
|
|
|
if (_ept->name[0] && rdev->support_ack)
|
2022-11-05 15:16:58 +01:00
|
|
|
@@ -662,14 +662,19 @@ static int rpmsg_virtio_ns_callback(struct rpmsg_endpoint *ept, void *data,
|
2022-08-02 10:44:59 +02:00
|
|
|
if (_ept->ns_bound_cb)
|
|
|
|
_ept->ns_bound_cb(_ept);
|
|
|
|
}
|
|
|
|
+ else
|
|
|
|
+ metal_mutex_release(&rdev->lock);
|
|
|
|
} else { /* RPMSG_NS_CREATE_ACK */
|
|
|
|
/* save the received destination address */
|
|
|
|
- if (_ept)
|
|
|
|
+ if (_ept && _ept->dest_addr == RPMSG_ADDR_ANY) {
|
|
|
|
_ept->dest_addr = dest;
|
|
|
|
- metal_mutex_release(&rdev->lock);
|
|
|
|
- /* notify application that the endpoint has been bound */
|
|
|
|
- if (_ept && _ept->ns_bound_cb)
|
|
|
|
- _ept->ns_bound_cb(_ept);
|
|
|
|
+ metal_mutex_release(&rdev->lock);
|
|
|
|
+ /* notify application that the endpoint has been bound */
|
|
|
|
+ if (_ept->ns_bound_cb)
|
|
|
|
+ _ept->ns_bound_cb(_ept);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ metal_mutex_release(&rdev->lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
return RPMSG_SUCCESS;
|
|
|
|
--
|
|
|
|
2.25.1
|
|
|
|
|