[PATCH] remoteproc: virtio: support sharing vdev buffer

From: Peng Fan
Date: Wed Jul 22 2020 - 08:51:07 EST


Support sharing vdev buffer between multiple vdevs by using name
"vdevbuffer".

Reviewed-by: Richard Zhu <hongxing.zhu@xxxxxxx>
Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---
drivers/remoteproc/remoteproc_virtio.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c
index dfd3808c34fd..5d78ebea111e 100644
--- a/drivers/remoteproc/remoteproc_virtio.c
+++ b/drivers/remoteproc/remoteproc_virtio.c
@@ -343,6 +343,8 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id)

/* Try to find dedicated vdev buffer carveout */
mem = rproc_find_carveout_by_name(rproc, "vdev%dbuffer", rvdev->index);
+ if (!mem)
+ mem = rproc_find_carveout_by_name(rproc, "vdevbuffer");
if (mem) {
phys_addr_t pa;

--
2.16.4