linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephan Gerhold <stephan@gerhold.net>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Andy Gross <agross@kernel.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht,
	Ohad Ben-Cohen <ohad@wizery.com>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	linux-remoteproc@vger.kernel.org, phone-devel@vger.kernel.org,
	Aleksander Morgado <aleksander@aleksander.es>
Subject: Re: [PATCH 1/2] remoteproc: qcom_q6v5_mss: Populate additional devices from DT
Date: Wed, 1 Dec 2021 10:09:02 +0100	[thread overview]
Message-ID: <Yac7rvxHhWld1/s3@gerhold.net> (raw)
In-Reply-To: <Yabw7kCsbhE1EFhW@builder.lan>

On Tue, Nov 30, 2021 at 09:50:06PM -0600, Bjorn Andersson wrote:
> On Mon 29 Nov 07:29 CST 2021, Stephan Gerhold wrote:
> 
> > Some devices without own memory resources could be placed anywhere in the
> > device tree but they logically belong to the modem remote processor. Make
> > it possible to probe them when defined under the mpss device tree node
> > by calling of_platform_populate().
> > 
> 
> This seems reasonable, but other "child devices" of the remoteproc
> follows the state of the remoteproc instance. So I'm worried that this
> will create an inconsistency in that assumption.
> 

On Linux there are two devices managed by qcom_q6v5_mss, the platform
device used by the driver and the actual remoteproc instance that has
the state. The devices that follow the state are children of the
remoteproc instance. I'm creating BAM-DMUX below the platform device.

This is just not represented in the device tree very well since both
platform device and remoteproc instance share the same device tree node.
However, all the state managed nodes are manually managed and do not
have a compatible so it should not cause problems.

> > This can be used for BAM-DMUX for example, which provides the WWAN network
> > interfaces on some older Qualcomm SoCs such as MSM8916 or MSM8974.
> > 
> 
> Is there a technical reason for placing the BAM-DMUX within the modem
> remoteproc node? Can we simply move it to / ?
> 

I had it at / originally and at the moment it would still work there.
I moved it below the remoteproc when the whole "WWAN subsystem"
discussion came up. The goal is to have a common parent device for all
the ports of a WWAN modem.

The way it works is that you give the WWAN subsystem a (parent) device
that represents the modem itself, and then it groups all WWAN ports
below that. The control ports (rpmsg_wwan_ctrl driver) are currently
already created below the modem platform device.

The bam-dmux driver does not integrate with the WWAN subsystem yet
because of some unrelated open problems, but in the future I will likely
need a reference to the modem platform device there as well.

There are other approaches of course (e.g. a phandle to the modem
remoteproc node), but I still think it logically fits best somewhere
below the modem node. If the modem remoteproc is status = "disabled",
it does not make sense to load bam-dmux either etc.

Thanks,
Stephan

> > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > ---
> >  drivers/remoteproc/qcom_q6v5_mss.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> > index 43ea8455546c..69f3d1ebf1f1 100644
> > --- a/drivers/remoteproc/qcom_q6v5_mss.c
> > +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> > @@ -1989,8 +1989,14 @@ static int q6v5_probe(struct platform_device *pdev)
> >  	if (ret)
> >  		goto remove_sysmon_subdev;
> >  
> > +	ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
> > +	if (ret)
> > +		goto remove_rproc;
> > +
> >  	return 0;
> >  
> > +remove_rproc:
> > +	rproc_del(rproc);
> >  remove_sysmon_subdev:
> >  	qcom_remove_sysmon_subdev(qproc->sysmon);
> >  remove_subdevs:
> > @@ -2010,6 +2016,7 @@ static int q6v5_remove(struct platform_device *pdev)
> >  	struct q6v5 *qproc = platform_get_drvdata(pdev);
> >  	struct rproc *rproc = qproc->rproc;
> >  
> > +	of_platform_depopulate(&pdev->dev);
> >  	rproc_del(rproc);
> >  
> >  	qcom_q6v5_deinit(&qproc->q6v5);
> > -- 
> > 2.34.1
> > 

  reply	other threads:[~2021-12-01  9:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 13:29 [PATCH 0/2] Enable BAM-DMUX/WWAN on Qualcomm MSM8916 Stephan Gerhold
2021-11-29 13:29 ` [PATCH 1/2] remoteproc: qcom_q6v5_mss: Populate additional devices from DT Stephan Gerhold
2021-12-01  3:50   ` Bjorn Andersson
2021-12-01  9:09     ` Stephan Gerhold [this message]
2021-11-29 13:29 ` [PATCH 2/2] arm64: dts: qcom: msm8916: Add BAM-DMUX for WWAN network interfaces Stephan Gerhold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yac7rvxHhWld1/s3@gerhold.net \
    --to=stephan@gerhold.net \
    --cc=agross@kernel.org \
    --cc=aleksander@aleksander.es \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=ohad@wizery.com \
    --cc=phone-devel@vger.kernel.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).