diff mbox series

[4/4] PM / Domains: Don't warn about IRQ safe device for an always on PM domain

Message ID 1490005163-28633-5-git-send-email-ulf.hansson@linaro.org
State Accepted
Commit 075c37d59ecd4a8b7c9cb5570e90d5b538797ad2
Headers show
Series PM / Domains: Add support for always on PM domains in genpd | expand

Commit Message

Ulf Hansson March 20, 2017, 10:19 a.m. UTC
When an IRQ safe device is attached to a no sleep domain, genpd prints a
warning once, as to indicate it is a suboptimal configuration from power
consumption point of view.

However the warning doesn't make sense for an always on domain, since it
anyway remains powered on. Therefore, let's change to not print the warning
for this configuration.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

---
 drivers/base/power/domain.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

-- 
2.7.4

Comments

Viresh Kumar March 20, 2017, 11:12 a.m. UTC | #1
On 20-03-17, 11:19, Ulf Hansson wrote:
> When an IRQ safe device is attached to a no sleep domain, genpd prints a

> warning once, as to indicate it is a suboptimal configuration from power

> consumption point of view.

> 

> However the warning doesn't make sense for an always on domain, since it

> anyway remains powered on. Therefore, let's change to not print the warning

> for this configuration.

> 

> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

> ---

>  drivers/base/power/domain.c | 8 ++++++--

>  1 file changed, 6 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c

> index 8a2bfc8..bfba02f 100644

> --- a/drivers/base/power/domain.c

> +++ b/drivers/base/power/domain.c

> @@ -132,8 +132,12 @@ static inline bool irq_safe_dev_in_no_sleep_domain(struct device *dev,

>  

>  	ret = pm_runtime_is_irq_safe(dev) && !genpd_is_irq_safe(genpd);

>  

> -	/* Warn once if IRQ safe dev in no sleep domain */

> -	if (ret)

> +	/*

> +	 * Warn once if an IRQ safe device is attached to a no sleep domain, as

> +	 * to indicate a suboptimal configuration for PM. For an always on

> +	 * domain this isn't case, thus don't warn.

> +	 */

> +	if (ret && !genpd_is_always_on(genpd))

>  		dev_warn_once(dev, "PM domain %s will not be powered off\n",

>  				genpd->name);


Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>


-- 
viresh
Geert Uytterhoeven March 20, 2017, 11:59 a.m. UTC | #2
On Mon, Mar 20, 2017 at 11:19 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> When an IRQ safe device is attached to a no sleep domain, genpd prints a

> warning once, as to indicate it is a suboptimal configuration from power

> consumption point of view.

>

> However the warning doesn't make sense for an always on domain, since it

> anyway remains powered on. Therefore, let's change to not print the warning

> for this configuration.

>

> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>


Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>


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
Bartlomiej Zolnierkiewicz March 20, 2017, 5:14 p.m. UTC | #3
On Monday, March 20, 2017 11:19:23 AM Ulf Hansson wrote:
> When an IRQ safe device is attached to a no sleep domain, genpd prints a

> warning once, as to indicate it is a suboptimal configuration from power

> consumption point of view.

> 

> However the warning doesn't make sense for an always on domain, since it

> anyway remains powered on. Therefore, let's change to not print the warning

> for this configuration.

> 

> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>


Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>


Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
diff mbox series

Patch

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 8a2bfc8..bfba02f 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -132,8 +132,12 @@  static inline bool irq_safe_dev_in_no_sleep_domain(struct device *dev,
 
 	ret = pm_runtime_is_irq_safe(dev) && !genpd_is_irq_safe(genpd);
 
-	/* Warn once if IRQ safe dev in no sleep domain */
-	if (ret)
+	/*
+	 * Warn once if an IRQ safe device is attached to a no sleep domain, as
+	 * to indicate a suboptimal configuration for PM. For an always on
+	 * domain this isn't case, thus don't warn.
+	 */
+	if (ret && !genpd_is_always_on(genpd))
 		dev_warn_once(dev, "PM domain %s will not be powered off\n",
 				genpd->name);