Re: [PATCH v9 1/6] PM / Domains: prepare for multiple states

2015-10-19 Thread Axel Haslam
Hi Lina,

On Mon, Oct 19, 2015 at 6:35 PM, Lina Iyer  wrote:
> Hi Axel,
>
> Thanks for rebasing.
>
> I ran into a compilation issue on ARM64 with defconfig.
>
> On Mon, Oct 19 2015 at 08:52 -0600, ahas...@baylibre.com wrote:
>>
>> From: Axel Haslam 
>>
>> prepare generic power domain init function parameters to accept a pointer
>> to the states structure that describes the possible states that a power
>> domain can enter.
>>
>> Also, as most platforms are not initializing states or latencies, add
>> pm_genpd_init_simple that allows platfroms to use a default single OFF
>> state with initial latencies set to 0.
>>
>> There is no functional change, as support for multiple domains will be
>> added in subsequent patches.
>>
>> Suggested-by: Lina Iyer 
>> Signed-off-by: Axel Haslam 
>> ---
>> arch/arm/mach-exynos/pm_domains.c |  2 +-
>> arch/arm/mach-imx/gpc.c   |  2 +-
>> arch/arm/mach-s3c64xx/pm.c|  4 ++--
>> arch/arm/mach-shmobile/pm-r8a7779.c   |  2 +-
>> arch/arm/mach-shmobile/pm-rmobile.c   |  2 +-
>> arch/arm/mach-ux500/pm_domains.c  |  2 +-
>> arch/arm/mach-zx/zx296702-pm-domain.c |  2 +-
>> drivers/base/power/domain.c   | 19 ++-
>> drivers/clk/shmobile/clk-mstp.c   |  2 +-
>
>
> Change in drivers/clk/qcom/gdsc.c is missing.

Ouch.. Sorry, i accidentally used linux-next branch from linux-pm tree..
and i missed a couple of platfroms that recently started using
genpd's..ill repost v10 based on the real linux-next.. sorry again..


-Axel

>
> Thanks,
> Lina
>
>
>> drivers/soc/dove/pmu.c|  2 +-
>> drivers/soc/mediatek/mtk-scpsys.c |  2 +-
>> include/linux/pm_domain.h | 27 ++-
>> 12 files changed, 55 insertions(+), 13 deletions(-)
>>
>> diff --git a/arch/arm/mach-exynos/pm_domains.c
>> b/arch/arm/mach-exynos/pm_domains.c
>> index 4a87e86..a0abaa1 100644
>> --- a/arch/arm/mach-exynos/pm_domains.c
>> +++ b/arch/arm/mach-exynos/pm_domains.c
>> @@ -187,7 +187,7 @@ static __init int exynos4_pm_init_power_domain(void)
>> no_clk:
>> on = __raw_readl(pd->base + 0x4) & INT_LOCAL_PWR_EN;
>>
>> -   pm_genpd_init(&pd->pd, NULL, !on);
>> +   pm_genpd_init_simple(&pd->pd, NULL, !on);
>> of_genpd_add_provider_simple(np, &pd->pd);
>> }
>>
>> diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c
>> index 8c4467f..76658f8 100644
>> --- a/arch/arm/mach-imx/gpc.c
>> +++ b/arch/arm/mach-imx/gpc.c
>> @@ -419,7 +419,7 @@ static int imx_gpc_genpd_init(struct device *dev,
>> struct regulator *pu_reg)
>> if (!IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS))
>> return 0;
>>
>> -   pm_genpd_init(&imx6q_pu_domain.base, NULL, false);
>> +   pm_genpd_init_simple(&imx6q_pu_domain.base, NULL, false);
>> return of_genpd_add_provider_onecell(dev->of_node,
>>  &imx_gpc_onecell_data);
>>
>> diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
>> index 75b14e7..d68a45c 100644
>> --- a/arch/arm/mach-s3c64xx/pm.c
>> +++ b/arch/arm/mach-s3c64xx/pm.c
>> @@ -316,11 +316,11 @@ int __init s3c64xx_pm_init(void)
>> s3c_pm_init();
>>
>> for (i = 0; i < ARRAY_SIZE(s3c64xx_always_on_pm_domains); i++)
>> -   pm_genpd_init(&s3c64xx_always_on_pm_domains[i]->pd,
>> +   pm_genpd_init_simple(&s3c64xx_always_on_pm_domains[i]->pd,
>>   &pm_domain_always_on_gov, false);
>>
>> for (i = 0; i < ARRAY_SIZE(s3c64xx_pm_domains); i++)
>> -   pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL, false);
>> +   pm_genpd_init_simple(&s3c64xx_pm_domains[i]->pd, NULL,
>> false);
>>
>> #ifdef CONFIG_S3C_DEV_FB
>> if (dev_get_platdata(&s3c_device_fb.dev))
>> diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c
>> b/arch/arm/mach-shmobile/pm-r8a7779.c
>> index 47a862e..5eac8cd 100644
>> --- a/arch/arm/mach-shmobile/pm-r8a7779.c
>> +++ b/arch/arm/mach-shmobile/pm-r8a7779.c
>> @@ -84,7 +84,7 @@ static void r8a7779_init_pm_domain(struct
>> r8a7779_pm_domain *r8a7779_pd)
>> {
>> struct generic_pm_domain *genpd = &r8a7779_pd->genpd;
>>
>> -   pm_genpd_init(genpd, NULL, false);
>> +   pm_genpd_init_simple(genpd, NULL, false);
>> genpd->dev_ops.active_wakeup = pd_active_wakeup;
>> genpd->power_off = pd_power_down;
>> genpd->power_on = pd_power_up;
>> diff --git a/arch/arm/mach-shmobile/pm-rmobile.c
>> b/arch/arm/mach-shmobile/pm-rmobile.c
>> index a5b96b9..e1ca6e2 100644
>> --- a/arch/arm/mach-shmobile/pm-rmobile.c
>> +++ b/arch/arm/mach-shmobile/pm-rmobile.c
>> @@ -160,7 +160,7 @@ static void rmobile_init_pm_domain(struct
>> rmobile_pm_domain *rmobile_pd)
>> struct dev_power_governor *gov = rmobile_pd->gov;
>>
>> genpd->flags = GENPD_FLAG_PM_CLK;
>> -   pm_genpd_init(genpd, gov ? : &simple_qos_governor, false);
>> +   pm_genpd_init_simple(genpd, gov ? : 

Re: [PATCH v9 1/6] PM / Domains: prepare for multiple states

2015-10-19 Thread Lina Iyer

Hi Axel,

Thanks for rebasing.

I ran into a compilation issue on ARM64 with defconfig.

On Mon, Oct 19 2015 at 08:52 -0600, ahas...@baylibre.com wrote:

From: Axel Haslam 

prepare generic power domain init function parameters to accept a pointer
to the states structure that describes the possible states that a power
domain can enter.

Also, as most platforms are not initializing states or latencies, add
pm_genpd_init_simple that allows platfroms to use a default single OFF
state with initial latencies set to 0.

There is no functional change, as support for multiple domains will be
added in subsequent patches.

Suggested-by: Lina Iyer 
Signed-off-by: Axel Haslam 
---
arch/arm/mach-exynos/pm_domains.c |  2 +-
arch/arm/mach-imx/gpc.c   |  2 +-
arch/arm/mach-s3c64xx/pm.c|  4 ++--
arch/arm/mach-shmobile/pm-r8a7779.c   |  2 +-
arch/arm/mach-shmobile/pm-rmobile.c   |  2 +-
arch/arm/mach-ux500/pm_domains.c  |  2 +-
arch/arm/mach-zx/zx296702-pm-domain.c |  2 +-
drivers/base/power/domain.c   | 19 ++-
drivers/clk/shmobile/clk-mstp.c   |  2 +-


Change in drivers/clk/qcom/gdsc.c is missing.

Thanks,
Lina


drivers/soc/dove/pmu.c|  2 +-
drivers/soc/mediatek/mtk-scpsys.c |  2 +-
include/linux/pm_domain.h | 27 ++-
12 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-exynos/pm_domains.c 
b/arch/arm/mach-exynos/pm_domains.c
index 4a87e86..a0abaa1 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -187,7 +187,7 @@ static __init int exynos4_pm_init_power_domain(void)
no_clk:
on = __raw_readl(pd->base + 0x4) & INT_LOCAL_PWR_EN;

-   pm_genpd_init(&pd->pd, NULL, !on);
+   pm_genpd_init_simple(&pd->pd, NULL, !on);
of_genpd_add_provider_simple(np, &pd->pd);
}

diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c
index 8c4467f..76658f8 100644
--- a/arch/arm/mach-imx/gpc.c
+++ b/arch/arm/mach-imx/gpc.c
@@ -419,7 +419,7 @@ static int imx_gpc_genpd_init(struct device *dev, struct 
regulator *pu_reg)
if (!IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS))
return 0;

-   pm_genpd_init(&imx6q_pu_domain.base, NULL, false);
+   pm_genpd_init_simple(&imx6q_pu_domain.base, NULL, false);
return of_genpd_add_provider_onecell(dev->of_node,
 &imx_gpc_onecell_data);

diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index 75b14e7..d68a45c 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -316,11 +316,11 @@ int __init s3c64xx_pm_init(void)
s3c_pm_init();

for (i = 0; i < ARRAY_SIZE(s3c64xx_always_on_pm_domains); i++)
-   pm_genpd_init(&s3c64xx_always_on_pm_domains[i]->pd,
+   pm_genpd_init_simple(&s3c64xx_always_on_pm_domains[i]->pd,
  &pm_domain_always_on_gov, false);

for (i = 0; i < ARRAY_SIZE(s3c64xx_pm_domains); i++)
-   pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL, false);
+   pm_genpd_init_simple(&s3c64xx_pm_domains[i]->pd, NULL, false);

#ifdef CONFIG_S3C_DEV_FB
if (dev_get_platdata(&s3c_device_fb.dev))
diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c 
b/arch/arm/mach-shmobile/pm-r8a7779.c
index 47a862e..5eac8cd 100644
--- a/arch/arm/mach-shmobile/pm-r8a7779.c
+++ b/arch/arm/mach-shmobile/pm-r8a7779.c
@@ -84,7 +84,7 @@ static void r8a7779_init_pm_domain(struct r8a7779_pm_domain 
*r8a7779_pd)
{
struct generic_pm_domain *genpd = &r8a7779_pd->genpd;

-   pm_genpd_init(genpd, NULL, false);
+   pm_genpd_init_simple(genpd, NULL, false);
genpd->dev_ops.active_wakeup = pd_active_wakeup;
genpd->power_off = pd_power_down;
genpd->power_on = pd_power_up;
diff --git a/arch/arm/mach-shmobile/pm-rmobile.c 
b/arch/arm/mach-shmobile/pm-rmobile.c
index a5b96b9..e1ca6e2 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.c
+++ b/arch/arm/mach-shmobile/pm-rmobile.c
@@ -160,7 +160,7 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain 
*rmobile_pd)
struct dev_power_governor *gov = rmobile_pd->gov;

genpd->flags = GENPD_FLAG_PM_CLK;
-   pm_genpd_init(genpd, gov ? : &simple_qos_governor, false);
+   pm_genpd_init_simple(genpd, gov ? : &simple_qos_governor, false);
genpd->dev_ops.active_wakeup = rmobile_pd_active_wakeup;
genpd->power_off = rmobile_pd_power_down;
genpd->power_on  = rmobile_pd_power_up;
diff --git a/arch/arm/mach-ux500/pm_domains.c b/arch/arm/mach-ux500/pm_domains.c
index 4d71c90..208e784 100644
--- a/arch/arm/mach-ux500/pm_domains.c
+++ b/arch/arm/mach-ux500/pm_domains.c
@@ -72,7 +72,7 @@ int __init ux500_pm_domains_init(void)
genpd_data->num_domains = ARRAY_SIZE(ux500_pm_domains);

for (i = 0; i < ARRAY_SIZE(ux500_pm_domains); +

[PATCH v9 1/6] PM / Domains: prepare for multiple states

2015-10-19 Thread ahaslam
From: Axel Haslam 

prepare generic power domain init function parameters to accept a pointer
to the states structure that describes the possible states that a power
domain can enter.

Also, as most platforms are not initializing states or latencies, add
pm_genpd_init_simple that allows platfroms to use a default single OFF
state with initial latencies set to 0.

There is no functional change, as support for multiple domains will be
added in subsequent patches.

Suggested-by: Lina Iyer 
Signed-off-by: Axel Haslam 
---
 arch/arm/mach-exynos/pm_domains.c |  2 +-
 arch/arm/mach-imx/gpc.c   |  2 +-
 arch/arm/mach-s3c64xx/pm.c|  4 ++--
 arch/arm/mach-shmobile/pm-r8a7779.c   |  2 +-
 arch/arm/mach-shmobile/pm-rmobile.c   |  2 +-
 arch/arm/mach-ux500/pm_domains.c  |  2 +-
 arch/arm/mach-zx/zx296702-pm-domain.c |  2 +-
 drivers/base/power/domain.c   | 19 ++-
 drivers/clk/shmobile/clk-mstp.c   |  2 +-
 drivers/soc/dove/pmu.c|  2 +-
 drivers/soc/mediatek/mtk-scpsys.c |  2 +-
 include/linux/pm_domain.h | 27 ++-
 12 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-exynos/pm_domains.c 
b/arch/arm/mach-exynos/pm_domains.c
index 4a87e86..a0abaa1 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -187,7 +187,7 @@ static __init int exynos4_pm_init_power_domain(void)
 no_clk:
on = __raw_readl(pd->base + 0x4) & INT_LOCAL_PWR_EN;
 
-   pm_genpd_init(&pd->pd, NULL, !on);
+   pm_genpd_init_simple(&pd->pd, NULL, !on);
of_genpd_add_provider_simple(np, &pd->pd);
}
 
diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c
index 8c4467f..76658f8 100644
--- a/arch/arm/mach-imx/gpc.c
+++ b/arch/arm/mach-imx/gpc.c
@@ -419,7 +419,7 @@ static int imx_gpc_genpd_init(struct device *dev, struct 
regulator *pu_reg)
if (!IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS))
return 0;
 
-   pm_genpd_init(&imx6q_pu_domain.base, NULL, false);
+   pm_genpd_init_simple(&imx6q_pu_domain.base, NULL, false);
return of_genpd_add_provider_onecell(dev->of_node,
 &imx_gpc_onecell_data);
 
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index 75b14e7..d68a45c 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -316,11 +316,11 @@ int __init s3c64xx_pm_init(void)
s3c_pm_init();
 
for (i = 0; i < ARRAY_SIZE(s3c64xx_always_on_pm_domains); i++)
-   pm_genpd_init(&s3c64xx_always_on_pm_domains[i]->pd,
+   pm_genpd_init_simple(&s3c64xx_always_on_pm_domains[i]->pd,
  &pm_domain_always_on_gov, false);
 
for (i = 0; i < ARRAY_SIZE(s3c64xx_pm_domains); i++)
-   pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL, false);
+   pm_genpd_init_simple(&s3c64xx_pm_domains[i]->pd, NULL, false);
 
 #ifdef CONFIG_S3C_DEV_FB
if (dev_get_platdata(&s3c_device_fb.dev))
diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c 
b/arch/arm/mach-shmobile/pm-r8a7779.c
index 47a862e..5eac8cd 100644
--- a/arch/arm/mach-shmobile/pm-r8a7779.c
+++ b/arch/arm/mach-shmobile/pm-r8a7779.c
@@ -84,7 +84,7 @@ static void r8a7779_init_pm_domain(struct r8a7779_pm_domain 
*r8a7779_pd)
 {
struct generic_pm_domain *genpd = &r8a7779_pd->genpd;
 
-   pm_genpd_init(genpd, NULL, false);
+   pm_genpd_init_simple(genpd, NULL, false);
genpd->dev_ops.active_wakeup = pd_active_wakeup;
genpd->power_off = pd_power_down;
genpd->power_on = pd_power_up;
diff --git a/arch/arm/mach-shmobile/pm-rmobile.c 
b/arch/arm/mach-shmobile/pm-rmobile.c
index a5b96b9..e1ca6e2 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.c
+++ b/arch/arm/mach-shmobile/pm-rmobile.c
@@ -160,7 +160,7 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain 
*rmobile_pd)
struct dev_power_governor *gov = rmobile_pd->gov;
 
genpd->flags = GENPD_FLAG_PM_CLK;
-   pm_genpd_init(genpd, gov ? : &simple_qos_governor, false);
+   pm_genpd_init_simple(genpd, gov ? : &simple_qos_governor, false);
genpd->dev_ops.active_wakeup= rmobile_pd_active_wakeup;
genpd->power_off= rmobile_pd_power_down;
genpd->power_on = rmobile_pd_power_up;
diff --git a/arch/arm/mach-ux500/pm_domains.c b/arch/arm/mach-ux500/pm_domains.c
index 4d71c90..208e784 100644
--- a/arch/arm/mach-ux500/pm_domains.c
+++ b/arch/arm/mach-ux500/pm_domains.c
@@ -72,7 +72,7 @@ int __init ux500_pm_domains_init(void)
genpd_data->num_domains = ARRAY_SIZE(ux500_pm_domains);
 
for (i = 0; i < ARRAY_SIZE(ux500_pm_domains); ++i)
-   pm_genpd_init(ux500_pm_domains[i], NULL, false);
+   pm_genpd_init_simple(ux500_pm_domains[i], NULL, false);
 
of_genpd_add_provider_onecell(np, genpd_d