Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp44852pxb; Mon, 18 Oct 2021 20:09:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXha8GQvSbkUbGpacWvhVYR4IZsoIRXBJWFBU96HTcbW1cBlI6p9dj5mCzGSidy4tb3IfC X-Received: by 2002:a05:6402:1778:: with SMTP id da24mr49237767edb.318.1634612987267; Mon, 18 Oct 2021 20:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634612987; cv=none; d=google.com; s=arc-20160816; b=lCgUEBC4njA6qyRNl8er1aQDatBqOOUgktynUKxgT2+LevhevvmWSz/4Ci02nl+Mh/ 71xGo4/Ip4kjA3z1sYOA3yFy49nRhBVB5+s0I2i515etWVakEpyQiuM4v6VuV29aUJ0Q 7+FPTLLdN9Ka9BuhWeaY0T5/ViKNqcFph899fot6n1TT0RblSAjLyFk/sUL6ywWz0fbb elrqSR0ON/G+imAF06nxSdFtuFKWsuvWIko5QcAeGa7jbyfBG5aYTMUM+za1nqGcnZkn o5EnQDYw8c9vvsycANqGJvyH3DwAxgBVTo3ZIeqi4i9BWbWbMfkzNH2xmeFx3NoD/7Tw Ybbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ASSGMPImuuIUj7uz+ftmcXorRU78+ZHBGPyjATEUEfo=; b=xRNCuPfnL/lI25V9h8LA2IuV7wKeYzsUSn/vVFA/nnpCREExxv26/IJMtbskEo9bUY MSziMqYiYXL3QC/qgNdXY1y29EJmsGO1CQJ/nhJGZGrENCvuVJXjXy7CiOtY/s9ii9JG 06AQ39Ec8gs55L/awThZwG3Q01vVeIawxytU8K5Ybp8icZ9xoOnAsK033nWZsaEZ8hEP 8WAMrzItLBrM1LDYrX3rB5DgXsHKVeLyYrd/uQxQnY/QA1GKtOL5AtRIDuUivuqZn0kj FyzDqjkmiajWeBnNdAsicZoEdWVpOitAhccJ9MXULkMtDEVNSoTfKhmH4/bGdMPmry3H ZZ0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ox2299nA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gv8si22125364ejc.712.2021.10.18.20.09.24; Mon, 18 Oct 2021 20:09:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ox2299nA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231938AbhJSDJN (ORCPT + 99 others); Mon, 18 Oct 2021 23:09:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231893AbhJSDJM (ORCPT ); Mon, 18 Oct 2021 23:09:12 -0400 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A41EC06161C for ; Mon, 18 Oct 2021 20:07:00 -0700 (PDT) Received: by mail-oi1-x230.google.com with SMTP id o83so2767501oif.4 for ; Mon, 18 Oct 2021 20:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ASSGMPImuuIUj7uz+ftmcXorRU78+ZHBGPyjATEUEfo=; b=Ox2299nAE1pU/PWKgODFZpHzshOzObJFcqhUd2WPbUovkTzsbAMEPXCV0PorYRCOhs 3fBSM0TLiv+ZbELS428PdTjFzvmIJw6CJfHflvpW+J0UcqKQf2Y+6p4Fcguvsj2qB/aV g7cGaKUeGiVHZy7ay6dutbhy4dMwX/lCDQrDG60mMJTqsFOuAt8DyvQYExXdpypmEHNW khiOns6T3xDLtJEJYQ/AO1eKHRNED9iNYvlb0Ng9scxP1QinlRlgdcdF6zpra+dIy1G8 u4+Tgv+gbk7HtwwhvXaFjKGnwHqinyp5UN1tmrhqstyWaMeKeq7ay4eFqHJqdYh0ZE3s 6WKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ASSGMPImuuIUj7uz+ftmcXorRU78+ZHBGPyjATEUEfo=; b=aklZLaMEmouqJ7iHwRFQLbmAtoMgwRuJaN1XHJ0I0mfuBuaDK+0HNZIMOFCtEslkp7 pFD93DDXtD+O21vsfcmAgDtmtAVtGAm2GgRqPCSzQ0UsPkr4SrMfbZkFVmSvl5xpdkXi ejrMLcvk1Ej7wuIUqU7Mm6eNWyLA1Yf5fmO7YPKl1CtMpI3SXgMOPj08lekVa39LbOGY qG63XlLM+bHQalq6PmRz/oEEovPcbCdcSlSNkIdrzTvnfeK749o4t9+aN47UeHC67dSs EWnMoUY6VI/+uXDgeHADBk8dY9z/FlQY2DTLGGCklqNztNp5vXyflmoPHp7kgW6heg+n fjBA== X-Gm-Message-State: AOAM53308EFjwxjvlgJ+qFnKoIoO773eM9UBNODRvM/f3NOPsjU3zP7U haFQDQ6xQqB1lJ8sA+WlNpOvKA== X-Received: by 2002:aca:2406:: with SMTP id n6mr2131470oic.28.1634612819796; Mon, 18 Oct 2021 20:06:59 -0700 (PDT) Received: from ripper ([2600:1700:a0:3dc8:205:1bff:fec0:b9b3]) by smtp.gmail.com with ESMTPSA id e23sm3408844oih.40.2021.10.18.20.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 20:06:59 -0700 (PDT) Date: Mon, 18 Oct 2021 20:08:46 -0700 From: Bjorn Andersson To: Arnaud POULIQUEN Cc: Ohad Ben-Cohen , Mathieu Poirier , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: Re: [PATCH v5 3/4] rpmsg: Move the rpmsg control device from rpmsg_char to rpmsg_ctrl Message-ID: References: <20210712123752.10449-1-arnaud.pouliquen@foss.st.com> <20210712123752.10449-4-arnaud.pouliquen@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 18 Oct 02:13 PDT 2021, Arnaud POULIQUEN wrote: > > > On 10/16/21 6:46 AM, Bjorn Andersson wrote: > > On Mon 11 Oct 05:46 CDT 2021, Arnaud POULIQUEN wrote: > > > >> > >> > >> 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 > >>>> Reviewed-by: Mathieu Poirier > >>>> --- > >>>> 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 > >> > > > > Perhaps if this is considered a common piece shared between multiple > > rpmsg modules we can create such class in the rpmsg "core" itself? > > Yes that seems a good alternative > > > > >> 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/...? > >> > > > > If I read the uevent messages correctly they seem to contain a SUBSYTEM= > > property when the class is provided. But I'm not sure about the reasons > > for that. > > If it part of the udev requirement, i suppose that it is mandatory, and in this > case, declare the class in the core make sense. > I don't know if it's a requirement. But I think it's worth keeping the class around, as it's the only problem I've found with existing users. > I will send a new patchset that will squash all the remaining patches, taking > into account your comment. > Thanks, Bjorn > Thanks, > Arnaud > > > > > Regards, > > Bjorn > > > >> Thanks, > >> Arnaud > >> > >>> > >>> Regards, > >>> Bjorn > >>>