[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f0696b4d-c0b6-5283-2eda-e5791462cbba@foss.st.com>
Date: Mon, 11 Oct 2021 12:46:47 +0200
From: Arnaud POULIQUEN <arnaud.pouliquen@...s.st.com>
To: Bjorn Andersson <bjorn.andersson@...aro.org>
CC: Ohad Ben-Cohen <ohad@...ery.com>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
<linux-remoteproc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>
Subject: Re: [PATCH v5 3/4] rpmsg: Move the rpmsg control device from
rpmsg_char to rpmsg_ctrl
On 10/9/21 1:35 AM, Bjorn Andersson wrote:
> On Mon 12 Jul 05:37 PDT 2021, Arnaud Pouliquen wrote:
>
>> Create the rpmsg_ctrl.c module and move the code related to the
>> rpmsg_ctrldev device in this new module.
>>
>> Add the dependency between rpmsg_char and rpmsg_ctrl in the
>> kconfig file.
>>
>
> As I said in the cover letter, the only reason I can see for doing this
> refactoring is in relation to the introduction of
> RPMSG_CREATE_DEV_IOCTL. So I would like this patch to go together with
> that patch, together with a good motivation why there's merit to
> creating yet another kernel module (and by bind/unbind can't be used).
>
> Perhaps I'm just missing some good usecase related to this?
>
>> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@...s.st.com>
>> Reviewed-by: Mathieu Poirier <mathieu.poirier@...aro.org>
>> ---
>> drivers/rpmsg/Kconfig | 9 ++
>> drivers/rpmsg/Makefile | 1 +
>> drivers/rpmsg/rpmsg_char.c | 170 +----------------------------
>> drivers/rpmsg/rpmsg_char.h | 2 +
>> drivers/rpmsg/rpmsg_ctrl.c | 215 +++++++++++++++++++++++++++++++++++++
>> 5 files changed, 229 insertions(+), 168 deletions(-)
>> create mode 100644 drivers/rpmsg/rpmsg_ctrl.c
>>
> [..]
>> diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c
> [..]
>> -static int rpmsg_chrdev_probe(struct rpmsg_device *rpdev)
>> -{
> [..]
>> - dev = &ctrldev->dev;
>> - device_initialize(dev);
>> - dev->parent = &rpdev->dev;
>> - dev->class = rpmsg_class;
> [..]
>> diff --git a/drivers/rpmsg/rpmsg_ctrl.c b/drivers/rpmsg/rpmsg_ctrl.c
> [..]
>> +static int rpmsg_ctrldev_probe(struct rpmsg_device *rpdev)
>> +{
> [..]
>> + dev = &ctrldev->dev;
>> + device_initialize(dev);
>> + dev->parent = &rpdev->dev;
>
> You lost the assignment of dev->class here, which breaks the udev rules
> we use to invoke rpmsgexport to create endpoints and it causes udevadm
> to complain that rpmsg_ctrlN doesn't have a "subsystem".
We discussed this point with Mathieu, as a first step i kept the class, but that
generated another dependency with the rpmsg_char device while information was
available on the rpmsg bus. The char device and ctrl device should share the
same class. As rpmsg_ctrl is created first it would have to create the class,and
provide an API to rpmsg char
Please could you details what does means "rpmsg_ctrlN doesn't have a
"subsystem"." What exactly the udev is looking for? could it base it check on
the /dev/rpmsg_ctrl0 or /sys/bus/rpmsg/devices/...?
Thanks,
Arnaud
>
> Regards,
> Bjorn
>
Powered by blists - more mailing lists