You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/11/01 11:57:38 UTC

[incubator-nuttx] branch master updated (ff0cd0b -> 9cb994e)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from ff0cd0b  Revert "drivers/syslog: Call up_puts in syslog_default_write instad up_putc"
     new 8c3996c  openamp: add ns_unbind_notify support
     new 9cb994e  rptun: add ns_unbind_notify support

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 drivers/rptun/rptun.c                              | 37 +++++++++++++-----
 ...0004-openamp-add-ns_unbind_notify-support.patch | 44 ++++++++++++++++++++++
 openamp/open-amp.defs                              |  1 +
 3 files changed, 72 insertions(+), 10 deletions(-)
 create mode 100644 openamp/0004-openamp-add-ns_unbind_notify-support.patch

[incubator-nuttx] 01/02: openamp: add ns_unbind_notify support

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 8c3996c0012622019a7a71660ae9930300f10036
Author: ligd <li...@xiaomi.com>
AuthorDate: Mon Nov 1 14:49:10 2021 +0800

    openamp: add ns_unbind_notify support
    
    This is for notify rdev unbind event
    
    Signed-off-by: ligd <li...@xiaomi.com>
---
 ...0004-openamp-add-ns_unbind_notify-support.patch | 44 ++++++++++++++++++++++
 openamp/open-amp.defs                              |  1 +
 2 files changed, 45 insertions(+)

diff --git a/openamp/0004-openamp-add-ns_unbind_notify-support.patch b/openamp/0004-openamp-add-ns_unbind_notify-support.patch
new file mode 100644
index 0000000..797d897
--- /dev/null
+++ b/openamp/0004-openamp-add-ns_unbind_notify-support.patch
@@ -0,0 +1,44 @@
+From 03217b06dfc9fd23b33401cec689cfdbe373770d Mon Sep 17 00:00:00 2001
+From: ligd <li...@xiaomi.com>
+Date: Tue, 20 Jul 2021 17:52:13 +0800
+Subject: [PATCH] openamp: add ns_unbind_notify support
+
+neededby:826344
+This is for notify rdev unbind event
+
+Change-Id: Ie4301e8b774158baf8aa1299f8eb6748dd09b1d9
+Signed-off-by: ligd <li...@xiaomi.com>
+(cherry picked from commit 85818f5857d340635e81680a98924f2bb715c97f)
+---
+ lib/include/openamp/rpmsg.h | 1 +
+ lib/rpmsg/rpmsg_virtio.c    | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/lib/include/openamp/rpmsg.h open-amp/lib/include/openamp/rpmsg.h
+index 93aeec6..4ebb141 100644
+--- a/lib/include/openamp/rpmsg.h
++++ open-amp/lib/include/openamp/rpmsg.h
+@@ -129,6 +129,7 @@ struct rpmsg_device {
+ 	unsigned long bitmap[metal_bitmap_longs(RPMSG_ADDR_BMP_SIZE)];
+ 	metal_mutex_t lock;
+ 	rpmsg_ns_bind_cb ns_bind_cb;
++	rpmsg_ns_bind_cb ns_unbind_cb;
+ 	struct rpmsg_device_ops ops;
+ 	bool support_ns;
+ 	bool support_ack;
+diff --git a/lib/rpmsg/rpmsg_virtio.c open-amp/lib/rpmsg/rpmsg_virtio.c
+index 51c2565..2687320 100644
+--- a/lib/rpmsg/rpmsg_virtio.c
++++ open-amp/lib/rpmsg/rpmsg_virtio.c
+@@ -553,6 +553,8 @@ static int rpmsg_virtio_ns_callback(struct rpmsg_endpoint *ept, void *data,
+ 		metal_mutex_release(&rdev->lock);
+ 		if (_ept && _ept->ns_unbind_cb)
+ 			_ept->ns_unbind_cb(_ept);
++		if (rdev->ns_unbind_cb)
++			rdev->ns_unbind_cb(rdev, name, dest);
+ 	} else if (ns_msg->flags == RPMSG_NS_CREATE) {
+ 		if (!_ept) {
+ 			/*
+-- 
+2.25.1
+
diff --git a/openamp/open-amp.defs b/openamp/open-amp.defs
index 5fae35c..a9e31f3 100644
--- a/openamp/open-amp.defs
+++ b/openamp/open-amp.defs
@@ -36,6 +36,7 @@ open-amp.zip:
 	$(Q) patch -p0 < 0001-ns-acknowledge-the-received-creation-message.patch
 	$(Q) patch -p0 < 0002-Negotiate-individual-buffer-size-dynamically.patch
 	$(Q) patch -p0 < 0003-rpmsg-wait-endpoint-ready-in-rpmsg_send-and-rpmsg_se.patch
+	$(Q) patch -p0 < 0004-openamp-add-ns_unbind_notify-support.patch
 
 .openamp_headers: open-amp.zip
 	$(eval headers := $(wildcard open-amp/lib/include/openamp/*.h))

[incubator-nuttx] 02/02: rptun: add ns_unbind_notify support

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 9cb994e6dcc188e1fcc32dd8d7437dfc6ce6f0f3
Author: ligd <li...@xiaomi.com>
AuthorDate: Tue Jul 20 17:43:46 2021 +0800

    rptun: add ns_unbind_notify support
    
    Signed-off-by: ligd <li...@xiaomi.com>
---
 drivers/rptun/rptun.c | 37 +++++++++++++++++++++++++++----------
 1 file changed, 27 insertions(+), 10 deletions(-)

diff --git a/drivers/rptun/rptun.c b/drivers/rptun/rptun.c
index 31b90ff..0be24b5 100644
--- a/drivers/rptun/rptun.c
+++ b/drivers/rptun/rptun.c
@@ -377,6 +377,31 @@ static void rptun_ns_bind(FAR struct rpmsg_device *rdev,
     }
 }
 
+static void rptun_ns_unbind(FAR struct rpmsg_device *rdev,
+                            FAR const char *name, uint32_t dest)
+{
+  FAR struct rptun_priv_s *priv = rptun_get_priv_by_rdev(rdev);
+  FAR struct metal_list *node;
+
+  nxsem_wait(&g_rptun_sem);
+
+  metal_list_for_each(&priv->bind, node)
+    {
+      struct rptun_bind_s *bind;
+
+      bind = metal_container_of(node, struct rptun_bind_s, node);
+
+      if (bind->dest == dest && !strncmp(bind->name, name, RPMSG_NAME_SIZE))
+        {
+          metal_list_del(node);
+          kmm_free(bind);
+          break;
+        }
+    }
+
+  nxsem_post(&g_rptun_sem);
+}
+
 static int rptun_dev_start(FAR struct remoteproc *rproc)
 {
   FAR struct rptun_priv_s *priv = rproc->priv;
@@ -493,6 +518,8 @@ static int rptun_dev_start(FAR struct remoteproc *rproc)
       return ret;
     }
 
+  priv->vdev.rdev.ns_unbind_cb = rptun_ns_unbind;
+
   /* Remote proc start */
 
   ret = remoteproc_start(rproc);
@@ -566,16 +593,6 @@ static int rptun_dev_stop(FAR struct remoteproc *rproc)
   remoteproc_remove_virtio(rproc, priv->vdev.vdev);
   rpmsg_deinit_vdev(&priv->vdev);
 
-  /* Free bind list */
-
-  metal_list_for_each(&priv->bind, node)
-    {
-      struct rptun_bind_s *bind;
-
-      bind = metal_container_of(node, struct rptun_bind_s, node);
-      kmm_free(bind);
-    }
-
   return 0;
 }