You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/08/02 13:16:44 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6762: merge openamp to newest version (2022.04.0)

pkarashchenko commented on code in PR #6762:
URL: https://github.com/apache/incubator-nuttx/pull/6762#discussion_r935579232


##########
drivers/rptun/rptun.c:
##########
@@ -113,7 +113,7 @@ struct rptun_store_s
  ****************************************************************************/
 
 static FAR struct remoteproc *rptun_init(FAR struct remoteproc *rproc,
-                                         FAR struct remoteproc_ops *ops,
+                                        FAR const struct remoteproc_ops *ops,

Review Comment:
   ```suggestion
                                           FAR const struct remoteproc_ops *ops,
   ```



##########
drivers/rptun/rptun.c:
##########
@@ -315,14 +301,46 @@ static bool rptun_is_recursive(FAR struct rptun_priv_s *priv)
 }
 #endif
 
+static void rptun_wakeup_tx(FAR struct rptun_priv_s *priv)
+{
+  int semcount;
+
+  nxsem_get_value(&priv->semtx, &semcount);
+  while (semcount++ < 1)
+    {
+      nxsem_post(&priv->semtx);
+    }
+}
+
 static int rptun_callback(FAR void *arg, uint32_t vqid)
 {
-  rptun_wakeup(arg);
+  FAR struct rptun_priv_s *priv = arg;
+  FAR struct rpmsg_virtio_device *rvdev = &priv->rvdev;
+  FAR struct virtio_device *vdev = rvdev->vdev;
+  FAR struct virtqueue *svq = rvdev->svq;
+  FAR struct virtqueue *rvq = rvdev->rvq;
+
+  if (vqid == RPTUN_NOTIFY_ALL ||
+      vqid == vdev->vrings_info[rvq->vq_queue_index].notifyid)
+    {
+      if (rptun_buffer_nused(&priv->rvdev, true))
+        {
+          rptun_wakeup_rx(priv);
+        }
+    }
+
+  if (vqid == RPTUN_NOTIFY_ALL ||
+      vqid == vdev->vrings_info[svq->vq_queue_index].notifyid)
+    {
+      rptun_wakeup_tx(priv);
+      rptun_pm_action(priv, false);
+    }
+
   return OK;
 }
 
 static FAR struct remoteproc *rptun_init(FAR struct remoteproc *rproc,
-                                         FAR struct remoteproc_ops *ops,
+                                        FAR const struct remoteproc_ops *ops,

Review Comment:
   ```suggestion
                                            FAR const struct remoteproc_ops *ops,
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org