* [PATCH 0/2] renesas: sysc: Use GENPD_FLAG_ALWAYS_ON
@ 2017-06-12 9:23 Geert Uytterhoeven
2017-06-12 9:23 ` [PATCH 1/2] soc: renesas: rcar-sysc: " Geert Uytterhoeven
2017-06-12 9:23 ` [PATCH 2/2] ARM: shmobile: pm-rmobile: " Geert Uytterhoeven
0 siblings, 2 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2017-06-12 9:23 UTC (permalink / raw)
To: Simon Horman, Magnus Damm
Cc: Ulf Hansson, linux-renesas-soc, linux-pm, Geert Uytterhoeven
Hi Simon, Magnus,
Commit ffaa42e8a40b7f10 ("PM / Domains: Enable users of genpd to specify
always on PM domains") introduced a new flag GENPD_FLAG_ALWAYS_ON, which
allows to remove some code for drivers handling always-on PM domains.
This series does that for the Renesas R-Car SYSC driver (used on R-Car
Gen2 and Gen3, and RZ/G1) and the R-Mobile SYSC driver (used on R-Mobile
APE6 and A1, and SH-Mobile AG5).
Note that on R/SH-Mobile, the PM domain containing the serial console is
still handled locally.
Tested on:
- r8a7790/koelsch and r8a7795/salvator-x,
- r8a73a4/ape6evm, r8a7740/armadillo, sh73a0/kzm9g.
Thanks!
Geert Uytterhoeven (2):
soc: renesas: rcar-sysc: Use GENPD_FLAG_ALWAYS_ON
ARM: shmobile: pm-rmobile: Use GENPD_FLAG_ALWAYS_ON
arch/arm/mach-shmobile/pm-rmobile.c | 19 ++++---------------
drivers/soc/renesas/rcar-sysc.c | 28 ++++------------------------
drivers/soc/renesas/rcar-sysc.h | 2 --
3 files changed, 8 insertions(+), 41 deletions(-)
--
2.7.4
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] soc: renesas: rcar-sysc: Use GENPD_FLAG_ALWAYS_ON
2017-06-12 9:23 [PATCH 0/2] renesas: sysc: Use GENPD_FLAG_ALWAYS_ON Geert Uytterhoeven
@ 2017-06-12 9:23 ` Geert Uytterhoeven
2017-06-12 12:27 ` Ulf Hansson
2017-06-12 9:23 ` [PATCH 2/2] ARM: shmobile: pm-rmobile: " Geert Uytterhoeven
1 sibling, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2017-06-12 9:23 UTC (permalink / raw)
To: Simon Horman, Magnus Damm
Cc: Ulf Hansson, linux-renesas-soc, linux-pm, Geert Uytterhoeven
Improve handling of always-on PM domains by using the
GENPD_FLAG_ALWAYS_ON flag introduced in commit ffaa42e8a40b7f10 ("PM /
Domains: Enable users of genpd to specify always on PM domains").
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/soc/renesas/rcar-sysc.c | 28 ++++------------------------
drivers/soc/renesas/rcar-sysc.h | 2 --
2 files changed, 4 insertions(+), 26 deletions(-)
diff --git a/drivers/soc/renesas/rcar-sysc.c b/drivers/soc/renesas/rcar-sysc.c
index dcad5c42a5e81c87..7c8da3c90011422f 100644
--- a/drivers/soc/renesas/rcar-sysc.c
+++ b/drivers/soc/renesas/rcar-sysc.c
@@ -181,17 +181,6 @@ static int rcar_sysc_pd_power_off(struct generic_pm_domain *genpd)
struct rcar_sysc_pd *pd = to_rcar_pd(genpd);
pr_debug("%s: %s\n", __func__, genpd->name);
-
- if (pd->flags & PD_NO_CR) {
- pr_debug("%s: Cannot control %s\n", __func__, genpd->name);
- return -EBUSY;
- }
-
- if (pd->flags & PD_BUSY) {
- pr_debug("%s: %s busy\n", __func__, genpd->name);
- return -EBUSY;
- }
-
return rcar_sysc_power_down(&pd->ch);
}
@@ -200,12 +189,6 @@ static int rcar_sysc_pd_power_on(struct generic_pm_domain *genpd)
struct rcar_sysc_pd *pd = to_rcar_pd(genpd);
pr_debug("%s: %s\n", __func__, genpd->name);
-
- if (pd->flags & PD_NO_CR) {
- pr_debug("%s: Cannot control %s\n", __func__, genpd->name);
- return 0;
- }
-
return rcar_sysc_power_up(&pd->ch);
}
@@ -223,8 +206,7 @@ static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd)
* only be turned off if the CPU is not in use.
*/
pr_debug("PM domain %s contains %s\n", name, "CPU");
- pd->flags |= PD_BUSY;
- gov = &pm_domain_always_on_gov;
+ genpd->flags |= GENPD_FLAG_ALWAYS_ON;
} else if (pd->flags & PD_SCU) {
/*
* This domain contains an SCU and cache-controller, and
@@ -232,19 +214,17 @@ static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd)
* not in use.
*/
pr_debug("PM domain %s contains %s\n", name, "SCU");
- pd->flags |= PD_BUSY;
- gov = &pm_domain_always_on_gov;
+ genpd->flags |= GENPD_FLAG_ALWAYS_ON;
} else if (pd->flags & PD_NO_CR) {
/*
* This domain cannot be turned off.
*/
- pd->flags |= PD_BUSY;
- gov = &pm_domain_always_on_gov;
+ genpd->flags |= GENPD_FLAG_ALWAYS_ON;
}
if (!(pd->flags & (PD_CPU | PD_SCU))) {
/* Enable Clock Domain for I/O devices */
- genpd->flags = GENPD_FLAG_PM_CLK;
+ genpd->flags |= GENPD_FLAG_PM_CLK;
if (has_cpg_mstp) {
genpd->attach_dev = cpg_mstp_attach_dev;
genpd->detach_dev = cpg_mstp_detach_dev;
diff --git a/drivers/soc/renesas/rcar-sysc.h b/drivers/soc/renesas/rcar-sysc.h
index 07edb049a401196c..1a5bebaf54ba191c 100644
--- a/drivers/soc/renesas/rcar-sysc.h
+++ b/drivers/soc/renesas/rcar-sysc.h
@@ -20,8 +20,6 @@
#define PD_SCU BIT(1) /* Area contains SCU and L2 cache */
#define PD_NO_CR BIT(2) /* Area lacks PWR{ON,OFF}CR registers */
-#define PD_BUSY BIT(3) /* Busy, for internal use only */
-
#define PD_CPU_CR PD_CPU /* CPU area has CR (R-Car H1) */
#define PD_CPU_NOCR PD_CPU | PD_NO_CR /* CPU area lacks CR (R-Car Gen2/3) */
#define PD_ALWAYS_ON PD_NO_CR /* Always-on area */
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] ARM: shmobile: pm-rmobile: Use GENPD_FLAG_ALWAYS_ON
2017-06-12 9:23 [PATCH 0/2] renesas: sysc: Use GENPD_FLAG_ALWAYS_ON Geert Uytterhoeven
2017-06-12 9:23 ` [PATCH 1/2] soc: renesas: rcar-sysc: " Geert Uytterhoeven
@ 2017-06-12 9:23 ` Geert Uytterhoeven
2017-06-12 12:27 ` Ulf Hansson
1 sibling, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2017-06-12 9:23 UTC (permalink / raw)
To: Simon Horman, Magnus Damm
Cc: Ulf Hansson, linux-renesas-soc, linux-pm, Geert Uytterhoeven
Improve handling of always-on PM domains by using the
GENPD_FLAG_ALWAYS_ON flag introduced in commit ffaa42e8a40b7f10 ("PM /
Domains: Enable users of genpd to specify always on PM domains").
Note that the PM domain containing the serial console is still handled
locally.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
arch/arm/mach-shmobile/pm-rmobile.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c
index 175bd3d91ebcbcb4..e5fa6a3cf1ddf159 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.c
+++ b/arch/arm/mach-shmobile/pm-rmobile.c
@@ -130,7 +130,7 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
struct generic_pm_domain *genpd = &rmobile_pd->genpd;
struct dev_power_governor *gov = rmobile_pd->gov;
- genpd->flags = GENPD_FLAG_PM_CLK;
+ genpd->flags |= GENPD_FLAG_PM_CLK;
genpd->dev_ops.active_wakeup = rmobile_pd_active_wakeup;
genpd->power_off = rmobile_pd_power_down;
genpd->power_on = rmobile_pd_power_up;
@@ -140,14 +140,6 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
pm_genpd_init(genpd, gov ? : &simple_qos_governor, false);
}
-static int rmobile_pd_suspend_busy(void)
-{
- /*
- * This domain should not be turned off.
- */
- return -EBUSY;
-}
-
static int rmobile_pd_suspend_console(void)
{
/*
@@ -260,8 +252,7 @@ static void __init rmobile_setup_pm_domain(struct device_node *np,
* only be turned off if the CPU is not in use.
*/
pr_debug("PM domain %s contains CPU\n", name);
- pd->gov = &pm_domain_always_on_gov;
- pd->suspend = rmobile_pd_suspend_busy;
+ pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON;
break;
case PD_CONSOLE:
@@ -277,8 +268,7 @@ static void __init rmobile_setup_pm_domain(struct device_node *np,
* is not in use.
*/
pr_debug("PM domain %s contains Coresight-ETM\n", name);
- pd->gov = &pm_domain_always_on_gov;
- pd->suspend = rmobile_pd_suspend_busy;
+ pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON;
break;
case PD_MEMCTL:
@@ -287,8 +277,7 @@ static void __init rmobile_setup_pm_domain(struct device_node *np,
* should only be turned off if memory is not in use.
*/
pr_debug("PM domain %s contains MEMCTL\n", name);
- pd->gov = &pm_domain_always_on_gov;
- pd->suspend = rmobile_pd_suspend_busy;
+ pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON;
break;
case PD_NORMAL:
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] ARM: shmobile: pm-rmobile: Use GENPD_FLAG_ALWAYS_ON
2017-06-12 9:23 ` [PATCH 2/2] ARM: shmobile: pm-rmobile: " Geert Uytterhoeven
@ 2017-06-12 12:27 ` Ulf Hansson
2017-06-14 8:54 ` Simon Horman
0 siblings, 1 reply; 7+ messages in thread
From: Ulf Hansson @ 2017-06-12 12:27 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Simon Horman, Magnus Damm, Linux-Renesas, linux-pm
On 12 June 2017 at 11:23, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> Improve handling of always-on PM domains by using the
> GENPD_FLAG_ALWAYS_ON flag introduced in commit ffaa42e8a40b7f10 ("PM /
> Domains: Enable users of genpd to specify always on PM domains").
>
> Note that the PM domain containing the serial console is still handled
> locally.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Kind regards
Uffe
> ---
> arch/arm/mach-shmobile/pm-rmobile.c | 19 ++++---------------
> 1 file changed, 4 insertions(+), 15 deletions(-)
>
> diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c
> index 175bd3d91ebcbcb4..e5fa6a3cf1ddf159 100644
> --- a/arch/arm/mach-shmobile/pm-rmobile.c
> +++ b/arch/arm/mach-shmobile/pm-rmobile.c
> @@ -130,7 +130,7 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
> struct generic_pm_domain *genpd = &rmobile_pd->genpd;
> struct dev_power_governor *gov = rmobile_pd->gov;
>
> - genpd->flags = GENPD_FLAG_PM_CLK;
> + genpd->flags |= GENPD_FLAG_PM_CLK;
> genpd->dev_ops.active_wakeup = rmobile_pd_active_wakeup;
> genpd->power_off = rmobile_pd_power_down;
> genpd->power_on = rmobile_pd_power_up;
> @@ -140,14 +140,6 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
> pm_genpd_init(genpd, gov ? : &simple_qos_governor, false);
> }
>
> -static int rmobile_pd_suspend_busy(void)
> -{
> - /*
> - * This domain should not be turned off.
> - */
> - return -EBUSY;
> -}
> -
> static int rmobile_pd_suspend_console(void)
> {
> /*
> @@ -260,8 +252,7 @@ static void __init rmobile_setup_pm_domain(struct device_node *np,
> * only be turned off if the CPU is not in use.
> */
> pr_debug("PM domain %s contains CPU\n", name);
> - pd->gov = &pm_domain_always_on_gov;
> - pd->suspend = rmobile_pd_suspend_busy;
> + pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON;
> break;
>
> case PD_CONSOLE:
> @@ -277,8 +268,7 @@ static void __init rmobile_setup_pm_domain(struct device_node *np,
> * is not in use.
> */
> pr_debug("PM domain %s contains Coresight-ETM\n", name);
> - pd->gov = &pm_domain_always_on_gov;
> - pd->suspend = rmobile_pd_suspend_busy;
> + pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON;
> break;
>
> case PD_MEMCTL:
> @@ -287,8 +277,7 @@ static void __init rmobile_setup_pm_domain(struct device_node *np,
> * should only be turned off if memory is not in use.
> */
> pr_debug("PM domain %s contains MEMCTL\n", name);
> - pd->gov = &pm_domain_always_on_gov;
> - pd->suspend = rmobile_pd_suspend_busy;
> + pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON;
> break;
>
> case PD_NORMAL:
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] soc: renesas: rcar-sysc: Use GENPD_FLAG_ALWAYS_ON
2017-06-12 9:23 ` [PATCH 1/2] soc: renesas: rcar-sysc: " Geert Uytterhoeven
@ 2017-06-12 12:27 ` Ulf Hansson
2017-06-14 8:58 ` Simon Horman
0 siblings, 1 reply; 7+ messages in thread
From: Ulf Hansson @ 2017-06-12 12:27 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Simon Horman, Magnus Damm, Linux-Renesas, linux-pm
On 12 June 2017 at 11:23, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> Improve handling of always-on PM domains by using the
> GENPD_FLAG_ALWAYS_ON flag introduced in commit ffaa42e8a40b7f10 ("PM /
> Domains: Enable users of genpd to specify always on PM domains").
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Kind regards
Uffe
> ---
> drivers/soc/renesas/rcar-sysc.c | 28 ++++------------------------
> drivers/soc/renesas/rcar-sysc.h | 2 --
> 2 files changed, 4 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/soc/renesas/rcar-sysc.c b/drivers/soc/renesas/rcar-sysc.c
> index dcad5c42a5e81c87..7c8da3c90011422f 100644
> --- a/drivers/soc/renesas/rcar-sysc.c
> +++ b/drivers/soc/renesas/rcar-sysc.c
> @@ -181,17 +181,6 @@ static int rcar_sysc_pd_power_off(struct generic_pm_domain *genpd)
> struct rcar_sysc_pd *pd = to_rcar_pd(genpd);
>
> pr_debug("%s: %s\n", __func__, genpd->name);
> -
> - if (pd->flags & PD_NO_CR) {
> - pr_debug("%s: Cannot control %s\n", __func__, genpd->name);
> - return -EBUSY;
> - }
> -
> - if (pd->flags & PD_BUSY) {
> - pr_debug("%s: %s busy\n", __func__, genpd->name);
> - return -EBUSY;
> - }
> -
> return rcar_sysc_power_down(&pd->ch);
> }
>
> @@ -200,12 +189,6 @@ static int rcar_sysc_pd_power_on(struct generic_pm_domain *genpd)
> struct rcar_sysc_pd *pd = to_rcar_pd(genpd);
>
> pr_debug("%s: %s\n", __func__, genpd->name);
> -
> - if (pd->flags & PD_NO_CR) {
> - pr_debug("%s: Cannot control %s\n", __func__, genpd->name);
> - return 0;
> - }
> -
> return rcar_sysc_power_up(&pd->ch);
> }
>
> @@ -223,8 +206,7 @@ static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd)
> * only be turned off if the CPU is not in use.
> */
> pr_debug("PM domain %s contains %s\n", name, "CPU");
> - pd->flags |= PD_BUSY;
> - gov = &pm_domain_always_on_gov;
> + genpd->flags |= GENPD_FLAG_ALWAYS_ON;
> } else if (pd->flags & PD_SCU) {
> /*
> * This domain contains an SCU and cache-controller, and
> @@ -232,19 +214,17 @@ static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd)
> * not in use.
> */
> pr_debug("PM domain %s contains %s\n", name, "SCU");
> - pd->flags |= PD_BUSY;
> - gov = &pm_domain_always_on_gov;
> + genpd->flags |= GENPD_FLAG_ALWAYS_ON;
> } else if (pd->flags & PD_NO_CR) {
> /*
> * This domain cannot be turned off.
> */
> - pd->flags |= PD_BUSY;
> - gov = &pm_domain_always_on_gov;
> + genpd->flags |= GENPD_FLAG_ALWAYS_ON;
> }
>
> if (!(pd->flags & (PD_CPU | PD_SCU))) {
> /* Enable Clock Domain for I/O devices */
> - genpd->flags = GENPD_FLAG_PM_CLK;
> + genpd->flags |= GENPD_FLAG_PM_CLK;
> if (has_cpg_mstp) {
> genpd->attach_dev = cpg_mstp_attach_dev;
> genpd->detach_dev = cpg_mstp_detach_dev;
> diff --git a/drivers/soc/renesas/rcar-sysc.h b/drivers/soc/renesas/rcar-sysc.h
> index 07edb049a401196c..1a5bebaf54ba191c 100644
> --- a/drivers/soc/renesas/rcar-sysc.h
> +++ b/drivers/soc/renesas/rcar-sysc.h
> @@ -20,8 +20,6 @@
> #define PD_SCU BIT(1) /* Area contains SCU and L2 cache */
> #define PD_NO_CR BIT(2) /* Area lacks PWR{ON,OFF}CR registers */
>
> -#define PD_BUSY BIT(3) /* Busy, for internal use only */
> -
> #define PD_CPU_CR PD_CPU /* CPU area has CR (R-Car H1) */
> #define PD_CPU_NOCR PD_CPU | PD_NO_CR /* CPU area lacks CR (R-Car Gen2/3) */
> #define PD_ALWAYS_ON PD_NO_CR /* Always-on area */
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] ARM: shmobile: pm-rmobile: Use GENPD_FLAG_ALWAYS_ON
2017-06-12 12:27 ` Ulf Hansson
@ 2017-06-14 8:54 ` Simon Horman
0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2017-06-14 8:54 UTC (permalink / raw)
To: Ulf Hansson; +Cc: Geert Uytterhoeven, Magnus Damm, Linux-Renesas, linux-pm
On Mon, Jun 12, 2017 at 02:27:53PM +0200, Ulf Hansson wrote:
> On 12 June 2017 at 11:23, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> > Improve handling of always-on PM domains by using the
> > GENPD_FLAG_ALWAYS_ON flag introduced in commit ffaa42e8a40b7f10 ("PM /
> > Domains: Enable users of genpd to specify always on PM domains").
> >
> > Note that the PM domain containing the serial console is still handled
> > locally.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Thanks, I have queued this up for v4.13.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] soc: renesas: rcar-sysc: Use GENPD_FLAG_ALWAYS_ON
2017-06-12 12:27 ` Ulf Hansson
@ 2017-06-14 8:58 ` Simon Horman
0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2017-06-14 8:58 UTC (permalink / raw)
To: Ulf Hansson; +Cc: Geert Uytterhoeven, Magnus Damm, Linux-Renesas, linux-pm
On Mon, Jun 12, 2017 at 02:27:58PM +0200, Ulf Hansson wrote:
> On 12 June 2017 at 11:23, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> > Improve handling of always-on PM domains by using the
> > GENPD_FLAG_ALWAYS_ON flag introduced in commit ffaa42e8a40b7f10 ("PM /
> > Domains: Enable users of genpd to specify always on PM domains").
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Thanks, I have queued this up for v4.13.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-06-14 8:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-12 9:23 [PATCH 0/2] renesas: sysc: Use GENPD_FLAG_ALWAYS_ON Geert Uytterhoeven
2017-06-12 9:23 ` [PATCH 1/2] soc: renesas: rcar-sysc: " Geert Uytterhoeven
2017-06-12 12:27 ` Ulf Hansson
2017-06-14 8:58 ` Simon Horman
2017-06-12 9:23 ` [PATCH 2/2] ARM: shmobile: pm-rmobile: " Geert Uytterhoeven
2017-06-12 12:27 ` Ulf Hansson
2017-06-14 8:54 ` Simon Horman
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.