linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] PM / Runtime: Move ignore_children flag under CONFIG_PM
@ 2016-04-08 11:40 Ulf Hansson
  2016-04-09 16:02 ` Pavel Machek
  0 siblings, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2016-04-08 11:40 UTC (permalink / raw)
  To: Rafael J. Wysocki, linux-pm
  Cc: Kevin Hilman, Len Brown, Pavel Machek, Linus Walleij, Ulf Hansson

The ignore_children flag is used only when CONFIG_PM is set, so let's move
it into that section within the struct dev_pm_info.

Move also the corresponding pm_suspend_ignore_children() API out of
device.h into pm_runtime.h, to be consistent with similar APIs.

Unfortunate this causes the Toshiba PCI SD mmc host driver to fail to
compile as it needs pm_runtime.h, so let's fix this here as well.

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

Changes in v2:
	- Fix compiler error for toshsd mmc host driver.

---
 drivers/mmc/host/toshsd.c  | 1 +
 include/linux/device.h     | 5 -----
 include/linux/pm.h         | 2 +-
 include/linux/pm_runtime.h | 6 ++++++
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/toshsd.c b/drivers/mmc/host/toshsd.c
index e2cdd5f..553ef41 100644
--- a/drivers/mmc/host/toshsd.c
+++ b/drivers/mmc/host/toshsd.c
@@ -21,6 +21,7 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/pm.h>
+#include <linux/pm_runtime.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/mmc.h>
 
diff --git a/include/linux/device.h b/include/linux/device.h
index 002c597..b130304 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -956,11 +956,6 @@ static inline bool device_async_suspend_enabled(struct device *dev)
 	return !!dev->power.async_suspend;
 }
 
-static inline void pm_suspend_ignore_children(struct device *dev, bool enable)
-{
-	dev->power.ignore_children = enable;
-}
-
 static inline void dev_pm_syscore_device(struct device *dev, bool val)
 {
 #ifdef CONFIG_PM_SLEEP
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 6a5d654..06eb353 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -563,7 +563,6 @@ struct dev_pm_info {
 	bool			is_suspended:1;	/* Ditto */
 	bool			is_noirq_suspended:1;
 	bool			is_late_suspended:1;
-	bool			ignore_children:1;
 	bool			early_init:1;	/* Owned by the PM core */
 	bool			direct_complete:1;	/* Owned by the PM core */
 	spinlock_t		lock;
@@ -591,6 +590,7 @@ struct dev_pm_info {
 	unsigned int		deferred_resume:1;
 	unsigned int		run_wake:1;
 	unsigned int		runtime_auto:1;
+	bool			ignore_children:1;
 	unsigned int		no_callbacks:1;
 	unsigned int		irq_safe:1;
 	unsigned int		use_autosuspend:1;
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 7af093d..2e14d26 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -56,6 +56,11 @@ extern void pm_runtime_update_max_time_suspended(struct device *dev,
 						 s64 delta_ns);
 extern void pm_runtime_set_memalloc_noio(struct device *dev, bool enable);
 
+static inline void pm_suspend_ignore_children(struct device *dev, bool enable)
+{
+	dev->power.ignore_children = enable;
+}
+
 static inline bool pm_children_suspended(struct device *dev)
 {
 	return dev->power.ignore_children
@@ -156,6 +161,7 @@ static inline void __pm_runtime_disable(struct device *dev, bool c) {}
 static inline void pm_runtime_allow(struct device *dev) {}
 static inline void pm_runtime_forbid(struct device *dev) {}
 
+static inline void pm_suspend_ignore_children(struct device *dev, bool enable) {}
 static inline bool pm_children_suspended(struct device *dev) { return false; }
 static inline void pm_runtime_get_noresume(struct device *dev) {}
 static inline void pm_runtime_put_noidle(struct device *dev) {}
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] PM / Runtime: Move ignore_children flag under CONFIG_PM
  2016-04-08 11:40 [PATCH V2] PM / Runtime: Move ignore_children flag under CONFIG_PM Ulf Hansson
@ 2016-04-09 16:02 ` Pavel Machek
  2016-04-25 23:59   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2016-04-09 16:02 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rafael J. Wysocki, linux-pm, Kevin Hilman, Len Brown,
	Linus Walleij

Hi!

> The ignore_children flag is used only when CONFIG_PM is set, so let's move
> it into that section within the struct dev_pm_info.
> 
> Move also the corresponding pm_suspend_ignore_children() API out of
> device.h into pm_runtime.h, to be consistent with similar APIs.
> 
> Unfortunate this causes the Toshiba PCI SD mmc host driver to fail to
> compile as it needs pm_runtime.h, so let's fix this here as well.
> 
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Acked-by: Pavel Machek <pavel@ucw.cz>

>  #ifdef CONFIG_PM_SLEEP
> diff --git a/include/linux/pm.h b/include/linux/pm.h
> index 6a5d654..06eb353 100644
> --- a/include/linux/pm.h
> +++ b/include/linux/pm.h
> @@ -591,6 +590,7 @@ struct dev_pm_info {
>  	unsigned int		deferred_resume:1;
>  	unsigned int		run_wake:1;
>  	unsigned int		runtime_auto:1;
> +	bool			ignore_children:1;
>  	unsigned int		no_callbacks:1;
>  	unsigned int		irq_safe:1;
>  	unsigned int		use_autosuspend:1;

Some day we might want to change these to bools they really are....?

									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] PM / Runtime: Move ignore_children flag under CONFIG_PM
  2016-04-09 16:02 ` Pavel Machek
@ 2016-04-25 23:59   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2016-04-25 23:59 UTC (permalink / raw)
  To: Pavel Machek, Ulf Hansson
  Cc: linux-pm, Kevin Hilman, Len Brown, Linus Walleij

On Saturday, April 09, 2016 06:02:02 PM Pavel Machek wrote:
> Hi!
> 
> > The ignore_children flag is used only when CONFIG_PM is set, so let's move
> > it into that section within the struct dev_pm_info.
> > 
> > Move also the corresponding pm_suspend_ignore_children() API out of
> > device.h into pm_runtime.h, to be consistent with similar APIs.
> > 
> > Unfortunate this causes the Toshiba PCI SD mmc host driver to fail to
> > compile as it needs pm_runtime.h, so let's fix this here as well.
> > 
> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>

Applied, thanks!


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-25 23:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-08 11:40 [PATCH V2] PM / Runtime: Move ignore_children flag under CONFIG_PM Ulf Hansson
2016-04-09 16:02 ` Pavel Machek
2016-04-25 23:59   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).