linux-remoteproc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remoteproc: virtio: support sharing vdev buffer
@ 2020-07-22 13:15 Peng Fan
  2020-07-29 17:05 ` Mathieu Poirier
  0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan @ 2020-07-22 13:15 UTC (permalink / raw)
  To: bjorn.andersson, mathieu.poirier, ohad
  Cc: linux-remoteproc, linux-kernel, peng.fan

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

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] remoteproc: virtio: support sharing vdev buffer
  2020-07-22 13:15 [PATCH] remoteproc: virtio: support sharing vdev buffer Peng Fan
@ 2020-07-29 17:05 ` Mathieu Poirier
  2020-07-30  6:21   ` Peng Fan
  0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Poirier @ 2020-07-29 17:05 UTC (permalink / raw)
  To: Peng Fan; +Cc: bjorn.andersson, ohad, linux-remoteproc, linux-kernel

Hi Peng,

On Wed, Jul 22, 2020 at 09:15:43PM +0800, Peng Fan wrote:
> Support sharing vdev buffer between multiple vdevs by using name
> "vdevbuffer".
> 
> Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  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");

We already have a way to share buffers [1], do you think it would work for you?  I
would rather proceed that way to avoid introducing a 3rd way to deal with vdev
buffers.

Thanks,
Mathieu

[1]. https://elixir.bootlin.com/linux/v5.8-rc4/source/drivers/remoteproc/remoteproc_virtio.c#L389

>  	if (mem) {
>  		phys_addr_t pa;
>  
> -- 
> 2.16.4
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] remoteproc: virtio: support sharing vdev buffer
  2020-07-29 17:05 ` Mathieu Poirier
@ 2020-07-30  6:21   ` Peng Fan
  2020-07-30 21:54     ` Mathieu Poirier
  0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan @ 2020-07-30  6:21 UTC (permalink / raw)
  To: Mathieu Poirier; +Cc: bjorn.andersson, ohad, linux-remoteproc, linux-kernel

Hi Mathieu,

> Subject: Re: [PATCH] remoteproc: virtio: support sharing vdev buffer
> 
> Hi Peng,
> 
> On Wed, Jul 22, 2020 at 09:15:43PM +0800, Peng Fan wrote:
> > Support sharing vdev buffer between multiple vdevs by using name
> > "vdevbuffer".
> >
> > Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  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");
> 
> We already have a way to share buffers [1], do you think it would work for you?
> I would rather proceed that way to avoid introducing a 3rd way to deal with
> vdev buffers.

That should work for me. I just need to move the vdevbuffer to the 1st one
inside the memory-region.

BTW: Do you have time to give a review for
https://patchwork.kernel.org/patch/11688751/

Thanks,
Peng.

> 
> Thanks,
> Mathieu
> 
> [1].
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Felixir.b
> ootlin.com%2Flinux%2Fv5.8-rc4%2Fsource%2Fdrivers%2Fremoteproc%2Frem
> oteproc_virtio.c%23L389&amp;data=02%7C01%7Cpeng.fan%40nxp.com%7C
> 760ae238005c49fe20db08d833e193ca%7C686ea1d3bc2b4c6fa92cd99c5c30
> 1635%7C0%7C0%7C637316391223184319&amp;sdata=UTN8YVaEynomrwFx
> 7aTCJ7fp0fjfIS8fscfGG67naKk%3D&amp;reserved=0
> 
> >  	if (mem) {
> >  		phys_addr_t pa;
> >
> > --
> > 2.16.4
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] remoteproc: virtio: support sharing vdev buffer
  2020-07-30  6:21   ` Peng Fan
@ 2020-07-30 21:54     ` Mathieu Poirier
  0 siblings, 0 replies; 4+ messages in thread
From: Mathieu Poirier @ 2020-07-30 21:54 UTC (permalink / raw)
  To: Peng Fan; +Cc: bjorn.andersson, ohad, linux-remoteproc, linux-kernel

On Thu, 30 Jul 2020 at 00:22, Peng Fan <peng.fan@nxp.com> wrote:
>
> Hi Mathieu,
>
> > Subject: Re: [PATCH] remoteproc: virtio: support sharing vdev buffer
> >
> > Hi Peng,
> >
> > On Wed, Jul 22, 2020 at 09:15:43PM +0800, Peng Fan wrote:
> > > Support sharing vdev buffer between multiple vdevs by using name
> > > "vdevbuffer".
> > >
> > > Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
> > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > ---
> > >  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");
> >
> > We already have a way to share buffers [1], do you think it would work for you?
> > I would rather proceed that way to avoid introducing a 3rd way to deal with
> > vdev buffers.
>
> That should work for me. I just need to move the vdevbuffer to the 1st one
> inside the memory-region.

Perfect

>
> BTW: Do you have time to give a review for
> https://patchwork.kernel.org/patch/11688751/
>

Unfortunately not in a little while.  There are a couple of beefy
patchset in the queue ahead of yours and to make matters worse I am
away next week.

> Thanks,
> Peng.
>
> >
> > Thanks,
> > Mathieu
> >
> > [1].
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Felixir.b
> > ootlin.com%2Flinux%2Fv5.8-rc4%2Fsource%2Fdrivers%2Fremoteproc%2Frem
> > oteproc_virtio.c%23L389&amp;data=02%7C01%7Cpeng.fan%40nxp.com%7C
> > 760ae238005c49fe20db08d833e193ca%7C686ea1d3bc2b4c6fa92cd99c5c30
> > 1635%7C0%7C0%7C637316391223184319&amp;sdata=UTN8YVaEynomrwFx
> > 7aTCJ7fp0fjfIS8fscfGG67naKk%3D&amp;reserved=0
> >
> > >     if (mem) {
> > >             phys_addr_t pa;
> > >
> > > --
> > > 2.16.4
> > >

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-30 21:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-22 13:15 [PATCH] remoteproc: virtio: support sharing vdev buffer Peng Fan
2020-07-29 17:05 ` Mathieu Poirier
2020-07-30  6:21   ` Peng Fan
2020-07-30 21:54     ` Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).