2022-04-06 16:03:09

by Arnaud Pouliquen

[permalink] [raw]
Subject: [RFC PATCH v5 0/4] remoteproc: restructure the remoteproc VirtIO device

1) Update from V4 [1]:

Minor updates based on Mathieu's comments.
Updates are listed in the commit message of each patch.

[1] https://lkml.org/lkml/2022/3/14/1177

2) Patchset description:

This series is a part of the work initiated a long time ago in
the series "remoteproc: Decorelate virtio from core"[2]

Objective of the work:
- Update the remoteproc VirtIO device creation (use platform device)
- Allow to declare remoteproc VirtIO device in DT
- declare resources associated to a remote proc VirtIO
- declare a list of VirtIO supported by the platform.
- Prepare the enhancement to more VirtIO devices (e.g I2C, audio, video, ...).
For instance be able to declare a I2C device in a virtio-i2C node.
- Keep the legacy working!
- Try to improve the picture about concerns reported by Christoph Hellwing [3][4]

[2] https://lkml.org/lkml/2020/4/16/1817
[3] https://lkml.org/lkml/2021/6/23/607
[4] https://patchwork.kernel.org/project/linux-remoteproc/patch/[email protected]/

In term of device tree this would result in such hierarchy (stm32mp1 example with 2 virtio RPMSG):

m4_rproc: m4@10000000 {
compatible = "st,stm32mp1-m4";
reg = <0x10000000 0x40000>,
<0x30000000 0x40000>,
<0x38000000 0x10000>;
memory-region = <&retram>, <&mcuram>,<&mcuram2>;
mboxes = <&ipcc 2>, <&ipcc 3>;
mbox-names = "shutdown", "detach";
status = "okay";

#address-cells = <1>;
#size-cells = <0>;

vdev@0 {
compatible = "rproc-virtio";
reg = <0>;
virtio,id = <7>; /* RPMSG */
memory-region = <&vdev0vring0>, <&vdev0vring1>, <&vdev0buffer>;
mboxes = <&ipcc 0>, <&ipcc 1>;
mbox-names = "vq0", "vq1";
status = "okay";
};

vdev@1 {
compatible = "rproc-virtio";
reg = <1>;
virtio,id = <7>; /*RPMSG */
memory-region = <&vdev1vring0>, <&vdev1vring1>, <&vdev1buffer>;
mboxes = <&ipcc 4>, <&ipcc 5>;
mbox-names = "vq0", "vq1";
status = "okay";
};
};

I have divided the work in 4 steps to simplify the review, This series implements only
the step 1:
step 1: redefine the remoteproc VirtIO device as a platform device
- migrate rvdev management in remoteproc virtio.c,
- create a remotproc virtio config ( can be disabled for platform that not use VirtIO IPC.
step 2: add possibility to declare and probe a VirtIO sub node
- VirtIO bindings declaration,
- multi DT VirtIO devices support,
- introduction of a remote proc virtio bind device mechanism ,
=> https://github.com/arnopo/linux/commits/step2-virtio-in-DT
step 3: Add memory declaration in VirtIO subnode
=> https://github.com/arnopo/linux/commits/step3-virtio-memories
step 4: Add mailbox declaration in VirtIO subnode
=> https://github.com/arnopo/linux/commits/step4-virtio-mailboxes

Arnaud Pouliquen (4):
remoteproc: core: Introduce virtio device add/remove functions
remoteproc: core: Introduce rproc_register_rvdev function
remoteproc: Move rproc_vdev management to remoteproc_virtio.c
remoteproc: virtio: Create platform device for the remoteproc_virtio

drivers/remoteproc/remoteproc_core.c | 154 +++---------------
drivers/remoteproc/remoteproc_internal.h | 23 ++-
drivers/remoteproc/remoteproc_virtio.c | 193 ++++++++++++++++++++---
include/linux/remoteproc.h | 6 +-
4 files changed, 215 insertions(+), 161 deletions(-)

--
2.25.1


2022-06-01 20:09:07

by Mathieu Poirier

[permalink] [raw]
Subject: Re: [RFC PATCH v5 0/4] remoteproc: restructure the remoteproc VirtIO device

I have started looking at this set. Comments to follow in the coming days.

Thanks,
Mathieu

On Wed, Apr 06, 2022 at 11:54:42AM +0200, Arnaud Pouliquen wrote:
> 1) Update from V4 [1]:
>
> Minor updates based on Mathieu's comments.
> Updates are listed in the commit message of each patch.
>
> [1] https://lkml.org/lkml/2022/3/14/1177
>
> 2) Patchset description:
>
> This series is a part of the work initiated a long time ago in
> the series "remoteproc: Decorelate virtio from core"[2]
>
> Objective of the work:
> - Update the remoteproc VirtIO device creation (use platform device)
> - Allow to declare remoteproc VirtIO device in DT
> - declare resources associated to a remote proc VirtIO
> - declare a list of VirtIO supported by the platform.
> - Prepare the enhancement to more VirtIO devices (e.g I2C, audio, video, ...).
> For instance be able to declare a I2C device in a virtio-i2C node.
> - Keep the legacy working!
> - Try to improve the picture about concerns reported by Christoph Hellwing [3][4]
>
> [2] https://lkml.org/lkml/2020/4/16/1817
> [3] https://lkml.org/lkml/2021/6/23/607
> [4] https://patchwork.kernel.org/project/linux-remoteproc/patch/[email protected]/
>
> In term of device tree this would result in such hierarchy (stm32mp1 example with 2 virtio RPMSG):
>
> m4_rproc: m4@10000000 {
> compatible = "st,stm32mp1-m4";
> reg = <0x10000000 0x40000>,
> <0x30000000 0x40000>,
> <0x38000000 0x10000>;
> memory-region = <&retram>, <&mcuram>,<&mcuram2>;
> mboxes = <&ipcc 2>, <&ipcc 3>;
> mbox-names = "shutdown", "detach";
> status = "okay";
>
> #address-cells = <1>;
> #size-cells = <0>;
>
> vdev@0 {
> compatible = "rproc-virtio";
> reg = <0>;
> virtio,id = <7>; /* RPMSG */
> memory-region = <&vdev0vring0>, <&vdev0vring1>, <&vdev0buffer>;
> mboxes = <&ipcc 0>, <&ipcc 1>;
> mbox-names = "vq0", "vq1";
> status = "okay";
> };
>
> vdev@1 {
> compatible = "rproc-virtio";
> reg = <1>;
> virtio,id = <7>; /*RPMSG */
> memory-region = <&vdev1vring0>, <&vdev1vring1>, <&vdev1buffer>;
> mboxes = <&ipcc 4>, <&ipcc 5>;
> mbox-names = "vq0", "vq1";
> status = "okay";
> };
> };
>
> I have divided the work in 4 steps to simplify the review, This series implements only
> the step 1:
> step 1: redefine the remoteproc VirtIO device as a platform device
> - migrate rvdev management in remoteproc virtio.c,
> - create a remotproc virtio config ( can be disabled for platform that not use VirtIO IPC.
> step 2: add possibility to declare and probe a VirtIO sub node
> - VirtIO bindings declaration,
> - multi DT VirtIO devices support,
> - introduction of a remote proc virtio bind device mechanism ,
> => https://github.com/arnopo/linux/commits/step2-virtio-in-DT
> step 3: Add memory declaration in VirtIO subnode
> => https://github.com/arnopo/linux/commits/step3-virtio-memories
> step 4: Add mailbox declaration in VirtIO subnode
> => https://github.com/arnopo/linux/commits/step4-virtio-mailboxes
>
> Arnaud Pouliquen (4):
> remoteproc: core: Introduce virtio device add/remove functions
> remoteproc: core: Introduce rproc_register_rvdev function
> remoteproc: Move rproc_vdev management to remoteproc_virtio.c
> remoteproc: virtio: Create platform device for the remoteproc_virtio
>
> drivers/remoteproc/remoteproc_core.c | 154 +++---------------
> drivers/remoteproc/remoteproc_internal.h | 23 ++-
> drivers/remoteproc/remoteproc_virtio.c | 193 ++++++++++++++++++++---
> include/linux/remoteproc.h | 6 +-
> 4 files changed, 215 insertions(+), 161 deletions(-)
>
> --
> 2.25.1
>