diff mbox

[RFC,LINUX,13/19] remoteproc: add config_wait_complete to rproc_vdev

Message ID 1490383355-23176-14-git-send-email-jliang@xilinx.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jiaying Liang March 24, 2017, 7:22 p.m. UTC
From: Wendy Liang <wendy.liang@xilinx.com>

Add config_wait_complete to rproc_vdev.
This attribute is used for vdev config operation to
wait for the remote to respond. When there is a
notification comes from the remote, it can wake up
the waiting client by marking this attribute.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
 drivers/remoteproc/remoteproc_virtio.c | 1 +
 include/linux/remoteproc.h             | 2 ++
 2 files changed, 3 insertions(+)
diff mbox

Patch

diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c
index e45e17b..c6f7ca4 100644
--- a/drivers/remoteproc/remoteproc_virtio.c
+++ b/drivers/remoteproc/remoteproc_virtio.c
@@ -340,6 +340,7 @@  int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id)
 	vdev->dev.parent = dev;
 	vdev->dev.release = rproc_virtio_dev_release;
 
+	init_completion(&rvdev->config_wait_complete);
 	/*
 	 * We're indirectly making a non-temporary copy of the rproc pointer
 	 * here, because drivers probed with this vdev will indirectly
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 303210b..4ce7579 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -534,6 +534,7 @@  struct rproc_vring {
  * @vdev: the virio device
  * @vring: the vrings for this vdev
  * @rsc_offset: offset of the vdev's resource entry
+ * @config_wait_complete: mark asynchronous vdev config wait complete
  */
 struct rproc_vdev {
 	struct kref refcount;
@@ -546,6 +547,7 @@  struct rproc_vdev {
 	struct virtio_device vdev;
 	struct rproc_vring vring[RVDEV_NUM_VRINGS];
 	u32 rsc_offset;
+	struct completion config_wait_complete;
 };
 
 struct rproc *rproc_get_by_phandle(phandle phandle);