linux-remoteproc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Paul Cercueil <paul@crapouillou.net>
Cc: Suman Anna <s-anna@ti.com>, Ohad Ben-Cohen <ohad@wizery.com>,
	Arnaud Pouliquen <arnaud.pouliquen@st.com>,
	Loic Pallardy <loic.pallardy@st.com>,
	od@zcrc.me, linux-remoteproc@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Tero Kristo <t-kristo@ti.com>
Subject: Re: [PATCH v7 3/5] remoteproc: Add support for runtime PM
Date: Wed, 10 Jun 2020 21:39:51 -0700	[thread overview]
Message-ID: <20200611043951.GA3251@builder.lan> (raw)
In-Reply-To: <VUEPBQ.GMXO6YRLF7N22@crapouillou.net>

On Wed 10 Jun 02:40 PDT 2020, Paul Cercueil wrote:

> Hi,
> 
> Le lun. 8 juin 2020 à 18:10, Suman Anna <s-anna@ti.com> a écrit :
> > Hi Paul,
> > 
> > On 6/8/20 5:46 PM, Paul Cercueil wrote:
> > > Hi Suman,
> > > 
> > > > > > On 5/15/20 5:43 AM, Paul Cercueil wrote:
> > > > > > > Call pm_runtime_get_sync() before the firmware is loaded, and
> > > > > > > pm_runtime_put() after the remote processor has been stopped.
> > > > > > > 
> > > > > > > Even though the remoteproc device has no PM
> > > > > > > callbacks, this allows the
> > > > > > > parent device's PM callbacks to be properly called.
> > > > > > 
> > > > > > I see this patch staged now for 5.8, and the latest
> > > > > > -next branch \x7f\x7f\x7f\x7fhas \x7f\x7fbroken the pm-runtime autosuspend
> > > > > > feature we have in the \x7f\x7f\x7f\x7fOMAP \x7f\x7fremoteproc driver. See
> > > > > > commit 5f31b232c674 ("remoteproc/omap: \x7f\x7f\x7f\x7fAdd \x7f\x7fsupport
> > > > > > for runtime auto-suspend/resume").
> > > > > > 
> > > > > > What was the original purpose of this patch, because
> > > > > > there can be \x7f\x7f\x7f\x7f\x7f\x7fdiffering backends across different
> > > > > > SoCs.
> > > > > 
> > > > > Did you try pm_suspend_ignore_children()? It looks like it
> > > > > was made \x7f\x7f\x7ffor \x7fyour use-case.
> > > > 
> > > > Sorry for the delay in getting back. So, using
> > > > \x7f\x7fpm_suspend_ignore_children() does fix my current issue.
> > > > 
> > > > But I still fail to see the original purpose of this patch in
> > > > the \x7f\x7fremoteproc core especially given that the core itself does
> > > > not have \x7f\x7fany callbacks. If the sole intention was to call the
> > > > parent pdev's \x7f\x7fcallbacks, then I feel that state-machine is
> > > > better managed within \x7f\x7fthat particular platform driver itself,
> > > > as the sequencing/device \x7f\x7fmanagement can vary with different
> > > > platform drivers.
> > > 
> > > The problem is that with Ingenic SoCs some clocks must be enabled in
> > > \x7forder to load the firmware, and the core doesn't give you an option
> > > to \x7fregister a callback to be called before loading it.
> > 
> > Yep, I have similar usage in one of my remoteproc drivers (see
> > keystone_remoteproc.c), and I think this all stems from the need to
> > use/support loading into a processor's internal memories. My driver does
> > leverage the pm-clks backend plugged into pm_runtime, so you won't see
> > explicit calls on the clocks.
> > 
> > I guess the question is what exact PM features you are looking for with
> > the Ingenic SoC. I do see you are using pm_runtime autosuspend, and your
> > callbacks are managing the clocks, but reset is managed only in
> > start/stop.
> > 
> > > The first version of \x7fmy patchset added .prepare/.unprepare
> > > callbacks to the struct rproc_ops, \x7fbut the feedback from the
> > > maintainers was that I should do it via \x7fruntime PM. However, it was
> > > not possible to keep it contained in the \x7fdriver, since again the
> > > core doesn't provide a "prepare" callback, so no \x7fplace to call
> > > pm_runtime_get_sync().
> > FWIW, the .prepare/.unprepare callbacks is actually now part of the
> > rproc core. Looks like multiple developers had a need for this, and this
> > functionality went in at the same time as your driver :). Not sure if
> > you looked up the prior patches, I leveraged the patch that Loic had
> > submitted a long-time ago, and a revised version of it is now part of
> > 5.8-rc1.
> 
> WTF maintainers, you refuse my patchset for adding a .prepare/.unprepare,
> ask me to do it via runtime PM, then merge another patchset that adds these
> callback. At least be constant in your decisions.
> 

Sorry, I missed this when applying the two patches, but you're of course
right.

> Anyway, now we have two methods added to linux-next for doing the exact same
> thing. What should we do about it?
> 

I like the pm_runtime approach and as it was Arnaud that asked you to
change it, perhaps he and Loic can agree on updating the ST driver so we
can drop the prepare/unprepare ops again?

Regards,
Bjorn

  reply	other threads:[~2020-06-11  4:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15 10:43 [PATCH v7 1/5] dt-bindings: Document JZ47xx VPU auxiliary processor Paul Cercueil
2020-05-15 10:43 ` [PATCH v7 2/5] remoteproc: Add device-managed variants of rproc_alloc/rproc_add Paul Cercueil
2020-05-15 10:43 ` [PATCH v7 3/5] remoteproc: Add support for runtime PM Paul Cercueil
2020-05-22 16:47   ` Suman Anna
2020-05-22 17:11     ` Paul Cercueil
2020-06-08 22:03       ` Suman Anna
2020-06-08 22:46         ` Paul Cercueil
2020-06-08 23:10           ` Suman Anna
2020-06-10  9:40             ` Paul Cercueil
2020-06-11  4:39               ` Bjorn Andersson [this message]
2020-06-11 21:17                 ` Suman Anna
2020-06-22 17:51                   ` Arnaud POULIQUEN
2020-05-15 10:43 ` [PATCH v7 4/5] remoteproc: ingenic: Added remoteproc driver Paul Cercueil
2020-05-18 23:57   ` Bjorn Andersson
2020-06-11 21:47   ` Suman Anna
2020-06-11 22:21     ` Paul Cercueil
2020-06-12  0:21       ` Suman Anna
2020-06-12 11:47         ` Paul Cercueil
2020-06-12 14:47           ` Suman Anna
2020-06-21 19:30           ` Bjorn Andersson
2020-06-24 23:14             ` Mathieu Poirier
2020-05-15 10:43 ` [PATCH v7 5/5] MAINTAINERS: Add myself as reviewer for Ingenic rproc driver Paul Cercueil

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=20200611043951.GA3251@builder.lan \
    --to=bjorn.andersson@linaro.org \
    --cc=arnaud.pouliquen@st.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=loic.pallardy@st.com \
    --cc=od@zcrc.me \
    --cc=ohad@wizery.com \
    --cc=paul@crapouillou.net \
    --cc=s-anna@ti.com \
    --cc=t-kristo@ti.com \
    /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).