linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 00/10] Restructure the rpmsg_char driver and introduce rpmsg_ctrl driver.
@ 2021-10-22 12:54 Arnaud Pouliquen
  2021-10-22 12:54 ` [PATCH v6 01/10] rpmsg: char: Export eptdev create an destroy functions Arnaud Pouliquen
                   ` (9 more replies)
  0 siblings, 10 replies; 25+ messages in thread
From: Arnaud Pouliquen @ 2021-10-22 12:54 UTC (permalink / raw)
  To: Bjorn Andersson, Ohad Ben-Cohen, Mathieu Poirier
  Cc: linux-remoteproc, linux-kernel, linux-stm32, julien.massot,
	arnaud.pouliquen

Main update from V5 [1] 
This series is a re-merging of 3 series in one (I increased patchset version based on the first one):

- Restructure the rpmsg char to decorrelate the control part (v5) [1].
- Introduce a generic IOCTL interface for RPMsg channels management (V4) [2].
- rpmsg: ctrl: Introduce new RPMSG_CREATE/RELEASE_DEV_IOCTL controls (V3) [3]

With update based on Bjorn Andersson comments:
 - comment the use of the IS_REACHABLE macro
 - Migrate the creation of the rpmsg class from the rpmsg_char.c to rpmsg_core.c
 - refactor the rpmsg_chrdev_eptdev_create in two sub function to address potential race
   condition reported by Bjorn in rpmsg_chrdev_probe[4].

And a new patch to fix ns announcement on default endpoint creation.

Patchset description:

The current rpmsg_char module implements a /dev/rpmsg_ctrl interface that provides the ability to
instantiate char devices (/dev/rpmsgX) associated with an rpmsg endpoint for communication with the
remote processor.
This implementation fit with QCOM rpmsg backend but not with themagement by chanel implemented in 
the generic rpmsg virtio backend.
This series restructures the rpmsg_char driver to decorrelate the control part from the data part
in order to improve its compatible with the rpmsg virtio backend.

Objective:
- Expose a /dev/rpmsg_ctrlX interface for the application that is no longer dedicated to the
  rpmsg_char but generalized to all rpmsg services. This offers capability to create and destroy
  rpmsg channels from a user's application initiative (using the new RPMSG_CREATE_DEV_IOCTL and
  RPMSG_DESTROY_DEV_IOCTL controls).
  An application will be able to create/establish an rpmsg communication channel to communicate
  with the remote processor, and not only wait the remote processor initiative.
  This is interesting for example to establish a temporary communication link for diagnosis,
  calibration, debugging... or instantiate  new data flows on some user actions.
- Add capability to probe the rpmsg_char device at the initiative of the remote processor
 (rpmsg service announcement mechanism).
  This allows platforms based on the rpmsg virtio backend to create the /dev/rpmgX interface with
  a rpmsg name service announcement.

Subsets:
  - Extract the control part of the char dev and create the rpmsg_ctrl.c file (patches 1 to 4)
  - Introduce the "rpmsg-raw" channel in rpmsg_char(patches 5 to 8)
  - Introduce the RPMSG_CREATE_DEV_IOCTL IOCTL and RPMSG_DESTROY_DEV_IOCTL to instantiate RPMsg
    devices (patch 9)
    The application can then create or release a channel by specifying:
       - the name service of the device to instantiate.   
       - the source address.
       - the destination address.
  - Send a ns announcement to the remote processor on default endpoint creation (patche 10)

This series can be applied and tested on git/remoteproc/linux.git[5] for-next branch (6ee5808de074).

[1] https://lore.kernel.org/all/20210712123752.10449-1-arnaud.pouliquen@foss.st.com/
[2] https://lore.kernel.org/all/20210217132905.1485-1-arnaud.pouliquen@foss.st.com/
[3] https://lore.kernel.org/all/20210712132303.25058-1-arnaud.pouliquen@foss.st.com/
[4] https://lkml.org/lkml/2021/10/8/1158
[5] https://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux.git 

Arnaud Pouliquen (10):
  rpmsg: char: Export eptdev create an destroy functions
  rpmsg: create the rpmsg class in core instead of in rpmsg char
  rpmsg: Move the rpmsg control device from rpmsg_char to rpmsg_ctrl
  rpmsg: Update rpmsg_chrdev_register_device function
  rpmsg: char: Refactor rpmsg_chrdev_eptdev_create function
  rpmsg: Introduce rpmsg_create_default_ept function
  rpmsg: char: Add possibility to use default endpoint of the rpmsg
    device.
  rpmsg: char: Introduce the "rpmsg-raw" channel
  rpmsg: ctrl: Introduce new RPMSG_CREATE/RELEASE_DEV_IOCTL controls
  rpmsg: core: send a ns announcement when a default endpoint is created

 drivers/rpmsg/Kconfig             |   9 ++
 drivers/rpmsg/Makefile            |   1 +
 drivers/rpmsg/qcom_glink_native.c |   2 +-
 drivers/rpmsg/qcom_smd.c          |   2 +-
 drivers/rpmsg/rpmsg_char.c        | 247 +++++++++++-------------------
 drivers/rpmsg/rpmsg_char.h        |  59 +++++++
 drivers/rpmsg/rpmsg_core.c        |  88 ++++++++++-
 drivers/rpmsg/rpmsg_ctrl.c        | 245 +++++++++++++++++++++++++++++
 drivers/rpmsg/rpmsg_internal.h    |   8 +-
 drivers/rpmsg/virtio_rpmsg_bus.c  |   2 +-
 include/linux/rpmsg.h             |  23 +++
 include/uapi/linux/rpmsg.h        |  10 ++
 12 files changed, 530 insertions(+), 166 deletions(-)
 create mode 100644 drivers/rpmsg/rpmsg_char.h
 create mode 100644 drivers/rpmsg/rpmsg_ctrl.c

-- 
2.17.1


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

end of thread, other threads:[~2021-11-03 17:49 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22 12:54 [PATCH v6 00/10] Restructure the rpmsg_char driver and introduce rpmsg_ctrl driver Arnaud Pouliquen
2021-10-22 12:54 ` [PATCH v6 01/10] rpmsg: char: Export eptdev create an destroy functions Arnaud Pouliquen
2021-11-01 16:55   ` Bjorn Andersson
2021-11-02 14:52     ` Arnaud POULIQUEN
2021-10-22 12:54 ` [PATCH v6 02/10] rpmsg: create the rpmsg class in core instead of in rpmsg char Arnaud Pouliquen
2021-11-01 16:57   ` Bjorn Andersson
2021-11-02 15:23     ` Arnaud POULIQUEN
2021-11-02 16:38       ` Bjorn Andersson
2021-11-02 17:11         ` Arnaud POULIQUEN
2021-11-03 17:48           ` Bjorn Andersson
2021-10-22 12:54 ` [PATCH v6 03/10] rpmsg: Move the rpmsg control device from rpmsg_char to rpmsg_ctrl Arnaud Pouliquen
2021-11-01 17:07   ` Bjorn Andersson
2021-11-02 15:42     ` Arnaud POULIQUEN
2021-10-22 12:54 ` [PATCH v6 04/10] rpmsg: Update rpmsg_chrdev_register_device function Arnaud Pouliquen
2021-11-01 17:14   ` Bjorn Andersson
2021-10-22 12:54 ` [PATCH v6 05/10] rpmsg: char: Refactor rpmsg_chrdev_eptdev_create function Arnaud Pouliquen
2021-10-22 12:54 ` [PATCH v6 06/10] rpmsg: Introduce rpmsg_create_default_ept function Arnaud Pouliquen
2021-11-01 17:37   ` Bjorn Andersson
2021-11-02 16:56     ` Arnaud POULIQUEN
2021-11-03 16:57       ` Bjorn Andersson
2021-11-03 17:35         ` Arnaud POULIQUEN
2021-10-22 12:54 ` [PATCH v6 07/10] rpmsg: char: Add possibility to use default endpoint of the rpmsg device Arnaud Pouliquen
2021-10-22 12:54 ` [PATCH v6 08/10] rpmsg: char: Introduce the "rpmsg-raw" channel Arnaud Pouliquen
2021-10-22 12:54 ` [PATCH v6 09/10] rpmsg: ctrl: Introduce new RPMSG_CREATE/RELEASE_DEV_IOCTL controls Arnaud Pouliquen
2021-10-22 12:54 ` [PATCH v6 10/10] rpmsg: core: send a ns announcement when a default endpoint is created Arnaud Pouliquen

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).