diff mbox

[2/4] clk: renesas: mstp: Use always-on governor for Clock Domain

Message ID 1461654582-668-3-git-send-email-geert+renesas@glider.be (mailing list archive)
State Not Applicable, archived
Delegated to: Stephen Boyd
Headers show

Commit Message

Geert Uytterhoeven April 26, 2016, 7:09 a.m. UTC
As a pure Clock Domain does not have the concept of powering the domain
itself, the CPG/MSTP driver does not provide power_off() and power_on()
callbacks.
However, the genpd core may still perform a dummy power down, causing
/sys/kernel/debug/pm_genpd/pm_genpd_summary to report the domain's
status being "off-0".

Use the always-on governor to make sure the domain is never powered
down, and always shows up as "on" in pm_genpd_summary.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/clk/renesas/clk-mstp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ulf Hansson April 27, 2016, 1:59 p.m. UTC | #1
On 26 April 2016 at 09:09, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> As a pure Clock Domain does not have the concept of powering the domain
> itself, the CPG/MSTP driver does not provide power_off() and power_on()
> callbacks.
> However, the genpd core may still perform a dummy power down, causing
> /sys/kernel/debug/pm_genpd/pm_genpd_summary to report the domain's
> status being "off-0".
>
> Use the always-on governor to make sure the domain is never powered
> down, and always shows up as "on" in pm_genpd_summary.

Hmm.

Hypothetically, what if the clock domain would be a subdomain, where
its master is able to power down? Using the always on governor would
prevent the master from power off as well.

I am wondering whether we should introduce some similar as
pm_runtime_no_callbacks() but for the generic PM domain instead.

What do you think?

>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  drivers/clk/renesas/clk-mstp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c
> index 969fbb61ab07b9b8..5093a250650dad6d 100644
> --- a/drivers/clk/renesas/clk-mstp.c
> +++ b/drivers/clk/renesas/clk-mstp.c
> @@ -319,7 +319,7 @@ void __init cpg_mstp_add_clk_domain(struct device_node *np)
>         pd->flags = GENPD_FLAG_PM_CLK;
>         pd->attach_dev = cpg_mstp_attach_dev;
>         pd->detach_dev = cpg_mstp_detach_dev;
> -       pm_genpd_init(pd, &simple_qos_governor, false);
> +       pm_genpd_init(pd, &pm_domain_always_on_gov, false);
>
>         of_genpd_add_provider_simple(np, pd);
>  }
> --
> 1.9.1
>

Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven April 27, 2016, 2:04 p.m. UTC | #2
Hi Ulf,

On Wed, Apr 27, 2016 at 3:59 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 26 April 2016 at 09:09, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
>> As a pure Clock Domain does not have the concept of powering the domain
>> itself, the CPG/MSTP driver does not provide power_off() and power_on()
>> callbacks.
>> However, the genpd core may still perform a dummy power down, causing
>> /sys/kernel/debug/pm_genpd/pm_genpd_summary to report the domain's
>> status being "off-0".
>>
>> Use the always-on governor to make sure the domain is never powered
>> down, and always shows up as "on" in pm_genpd_summary.
>
> Hmm.
>
> Hypothetically, what if the clock domain would be a subdomain, where
> its master is able to power down? Using the always on governor would
> prevent the master from power off as well.

That's correct. However, on R-Mobile/R-Car SoCs, this is not the case, so it
doesn't matter here.

> I am wondering whether we should introduce some similar as
> pm_runtime_no_callbacks() but for the generic PM domain instead.
>
> What do you think?

In my case, the domain is not managed by its parent, to there's no such
analogy.

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
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ulf Hansson April 27, 2016, 2:07 p.m. UTC | #3
On 27 April 2016 at 16:04, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Hi Ulf,
>
> On Wed, Apr 27, 2016 at 3:59 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> On 26 April 2016 at 09:09, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
>>> As a pure Clock Domain does not have the concept of powering the domain
>>> itself, the CPG/MSTP driver does not provide power_off() and power_on()
>>> callbacks.
>>> However, the genpd core may still perform a dummy power down, causing
>>> /sys/kernel/debug/pm_genpd/pm_genpd_summary to report the domain's
>>> status being "off-0".
>>>
>>> Use the always-on governor to make sure the domain is never powered
>>> down, and always shows up as "on" in pm_genpd_summary.
>>
>> Hmm.
>>
>> Hypothetically, what if the clock domain would be a subdomain, where
>> its master is able to power down? Using the always on governor would
>> prevent the master from power off as well.
>
> That's correct. However, on R-Mobile/R-Car SoCs, this is not the case, so it
> doesn't matter here.
>
>> I am wondering whether we should introduce some similar as
>> pm_runtime_no_callbacks() but for the generic PM domain instead.
>>
>> What do you think?
>
> In my case, the domain is not managed by its parent, to there's no such
> analogy.

Ok, fair enough.

This looks good to me!

Kind regards
Uffe

>
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c
index 969fbb61ab07b9b8..5093a250650dad6d 100644
--- a/drivers/clk/renesas/clk-mstp.c
+++ b/drivers/clk/renesas/clk-mstp.c
@@ -319,7 +319,7 @@  void __init cpg_mstp_add_clk_domain(struct device_node *np)
 	pd->flags = GENPD_FLAG_PM_CLK;
 	pd->attach_dev = cpg_mstp_attach_dev;
 	pd->detach_dev = cpg_mstp_detach_dev;
-	pm_genpd_init(pd, &simple_qos_governor, false);
+	pm_genpd_init(pd, &pm_domain_always_on_gov, false);
 
 	of_genpd_add_provider_simple(np, pd);
 }