All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
To: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	"Rafael J . Wysocki"
	<rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org>,
	Kevin Hilman <khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Rajendra Nayak <rnayak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Stanimir Varbanov
	<stanimir.varbanov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Marek Szyprowski
	<m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	"linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [RFC PATCH 0/4] PM / Domains: Add support for explicit control of PM domains
Date: Wed, 3 May 2017 08:43:46 +0200	[thread overview]
Message-ID: <CAMuHMdXr6-pKb0wRfs0_HhNp75ikGOtd-n2mEY-fvVJhaU5idg@mail.gmail.com> (raw)
In-Reply-To: <CAPDyKFrg+L_U6ztzpUdQMuemXyPWvtWVt06GumXa1MoTjJesWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Ulf,

On Wed, Apr 26, 2017 at 11:55 AM, Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> On 26 April 2017 at 11:17, Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> wrote:
>> On Wed, Apr 26, 2017 at 11:04 AM, Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>>> On 26 April 2017 at 10:06, Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> wrote:
>>>> On Tue, Apr 25, 2017 at 9:34 PM, Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>>>>> However, we currently know about at least two different SoCs that need
>>>>> this. Perhaps we can extend the below list to justify adding a new
>>>>> framework/APIs. Something along the lines what you propose in $subject
>>>>> patchset.
>>>>>
>>>>> 1) Nvidia; to solve the USB super-speed host/device problem.
>>>>> 2) QCOM, which has pointed to several cases where the PM topology is
>>>>> laid out like devices having two PM domains..
>>>>> 3?) I don't fully remember - but I think Geert also pointed to some
>>>>> examples where a device could reside in a clock domain but also in
>>>>> power domain for a Renesas SoC!?
>>>>> 4) ?
>>>>
>>>> Most Renesas SoCs have module clocks, which we model as a clock domain.
>>>> Some Renesas SoCs have power domains for CPUs, others have them for
>>>> devices as well.
>>>> As we always provide a virtual "always-on" power domain in the power domain
>>>> controller, all devices can refer to it using "power-domains" properties,
>>>> and the driver for the power domain controller can just forward the clock
>>>> domain operations to the clock driver.
>>>
>>> Okay, thanks for clarifying this.
>>>
>>> Thinking about this as bit more, when I realized that *if* we would
>>> add a new PM domain framework for explicit control of PM domains, that
>>> would mean you need to deploy support for that in the drivers.
>>
>> Correct.  And we have to update DT bindings and DTS.
>>
>>> On the other hand, as you anyway would need to change the drivers, you
>>> could instead deploy clock support in the drivers, which would avoid
>>> using the clock domain. In that way, you could still stay with one PM
>>> domain pointer per device, used to control the power domains instead.
>>> Right? Or would that have other implications?
>>
>> That's exactly what we're doing already.
>
> No really, but perhaps I was not clear enough.
>
> Currently you deploy only runtime PM support in the driver and don't
> do any clk_get() etc. Then you have a PM domain (genpd) attached to
> the device and makes use of genpd's device specific callbacks, in
> struct gpd_dev_ops ->start|stop(), which allows you to control clocks
> for each device. Of course this is perfectly okay.

OK.

> So then my question is/was; does there exist cases when these devices
> (already attached to a PM domain) would needed to be attach to yet
> another separate PM domain? From the nicely detailed description
> below, I find the answer to be *no*!?

Apart from the SYSC power areas and the CPG/MSSR clock domain
we don't have a use case for multiple power domains.

>> Which means that if you allow multiple entries in power-domains, we
>> have to change drivers, DT bindings, and DTS again (which we may
>> decide not to do ;-)
>>
>> On SH/R-Mobile, we always did it that way, as the user manual had an
>> explicit "always-on" power domain.
>>
>> On R-Car Gen2, the power domains contain CPU and L2 and GPU only,
>> so devices had their power-domains pointing to the clock controller.
>>
>> On R-Car Gen3, some devices were moved into power domains, so we
>> generalized this by creating a virtual "always-on" power domain, and
>> letting all devices point their power-domains properties to the power
>> domain controller, which forwards clock handling to the clock controller.
>> For consistency, this was applied to R-Car Gen2 as well.
>>
>> Cfr. some late relics fixed in e.g. commit 24b2d930a50662c1
>> ('ARM: dts: r8a7794: Use SYSC "always-on" PM Domain for sound'),
>> but technically the fix was not needed, as it worked fine without.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

WARNING: multiple messages have this Message-ID (diff)
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Jon Hunter <jonathanh@nvidia.com>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Kevin Hilman <khilman@kernel.org>,
	Rajendra Nayak <rnayak@codeaurora.org>,
	Stanimir Varbanov <stanimir.varbanov@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [RFC PATCH 0/4] PM / Domains: Add support for explicit control of PM domains
Date: Wed, 3 May 2017 08:43:46 +0200	[thread overview]
Message-ID: <CAMuHMdXr6-pKb0wRfs0_HhNp75ikGOtd-n2mEY-fvVJhaU5idg@mail.gmail.com> (raw)
In-Reply-To: <CAPDyKFrg+L_U6ztzpUdQMuemXyPWvtWVt06GumXa1MoTjJesWg@mail.gmail.com>

Hi Ulf,

On Wed, Apr 26, 2017 at 11:55 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 26 April 2017 at 11:17, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> On Wed, Apr 26, 2017 at 11:04 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>> On 26 April 2017 at 10:06, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>>>> On Tue, Apr 25, 2017 at 9:34 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>>>> However, we currently know about at least two different SoCs that need
>>>>> this. Perhaps we can extend the below list to justify adding a new
>>>>> framework/APIs. Something along the lines what you propose in $subject
>>>>> patchset.
>>>>>
>>>>> 1) Nvidia; to solve the USB super-speed host/device problem.
>>>>> 2) QCOM, which has pointed to several cases where the PM topology is
>>>>> laid out like devices having two PM domains..
>>>>> 3?) I don't fully remember - but I think Geert also pointed to some
>>>>> examples where a device could reside in a clock domain but also in
>>>>> power domain for a Renesas SoC!?
>>>>> 4) ?
>>>>
>>>> Most Renesas SoCs have module clocks, which we model as a clock domain.
>>>> Some Renesas SoCs have power domains for CPUs, others have them for
>>>> devices as well.
>>>> As we always provide a virtual "always-on" power domain in the power domain
>>>> controller, all devices can refer to it using "power-domains" properties,
>>>> and the driver for the power domain controller can just forward the clock
>>>> domain operations to the clock driver.
>>>
>>> Okay, thanks for clarifying this.
>>>
>>> Thinking about this as bit more, when I realized that *if* we would
>>> add a new PM domain framework for explicit control of PM domains, that
>>> would mean you need to deploy support for that in the drivers.
>>
>> Correct.  And we have to update DT bindings and DTS.
>>
>>> On the other hand, as you anyway would need to change the drivers, you
>>> could instead deploy clock support in the drivers, which would avoid
>>> using the clock domain. In that way, you could still stay with one PM
>>> domain pointer per device, used to control the power domains instead.
>>> Right? Or would that have other implications?
>>
>> That's exactly what we're doing already.
>
> No really, but perhaps I was not clear enough.
>
> Currently you deploy only runtime PM support in the driver and don't
> do any clk_get() etc. Then you have a PM domain (genpd) attached to
> the device and makes use of genpd's device specific callbacks, in
> struct gpd_dev_ops ->start|stop(), which allows you to control clocks
> for each device. Of course this is perfectly okay.

OK.

> So then my question is/was; does there exist cases when these devices
> (already attached to a PM domain) would needed to be attach to yet
> another separate PM domain? From the nicely detailed description
> below, I find the answer to be *no*!?

Apart from the SYSC power areas and the CPG/MSSR clock domain
we don't have a use case for multiple power domains.

>> Which means that if you allow multiple entries in power-domains, we
>> have to change drivers, DT bindings, and DTS again (which we may
>> decide not to do ;-)
>>
>> On SH/R-Mobile, we always did it that way, as the user manual had an
>> explicit "always-on" power domain.
>>
>> On R-Car Gen2, the power domains contain CPU and L2 and GPU only,
>> so devices had their power-domains pointing to the clock controller.
>>
>> On R-Car Gen3, some devices were moved into power domains, so we
>> generalized this by creating a virtual "always-on" power domain, and
>> letting all devices point their power-domains properties to the power
>> domain controller, which forwards clock handling to the clock controller.
>> For consistency, this was applied to R-Car Gen2 as well.
>>
>> Cfr. some late relics fixed in e.g. commit 24b2d930a50662c1
>> ('ARM: dts: r8a7794: Use SYSC "always-on" PM Domain for sound'),
>> but technically the fix was not needed, as it worked fine without.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  parent reply	other threads:[~2017-05-03  6:43 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28 14:13 [RFC PATCH 0/4] PM / Domains: Add support for explicit control of PM domains Jon Hunter
2017-03-28 14:13 ` Jon Hunter
2017-03-28 14:14 ` [RFC PATCH 1/4] PM / Domains: Prepare for supporting explicit PM domain control Jon Hunter
2017-03-28 14:14   ` Jon Hunter
2017-03-28 14:14 ` [RFC PATCH 2/4] PM / Domains: Add support for explicit control of PM domains Jon Hunter
2017-03-28 14:14   ` Jon Hunter
     [not found]   ` <1490710443-27425-3-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-04-10  4:09     ` Rajendra Nayak
2017-04-10  4:09       ` Rajendra Nayak
2017-04-10  8:24       ` Jon Hunter
2017-04-10  8:24         ` Jon Hunter
     [not found]         ` <3135e238-48a3-3693-bb59-63bf2a6d8d0e-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-04-10 10:02           ` Rajendra Nayak
2017-04-10 10:02             ` Rajendra Nayak
2017-04-10 19:48             ` Jon Hunter
2017-04-10 19:48               ` Jon Hunter
2017-03-28 14:14 ` [RFC PATCH 3/4] PM / Domains: Add OF helpers for getting " Jon Hunter
2017-03-28 14:14   ` Jon Hunter
     [not found] ` <1490710443-27425-1-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-03-28 14:14   ` [RFC PATCH 4/4] dt-bindings: Add support for devices with multiple " Jon Hunter
2017-03-28 14:14     ` Jon Hunter
2017-04-10  4:12     ` Rajendra Nayak
     [not found]       ` <3f96256d-0de5-26a2-e656-7912e06806ea-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-04-10  8:24         ` Jon Hunter
2017-04-10  8:24           ` Jon Hunter
2017-04-25 11:13   ` [RFC PATCH 0/4] PM / Domains: Add support for explicit control of " Jon Hunter
2017-04-25 11:13     ` Jon Hunter
     [not found]     ` <d2e3ceaa-57e2-033d-ecd1-a3b2bd8ffa26-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-04-25 19:34       ` Ulf Hansson
2017-04-25 19:34         ` Ulf Hansson
     [not found]         ` <CAPDyKFoJ58pwGz2U90ob8a8cY=hEbE-wLBHZ0BBzqPoLW_wgGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-25 21:17           ` Rafael J. Wysocki
2017-04-25 21:17             ` Rafael J. Wysocki
     [not found]             ` <CAJZ5v0gMzN_zfC_2nnRtYFyFon3-_mnioQhNbDP0wsr91RnagA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-02 10:10               ` Jon Hunter
2017-05-02 10:10                 ` Jon Hunter
     [not found]                 ` <ffe13074-9113-0a20-0fa6-76d0209dadfc-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-05-02 21:51                   ` Rafael J. Wysocki
2017-05-02 21:51                     ` Rafael J. Wysocki
2017-05-03  8:12                     ` Ulf Hansson
     [not found]                       ` <CAPDyKFokVKZfRAsEAB6ihx1FxW4JjarionyOwCATr3s+QW4aMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-03  8:32                         ` Jon Hunter
2017-05-03  8:32                           ` Jon Hunter
2017-05-03  8:32                           ` Jon Hunter
     [not found]                           ` <b4e8fd34-e2f0-165d-aa22-32ba43a8dbed-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-05-03 13:43                             ` Ulf Hansson
2017-05-03 13:43                               ` Ulf Hansson
     [not found]                               ` <CAPDyKFo-hfwbrY+AEMt0=fMshiT-BWvYDvGkKGqquTdowUvWHw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-03 14:57                                 ` Jon Hunter
2017-05-03 14:57                                   ` Jon Hunter
2017-05-03 17:12                                   ` Ulf Hansson
2017-05-04  8:44                                     ` Jon Hunter
2017-05-30  3:41                                       ` Rajendra Nayak
     [not found]                                         ` <5fcfeda6-f95c-cdaa-73a5-5c7499a3f9f5-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-10-09 16:36                                           ` Todor Tomov
2017-10-09 16:36                                             ` Todor Tomov
     [not found]                                             ` <72397ec8-d169-c5b1-2120-459031b35d48-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-10-10  9:13                                               ` Jon Hunter
2017-10-10  9:13                                                 ` Jon Hunter
     [not found]                     ` <1832647.f77WMLkdQb-yvgW3jdyMHm1GS7QM15AGw@public.gmane.org>
2017-05-03  8:12                       ` Jon Hunter
2017-05-03  8:12                         ` Jon Hunter
2017-04-26  8:06         ` Geert Uytterhoeven
     [not found]           ` <CAMuHMdWvS6_Zf1nn1=zVLb1qNChyk+B6BDZsK9P9oKRBEpPKMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-26  9:04             ` Ulf Hansson
2017-04-26  9:04               ` Ulf Hansson
     [not found]               ` <CAPDyKFqqZPXpxCTDy079QeiAorLVrXZssQ5SvXLWa3oab21b5g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-26  9:17                 ` Geert Uytterhoeven
2017-04-26  9:17                   ` Geert Uytterhoeven
     [not found]                   ` <CAMuHMdWNnWdYop_U4BGznxDND3WK-V7hnCBbnPoUDzUHBBpgHA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-26  9:55                     ` Ulf Hansson
2017-04-26  9:55                       ` Ulf Hansson
     [not found]                       ` <CAPDyKFrg+L_U6ztzpUdQMuemXyPWvtWVt06GumXa1MoTjJesWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-03  6:43                         ` Geert Uytterhoeven [this message]
2017-05-03  6:43                           ` Geert Uytterhoeven
     [not found]                           ` <CAMuHMdXr6-pKb0wRfs0_HhNp75ikGOtd-n2mEY-fvVJhaU5idg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-03  8:54                             ` Geert Uytterhoeven
2017-05-03  8:54                               ` Geert Uytterhoeven

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=CAMuHMdXr6-pKb0wRfs0_HhNp75ikGOtd-n2mEY-fvVJhaU5idg@mail.gmail.com \
    --to=geert-td1emuhucqxl1znqvxdv9g@public.gmane.org \
    --cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org \
    --cc=rnayak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=stanimir.varbanov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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.