All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Rajendra Nayak <rnayak@codeaurora.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Stephen Boyd <swboyd@chromium.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Sandeep Maheswaram <quic_c_sanm@quicinc.com>,
	Rob Herring <robh+dt@kernel.org>, Andy Gross <agross@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Felipe Balbi <balbi@kernel.org>,
	Doug Anderson <dianders@chromium.org>,
	Matthias Kaehlcke <mka@chromium.org>,
	devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	quic_pkondeti@quicinc.com, quic_ppratap@quicinc.com
Subject: Re: [PATCH v2 1/3] dt-bindings: usb: qcom,dwc3: Add multi-pd bindings for dwc3 qcom
Date: Thu, 28 Oct 2021 09:53:14 -0700	[thread overview]
Message-ID: <YXrVevUlCJJtbpLi@ripper> (raw)
In-Reply-To: <e32a59e2-0d8b-3338-5963-81ea07a709ef@codeaurora.org>

On Thu 28 Oct 03:46 PDT 2021, Rajendra Nayak wrote:

> 
> On 10/28/2021 4:05 PM, Ulf Hansson wrote:
> > [...]
> > 
> > > > > > Got it. So in this case we could have the various display components
> > > > > > that are in the mdss gdsc domain set their frequency via OPP and then
> > > > > > have that translate to a level in CX or MMCX. How do we parent the power
> > > > > > domains outside of DT? I'm thinking that we'll need to do that if MMCX
> > > > > > is parented by CX or something like that and the drivers for those two
> > > > > > power domains are different. Is it basic string matching?
> > > > > 
> > > > > In one way or another we need to invoke pm_genpd_add_subdomain() to link
> > > > > the two power-domains (actually genpds) together, like what was done in
> > > > > 3652265514f5 ("clk: qcom: gdsc: enable optional power domain support").
> > > > > 
> > > > > In the case of MMCX and CX, my impression of the documentation is that
> > > > > they are independent - but if we need to express that CX is parent of
> > > > > MMCX, they are both provided by rpmhpd which already supports this by
> > > > > just specifying .parent on mmcx to point to cx.
> > > > 
> > > > I was trying to follow the discussion, but it turned out to be a bit
> > > > complicated to catch up and answer all things. In any case, let me
> > > > just add a few overall comments, perhaps that can help to move things
> > > > forward.
> > > > 
> > > > First, one domain can have two parent domains. Both from DT and from
> > > > genpd point of view, just to make this clear.
> > > > 
> > > > Although, it certainly looks questionable to me, to hook up the USB
> > > > device to two separate power domains, one to control power and one to
> > > > control performance. Especially, if it's really the same piece of HW
> > > > that is managing both things.
> > > []..
> > > > Additionally, if it's correct to model
> > > > the USB GDSC power domain as a child to the CX power domain from HW
> > > > point of view, we should likely do that.
> > > 
> > > I think this would still require a few things in genpd, since
> > > CX and USB GDSC are power domains from different providers.
> > > Perhaps a pm_genpd_add_subdomain_by_name()?
> > > 
> > 
> > I think of_genpd_add_subdomain() should help to address this. No?
> 
> We only describe the provider nodes in DT and not the individual power domains.
> For instance GCC is the power domain provider which is in DT, and USB GDSC is one
> of the many power domains it supports, similarly RPMHPD is the provider node in
> DT and CX is one of the many power domains it supports.
> So we would need some non-DT way of hooking up power domains from two different
> providers as parent/child.
> 

See 266e5cf39a0f ("arm64: dts: qcom: sm8250: remove mmcx regulator") and
3652265514f5 ("clk: qcom: gdsc: enable optional power domain support")

MMCX is declared as power-domain for the dispcc (which is correct
in itself) and the gdsc code will register GDSCs as subdomains of
the same power-domain.


To ensure this code path is invoked the clock driver itself needed this
6158b94ec807 ("clk: qcom: dispcc-sm8250: use runtime PM for the clock
controller")

So at least in theory, considering only USB the minimum would be to
pm_runtime_enable() gcc-7280 and add power-domains = <CX> to the gcc
node.


The "problem" I described would be if there are GDSCs that are
subdomains of MX - which I've seen hinted in some documentation. If so
we should to specify both CX and MX as power-domains for &gcc and the
gdsc implementation needs to be extended to allow us to select between
the two.

For this I believe a combination of genpd_dev_pm_attach_by_name() and
of_genpd_add_subdomain() would do the trick.

That is, if there actually are GDSCs exposed by gcc that are not
subdomains of CX - otherwise none of this is needed.

Regards,
Bjorn

  reply	other threads:[~2021-10-28 16:51 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25  9:07 [PATCH v2 0/3] USB DWC3 QCOM Multi power domain support Sandeep Maheswaram
2021-10-25  9:07 ` [PATCH v2 1/3] dt-bindings: usb: qcom,dwc3: Add multi-pd bindings for dwc3 qcom Sandeep Maheswaram
2021-10-25 18:16   ` Rob Herring
2021-10-25 19:10   ` Bjorn Andersson
2021-10-25 20:17     ` Stephen Boyd
2021-10-25 21:43       ` Bjorn Andersson
2021-10-25 22:41         ` Stephen Boyd
2021-10-26  2:48           ` Bjorn Andersson
2021-10-27  0:48             ` Stephen Boyd
2021-10-27  4:55               ` Bjorn Andersson
2021-10-27 14:24                 ` Ulf Hansson
2021-10-27 15:11                   ` Bjorn Andersson
2021-10-28 10:31                     ` Ulf Hansson
2021-10-28 16:42                       ` Bjorn Andersson
2021-10-28  3:56                   ` Rajendra Nayak
2021-10-28 10:35                     ` Ulf Hansson
2021-10-28 10:46                       ` Rajendra Nayak
2021-10-28 16:53                         ` Bjorn Andersson [this message]
2021-10-28 20:04                           ` Stephen Boyd
2021-10-29  0:21                             ` Bjorn Andersson
2021-10-29  9:48                               ` Rajendra Nayak
2022-01-17  6:03                     ` Sandeep Maheswaram
2022-01-19 11:01                       ` Rajendra Nayak
2022-01-31  5:04                         ` Sandeep Maheswaram
2022-02-04  9:09                           ` Rajendra Nayak
2021-10-25  9:07 ` [PATCH v2 2/3] usb: dwc3: qcom: Add multi-pd support Sandeep Maheswaram
2021-10-25  9:07 ` [PATCH v2 3/3] arm64: dts: qcom: sc7280: Add cx power domain support Sandeep Maheswaram
2021-10-25 22:25   ` Stephen Boyd

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=YXrVevUlCJJtbpLi@ripper \
    --to=bjorn.andersson@linaro.org \
    --cc=agross@kernel.org \
    --cc=balbi@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=quic_c_sanm@quicinc.com \
    --cc=quic_pkondeti@quicinc.com \
    --cc=quic_ppratap@quicinc.com \
    --cc=rnayak@codeaurora.org \
    --cc=robh+dt@kernel.org \
    --cc=swboyd@chromium.org \
    --cc=ulf.hansson@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.