All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Kevin Hilman <khilman@linaro.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Tomasz Figa <tomasz.figa@gmail.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	Ben Dooks <ben-linux@fluff.org>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Philipp Zabel <philipp.zabel@gmail.com>,
	Mark Brown <broonie@kernel.org>, Wolfram Sang <wsa@the-dreams.de>,
	Russell King <linux@arm.linux.org.uk>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Jack Dai <jack.dai@rock-chips.com>,
	Jinkun Hong <jinkun.hong@rock-chips.com>
Subject: Re: [PATCH v2 3/4] PM / Domains: Expect PM domains being powered at initialization
Date: Thu, 2 Oct 2014 08:50:19 +0900	[thread overview]
Message-ID: <20141001235019.GC15551@verge.net.au> (raw)
In-Reply-To: <1412174494-15346-4-git-send-email-ulf.hansson@linaro.org>

On Wed, Oct 01, 2014 at 04:41:33PM +0200, Ulf Hansson wrote:
> At ->probe() it's common practice for drivers/subsystems to bring their
> devices to full power and without depending on CONFIG_PM_RUNTIME.
> 
> We could also expect that drivers/subsystems requires their device's
> corresponding PM domains to be powered, to successfully complete a
> ->probe() sequence.
> 
> Align the generic PM domain to the behavior above, by enforcing a PM
> domain to be powered at initialization.
> 
> Previous patch changed the only call of pm_genpd_init() with "true" for
> the "is_off" parameter into "false". Thus all calls of pm_genpd_init()
> now uses "false" as the value for "is_off".
> 
> To make it clear that genpd currently only supports powered PM domains
> at init, let's also remove the "is_off" parameter from the API.
> 
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  arch/arm/mach-exynos/pm_domains.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 +-
>  drivers/base/power/domain.c         | 5 ++---
>  include/linux/pm_domain.h           | 4 ++--
>  6 files changed, 9 insertions(+), 10 deletions(-)

I am mildly concerned about the potential for conflicts in
arch/arm/mach-shmobile/. But I think that taking this through Rafael's tree
is consistent with how we have handled things before.

So, providing it can appear in v3.18-rc1, in which case I can
rebase anything in my tree to avoid conflicts bubling up:

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
> index 58e18e9..f2e5096 100644
> --- a/arch/arm/mach-exynos/pm_domains.c
> +++ b/arch/arm/mach-exynos/pm_domains.c
> @@ -158,7 +158,7 @@ no_clk:
>  		if (!(__raw_readl(pd->base + 0x4) & INT_LOCAL_PWR_EN))
>  			exynos_pd_power_on(&pd->pd);
>  
> -		pm_genpd_init(&pd->pd, NULL, false);
> +		pm_genpd_init(&pd->pd, NULL);
>  		of_genpd_add_provider_simple(np, &pd->pd);
>  	}
>  
> diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
> index aaf7bea..42dead0 100644
> --- a/arch/arm/mach-s3c64xx/pm.c
> +++ b/arch/arm/mach-s3c64xx/pm.c
> @@ -315,10 +315,10 @@ int __init s3c64xx_pm_init(void)
>  
>  	for (i = 0; i < ARRAY_SIZE(s3c64xx_always_on_pm_domains); i++)
>  		pm_genpd_init(&s3c64xx_always_on_pm_domains[i]->pd,
> -			      &pm_domain_always_on_gov, false);
> +			      &pm_domain_always_on_gov);
>  
>  	for (i = 0; i < ARRAY_SIZE(s3c64xx_pm_domains); i++)
> -		pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL, false);
> +		pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL);
>  
>  #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 82fe3d7..c20ef44 100644
> --- a/arch/arm/mach-shmobile/pm-r8a7779.c
> +++ b/arch/arm/mach-shmobile/pm-r8a7779.c
> @@ -83,7 +83,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(genpd, NULL);
>  	genpd->dev_ops.stop = pm_clk_suspend;
>  	genpd->dev_ops.start = pm_clk_resume;
>  	genpd->dev_ops.active_wakeup = pd_active_wakeup;
> diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c
> index 818de2f..e6a0490 100644
> --- a/arch/arm/mach-shmobile/pm-rmobile.c
> +++ b/arch/arm/mach-shmobile/pm-rmobile.c
> @@ -107,7 +107,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;
>  
> -	pm_genpd_init(genpd, gov ? : &simple_qos_governor, false);
> +	pm_genpd_init(genpd, gov ? : &simple_qos_governor);
>  	genpd->dev_ops.stop		= pm_clk_suspend;
>  	genpd->dev_ops.start		= pm_clk_resume;
>  	genpd->dev_ops.active_wakeup	= rmobile_pd_active_wakeup;
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 36871b3..cfb76e8 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -1836,10 +1836,9 @@ static int pm_genpd_default_restore_state(struct device *dev)
>   * pm_genpd_init - Initialize a generic I/O PM domain object.
>   * @genpd: PM domain object to initialize.
>   * @gov: PM domain governor to associate with the domain (may be NULL).
> - * @is_off: Initial value of the domain's power_is_off field.
>   */
>  void pm_genpd_init(struct generic_pm_domain *genpd,
> -		   struct dev_power_governor *gov, bool is_off)
> +		   struct dev_power_governor *gov)
>  {
>  	if (IS_ERR_OR_NULL(genpd))
>  		return;
> @@ -1852,7 +1851,7 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
>  	INIT_WORK(&genpd->power_off_work, genpd_power_off_work_fn);
>  	genpd->in_progress = 0;
>  	atomic_set(&genpd->sd_count, 0);
> -	genpd->status = is_off ? GPD_STATE_POWER_OFF : GPD_STATE_ACTIVE;
> +	genpd->status = GPD_STATE_ACTIVE;
>  	init_waitqueue_head(&genpd->status_wait_queue);
>  	genpd->poweroff_task = NULL;
>  	genpd->resume_count = 0;
> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> index a21dfa9..ad4aa87 100644
> --- a/include/linux/pm_domain.h
> +++ b/include/linux/pm_domain.h
> @@ -140,7 +140,7 @@ extern int pm_genpd_name_attach_cpuidle(const char *name, int state);
>  extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd);
>  extern int pm_genpd_name_detach_cpuidle(const char *name);
>  extern void pm_genpd_init(struct generic_pm_domain *genpd,
> -			  struct dev_power_governor *gov, bool is_off);
> +			  struct dev_power_governor *gov);
>  
>  extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
>  extern int pm_genpd_name_poweron(const char *domain_name);
> @@ -206,7 +206,7 @@ static inline int pm_genpd_name_detach_cpuidle(const char *name)
>  	return -ENOSYS;
>  }
>  static inline void pm_genpd_init(struct generic_pm_domain *genpd,
> -				 struct dev_power_governor *gov, bool is_off)
> +				 struct dev_power_governor *gov)
>  {
>  }
>  static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
> -- 
> 1.9.1
> 

WARNING: multiple messages have this Message-ID (diff)
From: horms@verge.net.au (Simon Horman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/4] PM / Domains: Expect PM domains being powered at initialization
Date: Thu, 2 Oct 2014 08:50:19 +0900	[thread overview]
Message-ID: <20141001235019.GC15551@verge.net.au> (raw)
In-Reply-To: <1412174494-15346-4-git-send-email-ulf.hansson@linaro.org>

On Wed, Oct 01, 2014 at 04:41:33PM +0200, Ulf Hansson wrote:
> At ->probe() it's common practice for drivers/subsystems to bring their
> devices to full power and without depending on CONFIG_PM_RUNTIME.
> 
> We could also expect that drivers/subsystems requires their device's
> corresponding PM domains to be powered, to successfully complete a
> ->probe() sequence.
> 
> Align the generic PM domain to the behavior above, by enforcing a PM
> domain to be powered at initialization.
> 
> Previous patch changed the only call of pm_genpd_init() with "true" for
> the "is_off" parameter into "false". Thus all calls of pm_genpd_init()
> now uses "false" as the value for "is_off".
> 
> To make it clear that genpd currently only supports powered PM domains
> at init, let's also remove the "is_off" parameter from the API.
> 
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  arch/arm/mach-exynos/pm_domains.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 +-
>  drivers/base/power/domain.c         | 5 ++---
>  include/linux/pm_domain.h           | 4 ++--
>  6 files changed, 9 insertions(+), 10 deletions(-)

I am mildly concerned about the potential for conflicts in
arch/arm/mach-shmobile/. But I think that taking this through Rafael's tree
is consistent with how we have handled things before.

So, providing it can appear in v3.18-rc1, in which case I can
rebase anything in my tree to avoid conflicts bubling up:

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
> index 58e18e9..f2e5096 100644
> --- a/arch/arm/mach-exynos/pm_domains.c
> +++ b/arch/arm/mach-exynos/pm_domains.c
> @@ -158,7 +158,7 @@ no_clk:
>  		if (!(__raw_readl(pd->base + 0x4) & INT_LOCAL_PWR_EN))
>  			exynos_pd_power_on(&pd->pd);
>  
> -		pm_genpd_init(&pd->pd, NULL, false);
> +		pm_genpd_init(&pd->pd, NULL);
>  		of_genpd_add_provider_simple(np, &pd->pd);
>  	}
>  
> diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
> index aaf7bea..42dead0 100644
> --- a/arch/arm/mach-s3c64xx/pm.c
> +++ b/arch/arm/mach-s3c64xx/pm.c
> @@ -315,10 +315,10 @@ int __init s3c64xx_pm_init(void)
>  
>  	for (i = 0; i < ARRAY_SIZE(s3c64xx_always_on_pm_domains); i++)
>  		pm_genpd_init(&s3c64xx_always_on_pm_domains[i]->pd,
> -			      &pm_domain_always_on_gov, false);
> +			      &pm_domain_always_on_gov);
>  
>  	for (i = 0; i < ARRAY_SIZE(s3c64xx_pm_domains); i++)
> -		pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL, false);
> +		pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL);
>  
>  #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 82fe3d7..c20ef44 100644
> --- a/arch/arm/mach-shmobile/pm-r8a7779.c
> +++ b/arch/arm/mach-shmobile/pm-r8a7779.c
> @@ -83,7 +83,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(genpd, NULL);
>  	genpd->dev_ops.stop = pm_clk_suspend;
>  	genpd->dev_ops.start = pm_clk_resume;
>  	genpd->dev_ops.active_wakeup = pd_active_wakeup;
> diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c
> index 818de2f..e6a0490 100644
> --- a/arch/arm/mach-shmobile/pm-rmobile.c
> +++ b/arch/arm/mach-shmobile/pm-rmobile.c
> @@ -107,7 +107,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;
>  
> -	pm_genpd_init(genpd, gov ? : &simple_qos_governor, false);
> +	pm_genpd_init(genpd, gov ? : &simple_qos_governor);
>  	genpd->dev_ops.stop		= pm_clk_suspend;
>  	genpd->dev_ops.start		= pm_clk_resume;
>  	genpd->dev_ops.active_wakeup	= rmobile_pd_active_wakeup;
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 36871b3..cfb76e8 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -1836,10 +1836,9 @@ static int pm_genpd_default_restore_state(struct device *dev)
>   * pm_genpd_init - Initialize a generic I/O PM domain object.
>   * @genpd: PM domain object to initialize.
>   * @gov: PM domain governor to associate with the domain (may be NULL).
> - * @is_off: Initial value of the domain's power_is_off field.
>   */
>  void pm_genpd_init(struct generic_pm_domain *genpd,
> -		   struct dev_power_governor *gov, bool is_off)
> +		   struct dev_power_governor *gov)
>  {
>  	if (IS_ERR_OR_NULL(genpd))
>  		return;
> @@ -1852,7 +1851,7 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
>  	INIT_WORK(&genpd->power_off_work, genpd_power_off_work_fn);
>  	genpd->in_progress = 0;
>  	atomic_set(&genpd->sd_count, 0);
> -	genpd->status = is_off ? GPD_STATE_POWER_OFF : GPD_STATE_ACTIVE;
> +	genpd->status = GPD_STATE_ACTIVE;
>  	init_waitqueue_head(&genpd->status_wait_queue);
>  	genpd->poweroff_task = NULL;
>  	genpd->resume_count = 0;
> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> index a21dfa9..ad4aa87 100644
> --- a/include/linux/pm_domain.h
> +++ b/include/linux/pm_domain.h
> @@ -140,7 +140,7 @@ extern int pm_genpd_name_attach_cpuidle(const char *name, int state);
>  extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd);
>  extern int pm_genpd_name_detach_cpuidle(const char *name);
>  extern void pm_genpd_init(struct generic_pm_domain *genpd,
> -			  struct dev_power_governor *gov, bool is_off);
> +			  struct dev_power_governor *gov);
>  
>  extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
>  extern int pm_genpd_name_poweron(const char *domain_name);
> @@ -206,7 +206,7 @@ static inline int pm_genpd_name_detach_cpuidle(const char *name)
>  	return -ENOSYS;
>  }
>  static inline void pm_genpd_init(struct generic_pm_domain *genpd,
> -				 struct dev_power_governor *gov, bool is_off)
> +				 struct dev_power_governor *gov)
>  {
>  }
>  static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
> -- 
> 1.9.1
> 

  reply	other threads:[~2014-10-01 23:50 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 14:41 [PATCH v2 0/4] PM / Domains: Fix race conditions during boot Ulf Hansson
2014-10-01 14:41 ` Ulf Hansson
2014-10-01 14:41 ` [PATCH v2 1/4] PM / Domains: Remove pm_genpd_dev_need_restore() API Ulf Hansson
2014-10-01 14:41   ` Ulf Hansson
2014-10-01 16:36   ` Sylwester Nawrocki
2014-10-01 16:36     ` Sylwester Nawrocki
2014-10-02  9:09     ` Ulf Hansson
2014-10-02  9:09       ` Ulf Hansson
2014-10-02 12:00       ` Sylwester Nawrocki
2014-10-02 12:00         ` Sylwester Nawrocki
2014-10-02 13:30         ` Ulf Hansson
2014-10-02 13:30           ` Ulf Hansson
2014-10-02 15:54           ` Sylwester Nawrocki
2014-10-02 15:54             ` Sylwester Nawrocki
2014-10-03 10:36             ` Ulf Hansson
2014-10-03 10:36               ` Ulf Hansson
2014-11-06 15:57               ` Sylwester Nawrocki
2014-11-06 15:57                 ` Sylwester Nawrocki
2014-11-06 19:05                 ` Ulf Hansson
2014-11-06 19:05                   ` Ulf Hansson
2014-10-01 14:41 ` [PATCH v2 2/4] ARM: exynos: Ensure PM domains are powered at initialization Ulf Hansson
2014-10-01 14:41   ` Ulf Hansson
2014-10-01 16:18   ` Sylwester Nawrocki
2014-10-01 16:18     ` Sylwester Nawrocki
2014-10-01 19:50     ` Rafael J. Wysocki
2014-10-01 19:50       ` Rafael J. Wysocki
2014-10-02  9:42       ` Ulf Hansson
2014-10-02  9:42         ` Ulf Hansson
2014-10-02  9:55         ` Ulf Hansson
2014-10-02  9:55           ` Ulf Hansson
2014-10-01 14:41 ` [PATCH v2 3/4] PM / Domains: Expect PM domains being " Ulf Hansson
2014-10-01 14:41   ` Ulf Hansson
2014-10-01 23:50   ` Simon Horman [this message]
2014-10-01 23:50     ` Simon Horman
2014-10-01 14:41 ` [PATCH v2 4/4] PM / Domains: Enforce PM domains to stay powered during boot Ulf Hansson
2014-10-01 14:41   ` Ulf Hansson
2014-10-03  1:14 ` [PATCH v2 0/4] PM / Domains: Fix race conditions " Kevin Hilman
2014-10-03  1:14   ` Kevin Hilman
2014-10-03  9:47   ` Ulf Hansson
2014-10-03  9:47     ` Ulf Hansson
2014-10-03 15:10     ` Kevin Hilman
2014-10-03 15:10       ` Kevin Hilman

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=20141001235019.GC15551@verge.net.au \
    --to=horms@verge.net.au \
    --cc=ben-linux@fluff.org \
    --cc=broonie@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=jack.dai@rock-chips.com \
    --cc=jinkun.hong@rock-chips.com \
    --cc=kgene.kim@samsung.com \
    --cc=khilman@linaro.org \
    --cc=len.brown@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=magnus.damm@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=philipp.zabel@gmail.com \
    --cc=rjw@rjwysocki.net \
    --cc=stern@rowland.harvard.edu \
    --cc=tomasz.figa@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wsa@the-dreams.de \
    /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.