linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code
@ 2014-11-27  0:37 Rafael J. Wysocki
  2014-11-27  0:38 ` [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro Rafael J. Wysocki
                   ` (5 more replies)
  0 siblings, 6 replies; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-11-27  0:37 UTC (permalink / raw)
  To: Linux PM list
  Cc: Linux PCI, Linux Kernel Mailing List, ACPI Devel Maling List,
	Alan Stern, Bjorn Helgaas, Kevin Hilman, Ulf Hansson,
	Geert Uytterhoeven

Hi,

After commit b2b49ccbdd54 "PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected" (currently in Linux next) CONFIG_PM_RUNTIME is set whenever
CONFIG_PM is set, so CONFIG_PM can be used in #ifdefs instead of
CONFIG_PM_RUNTIME which simplifies things in quite a few cases.

For this reason, the following patches modify some core code to use
CONFIG_PM instead of CONFIG_PM_RUNTIME.

[1/4] Drop a macro which is redundant after the above commit.
[2/4] Use PM instead of PM_RUNTIME in the core device PM code.
[3/4] Use PM instead of PM_RUNTIME in the ACPI core.
[4/4] Use PM instead of PM_RUNTIME in the PCI core.

They build for me for all of the relevant combinations of options (on x86),
but more testing (on the other architectures) would be welcome.

Thanks!

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro
  2014-11-27  0:37 [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code Rafael J. Wysocki
@ 2014-11-27  0:38 ` Rafael J. Wysocki
  2014-11-27 22:05   ` [Replacement][PATCH 1/4] PM: Merge the SET*_RUNTIME_PM_OPS() macros Rafael J. Wysocki
  2014-12-03 14:15   ` [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro Ulf Hansson
  2014-11-27  0:39 ` [PATCH 2/4] PM: Drop CONFIG_PM_RUNTIME from the driver core Rafael J. Wysocki
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-11-27  0:38 UTC (permalink / raw)
  To: Linux PM list
  Cc: Linux PCI, Linux Kernel Mailing List, ACPI Devel Maling List,
	Alan Stern, Bjorn Helgaas, Kevin Hilman, Ulf Hansson,
	Geert Uytterhoeven

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

The SET_PM_RUNTIME_PM_OPS() and SET_RUNTIME_PM_OPS() macros are
identical except that one of them is not empty for CONFIG_PM set,
while the other one is not empty for CONFIG_PM_RUNTIME set,
respectively.

However, after commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so one
of these macros is now redundant.

For this reason, drop SET_PM_RUNTIME_PM_OPS() and replace it with
SET_RUNTIME_PM_OPS() everywhere.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/amba/bus.c                |    2 +-
 drivers/dma/ste_dma40.c           |    2 +-
 drivers/gpio/gpio-zynq.c          |    2 +-
 drivers/i2c/busses/i2c-hix5hd2.c  |    2 +-
 drivers/i2c/busses/i2c-nomadik.c  |    2 +-
 drivers/mmc/host/mmci.c           |    2 +-
 drivers/mmc/host/sh_mobile_sdhi.c |    2 +-
 drivers/mmc/host/tmio_mmc.c       |    2 +-
 drivers/spi/spi-pl022.c           |    2 +-
 include/linux/pm.h                |   11 +----------
 10 files changed, 10 insertions(+), 19 deletions(-)

Index: linux-pm/drivers/amba/bus.c
===================================================================
--- linux-pm.orig/drivers/amba/bus.c
+++ linux-pm/drivers/amba/bus.c
@@ -124,7 +124,7 @@ static const struct dev_pm_ops amba_pm =
 	.thaw		= pm_generic_thaw,
 	.poweroff	= pm_generic_poweroff,
 	.restore	= pm_generic_restore,
-	SET_PM_RUNTIME_PM_OPS(
+	SET_RUNTIME_PM_OPS(
 		amba_pm_runtime_suspend,
 		amba_pm_runtime_resume,
 		NULL
Index: linux-pm/drivers/dma/ste_dma40.c
===================================================================
--- linux-pm.orig/drivers/dma/ste_dma40.c
+++ linux-pm/drivers/dma/ste_dma40.c
@@ -3051,7 +3051,7 @@ static int dma40_runtime_resume(struct d
 
 static const struct dev_pm_ops dma40_pm_ops = {
 	SET_LATE_SYSTEM_SLEEP_PM_OPS(dma40_suspend, dma40_resume)
-	SET_PM_RUNTIME_PM_OPS(dma40_runtime_suspend,
+	SET_RUNTIME_PM_OPS(dma40_runtime_suspend,
 				dma40_runtime_resume,
 				NULL)
 };
Index: linux-pm/drivers/gpio/gpio-zynq.c
===================================================================
--- linux-pm.orig/drivers/gpio/gpio-zynq.c
+++ linux-pm/drivers/gpio/gpio-zynq.c
@@ -578,7 +578,7 @@ static void zynq_gpio_free(struct gpio_c
 
 static const struct dev_pm_ops zynq_gpio_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume)
-	SET_PM_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend,
+	SET_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend,
 			zynq_gpio_runtime_resume, NULL)
 };
 
Index: linux-pm/drivers/i2c/busses/i2c-hix5hd2.c
===================================================================
--- linux-pm.orig/drivers/i2c/busses/i2c-hix5hd2.c
+++ linux-pm/drivers/i2c/busses/i2c-hix5hd2.c
@@ -528,7 +528,7 @@ static int hix5hd2_i2c_runtime_resume(st
 #endif
 
 static const struct dev_pm_ops hix5hd2_i2c_pm_ops = {
-	SET_PM_RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend,
+	SET_RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend,
 			      hix5hd2_i2c_runtime_resume,
 			      NULL)
 };
Index: linux-pm/drivers/i2c/busses/i2c-nomadik.c
===================================================================
--- linux-pm.orig/drivers/i2c/busses/i2c-nomadik.c
+++ linux-pm/drivers/i2c/busses/i2c-nomadik.c
@@ -932,7 +932,7 @@ static int nmk_i2c_runtime_resume(struct
 
 static const struct dev_pm_ops nmk_i2c_pm = {
 	SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early)
-	SET_PM_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
+	SET_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
 			nmk_i2c_runtime_resume,
 			NULL)
 };
Index: linux-pm/drivers/mmc/host/mmci.c
===================================================================
--- linux-pm.orig/drivers/mmc/host/mmci.c
+++ linux-pm/drivers/mmc/host/mmci.c
@@ -1843,7 +1843,7 @@ static int mmci_runtime_resume(struct de
 static const struct dev_pm_ops mmci_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
 				pm_runtime_force_resume)
-	SET_PM_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL)
+	SET_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL)
 };
 
 static struct amba_id mmci_ids[] = {
Index: linux-pm/drivers/mmc/host/sh_mobile_sdhi.c
===================================================================
--- linux-pm.orig/drivers/mmc/host/sh_mobile_sdhi.c
+++ linux-pm/drivers/mmc/host/sh_mobile_sdhi.c
@@ -375,7 +375,7 @@ static int sh_mobile_sdhi_remove(struct
 static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
 			pm_runtime_force_resume)
-	SET_PM_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
+	SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
 			tmio_mmc_host_runtime_resume,
 			NULL)
 };
Index: linux-pm/drivers/mmc/host/tmio_mmc.c
===================================================================
--- linux-pm.orig/drivers/mmc/host/tmio_mmc.c
+++ linux-pm/drivers/mmc/host/tmio_mmc.c
@@ -135,7 +135,7 @@ static int tmio_mmc_remove(struct platfo
 
 static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume)
-	SET_PM_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
+	SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
 			tmio_mmc_host_runtime_resume,
 			NULL)
 };
Index: linux-pm/drivers/spi/spi-pl022.c
===================================================================
--- linux-pm.orig/drivers/spi/spi-pl022.c
+++ linux-pm/drivers/spi/spi-pl022.c
@@ -2377,7 +2377,7 @@ static int pl022_runtime_resume(struct d
 
 static const struct dev_pm_ops pl022_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume)
-	SET_PM_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL)
+	SET_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL)
 };
 
 static struct vendor_data vendor_arm = {
Index: linux-pm/include/linux/pm.h
===================================================================
--- linux-pm.orig/include/linux/pm.h
+++ linux-pm/include/linux/pm.h
@@ -342,7 +342,7 @@ struct dev_pm_ops {
 #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
 #endif
 
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
 	.runtime_suspend = suspend_fn, \
 	.runtime_resume = resume_fn, \
@@ -351,15 +351,6 @@ struct dev_pm_ops {
 #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
 #endif
 
-#ifdef CONFIG_PM
-#define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
-	.runtime_suspend = suspend_fn, \
-	.runtime_resume = resume_fn, \
-	.runtime_idle = idle_fn,
-#else
-#define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
-#endif
-
 /*
  * Use this if you want to use the same suspend and resume callbacks for suspend
  * to RAM and hibernation.


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

* [PATCH 2/4] PM: Drop CONFIG_PM_RUNTIME from the driver core
  2014-11-27  0:37 [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code Rafael J. Wysocki
  2014-11-27  0:38 ` [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro Rafael J. Wysocki
@ 2014-11-27  0:39 ` Rafael J. Wysocki
  2014-11-27  0:40 ` [PATCH 3/4] ACPI / PM: Drop CONFIG_PM_RUNTIME from the ACPI core Rafael J. Wysocki
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-11-27  0:39 UTC (permalink / raw)
  To: Linux PM list
  Cc: Linux PCI, Linux Kernel Mailing List, ACPI Devel Maling List,
	Alan Stern, Bjorn Helgaas, Kevin Hilman, Ulf Hansson,
	Geert Uytterhoeven

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so quite a few
#ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to
depend on CONFIG_PM or even may be dropped entirely in some cases.

Replace CONFIG_PM_RUNTIME with CONFIG_PM in the PM core code.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/base/power/clock_ops.c       |   69 +----------------------------------
 drivers/base/power/domain.c          |   34 +----------------
 drivers/base/power/domain_governor.c |   11 -----
 drivers/base/power/power.h           |   56 ++++++++++++----------------
 drivers/base/power/qos.c             |    5 --
 drivers/base/power/runtime.c         |    9 ----
 drivers/base/power/sysfs.c           |   19 ---------
 include/linux/pm.h                   |    2 -
 include/linux/pm_domain.h            |    8 +---
 include/linux/pm_qos.h               |   38 ++++++++-----------
 include/linux/pm_runtime.h           |   21 ++++------
 kernel/power/Kconfig                 |    4 --
 12 files changed, 60 insertions(+), 216 deletions(-)

Index: linux-pm/include/linux/pm.h
===================================================================
--- linux-pm.orig/include/linux/pm.h
+++ linux-pm/include/linux/pm.h
@@ -563,7 +563,7 @@ struct dev_pm_info {
 #else
 	unsigned int		should_wakeup:1;
 #endif
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 	struct timer_list	suspend_timer;
 	unsigned long		timer_expires;
 	struct work_struct	work;
Index: linux-pm/include/linux/pm_runtime.h
===================================================================
--- linux-pm.orig/include/linux/pm_runtime.h
+++ linux-pm/include/linux/pm_runtime.h
@@ -35,16 +35,6 @@ extern int pm_generic_runtime_suspend(st
 extern int pm_generic_runtime_resume(struct device *dev);
 extern int pm_runtime_force_suspend(struct device *dev);
 extern int pm_runtime_force_resume(struct device *dev);
-#else
-static inline bool queue_pm_work(struct work_struct *work) { return false; }
-
-static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
-static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
-static inline int pm_runtime_force_suspend(struct device *dev) { return 0; }
-static inline int pm_runtime_force_resume(struct device *dev) { return 0; }
-#endif
-
-#ifdef CONFIG_PM_RUNTIME
 
 extern int __pm_runtime_idle(struct device *dev, int rpmflags);
 extern int __pm_runtime_suspend(struct device *dev, int rpmflags);
@@ -128,7 +118,14 @@ static inline void pm_runtime_mark_last_
 	ACCESS_ONCE(dev->power.last_busy) = jiffies;
 }
 
-#else /* !CONFIG_PM_RUNTIME */
+#else /* !CONFIG_PM */
+
+static inline bool queue_pm_work(struct work_struct *work) { return false; }
+
+static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
+static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
+static inline int pm_runtime_force_suspend(struct device *dev) { return 0; }
+static inline int pm_runtime_force_resume(struct device *dev) { return 0; }
 
 static inline int __pm_runtime_idle(struct device *dev, int rpmflags)
 {
@@ -179,7 +176,7 @@ static inline unsigned long pm_runtime_a
 static inline void pm_runtime_set_memalloc_noio(struct device *dev,
 						bool enable){}
 
-#endif /* !CONFIG_PM_RUNTIME */
+#endif /* !CONFIG_PM */
 
 static inline int pm_runtime_idle(struct device *dev)
 {
Index: linux-pm/drivers/base/power/power.h
===================================================================
--- linux-pm.orig/drivers/base/power/power.h
+++ linux-pm/drivers/base/power/power.h
@@ -9,7 +9,7 @@ static inline void device_pm_init_common
 	}
 }
 
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 
 static inline void pm_runtime_early_init(struct device *dev)
 {
@@ -20,7 +20,21 @@ static inline void pm_runtime_early_init
 extern void pm_runtime_init(struct device *dev);
 extern void pm_runtime_remove(struct device *dev);
 
-#else /* !CONFIG_PM_RUNTIME */
+/*
+ * sysfs.c
+ */
+
+extern int dpm_sysfs_add(struct device *dev);
+extern void dpm_sysfs_remove(struct device *dev);
+extern void rpm_sysfs_remove(struct device *dev);
+extern int wakeup_sysfs_add(struct device *dev);
+extern void wakeup_sysfs_remove(struct device *dev);
+extern int pm_qos_sysfs_add_resume_latency(struct device *dev);
+extern void pm_qos_sysfs_remove_resume_latency(struct device *dev);
+extern int pm_qos_sysfs_add_flags(struct device *dev);
+extern void pm_qos_sysfs_remove_flags(struct device *dev);
+
+#else /* CONFIG_PM */
 
 static inline void pm_runtime_early_init(struct device *dev)
 {
@@ -30,7 +44,15 @@ static inline void pm_runtime_early_init
 static inline void pm_runtime_init(struct device *dev) {}
 static inline void pm_runtime_remove(struct device *dev) {}
 
-#endif /* !CONFIG_PM_RUNTIME */
+static inline int dpm_sysfs_add(struct device *dev) { return 0; }
+static inline void dpm_sysfs_remove(struct device *dev) {}
+static inline void rpm_sysfs_remove(struct device *dev) {}
+static inline int wakeup_sysfs_add(struct device *dev) { return 0; }
+static inline void wakeup_sysfs_remove(struct device *dev) {}
+static inline int pm_qos_sysfs_add(struct device *dev) { return 0; }
+static inline void pm_qos_sysfs_remove(struct device *dev) {}
+
+#endif
 
 #ifdef CONFIG_PM_SLEEP
 
@@ -77,31 +99,3 @@ static inline void device_pm_init(struct
 	device_pm_sleep_init(dev);
 	pm_runtime_init(dev);
 }
-
-#ifdef CONFIG_PM
-
-/*
- * sysfs.c
- */
-
-extern int dpm_sysfs_add(struct device *dev);
-extern void dpm_sysfs_remove(struct device *dev);
-extern void rpm_sysfs_remove(struct device *dev);
-extern int wakeup_sysfs_add(struct device *dev);
-extern void wakeup_sysfs_remove(struct device *dev);
-extern int pm_qos_sysfs_add_resume_latency(struct device *dev);
-extern void pm_qos_sysfs_remove_resume_latency(struct device *dev);
-extern int pm_qos_sysfs_add_flags(struct device *dev);
-extern void pm_qos_sysfs_remove_flags(struct device *dev);
-
-#else /* CONFIG_PM */
-
-static inline int dpm_sysfs_add(struct device *dev) { return 0; }
-static inline void dpm_sysfs_remove(struct device *dev) {}
-static inline void rpm_sysfs_remove(struct device *dev) {}
-static inline int wakeup_sysfs_add(struct device *dev) { return 0; }
-static inline void wakeup_sysfs_remove(struct device *dev) {}
-static inline int pm_qos_sysfs_add(struct device *dev) { return 0; }
-static inline void pm_qos_sysfs_remove(struct device *dev) {}
-
-#endif
Index: linux-pm/drivers/base/power/clock_ops.c
===================================================================
--- linux-pm.orig/drivers/base/power/clock_ops.c
+++ linux-pm/drivers/base/power/clock_ops.c
@@ -256,10 +256,6 @@ void pm_clk_destroy(struct device *dev)
 	}
 }
 
-#endif /* CONFIG_PM */
-
-#ifdef CONFIG_PM_RUNTIME
-
 /**
  * pm_clk_suspend - Disable clocks in a device's PM clock list.
  * @dev: Device to disable the clocks for.
@@ -373,68 +369,7 @@ static int pm_clk_notify(struct notifier
 	return 0;
 }
 
-#else /* !CONFIG_PM_RUNTIME */
-
-#ifdef CONFIG_PM
-
-/**
- * pm_clk_suspend - Disable clocks in a device's PM clock list.
- * @dev: Device to disable the clocks for.
- */
-int pm_clk_suspend(struct device *dev)
-{
-	struct pm_subsys_data *psd = dev_to_psd(dev);
-	struct pm_clock_entry *ce;
-	unsigned long flags;
-
-	dev_dbg(dev, "%s()\n", __func__);
-
-	/* If there is no driver, the clocks are already disabled. */
-	if (!psd || !dev->driver)
-		return 0;
-
-	spin_lock_irqsave(&psd->lock, flags);
-
-	list_for_each_entry_reverse(ce, &psd->clock_list, node) {
-		if (ce->status < PCE_STATUS_ERROR) {
-			if (ce->status == PCE_STATUS_ENABLED)
-				clk_disable(ce->clk);
-			ce->status = PCE_STATUS_ACQUIRED;
-		}
-	}
-
-	spin_unlock_irqrestore(&psd->lock, flags);
-
-	return 0;
-}
-
-/**
- * pm_clk_resume - Enable clocks in a device's PM clock list.
- * @dev: Device to enable the clocks for.
- */
-int pm_clk_resume(struct device *dev)
-{
-	struct pm_subsys_data *psd = dev_to_psd(dev);
-	struct pm_clock_entry *ce;
-	unsigned long flags;
-
-	dev_dbg(dev, "%s()\n", __func__);
-
-	/* If there is no driver, the clocks should remain disabled. */
-	if (!psd || !dev->driver)
-		return 0;
-
-	spin_lock_irqsave(&psd->lock, flags);
-
-	list_for_each_entry(ce, &psd->clock_list, node)
-		__pm_clk_enable(dev, ce);
-
-	spin_unlock_irqrestore(&psd->lock, flags);
-
-	return 0;
-}
-
-#endif /* CONFIG_PM */
+#else /* !CONFIG_PM */
 
 /**
  * enable_clock - Enable a device clock.
@@ -514,7 +449,7 @@ static int pm_clk_notify(struct notifier
 	return 0;
 }
 
-#endif /* !CONFIG_PM_RUNTIME */
+#endif /* !CONFIG_PM */
 
 /**
  * pm_clk_add_notifier - Add bus type notifier for power management clocks.
Index: linux-pm/drivers/base/power/domain.c
===================================================================
--- linux-pm.orig/drivers/base/power/domain.c
+++ linux-pm/drivers/base/power/domain.c
@@ -317,8 +317,6 @@ int pm_genpd_name_poweron(const char *do
 	return genpd ? pm_genpd_poweron(genpd) : -EINVAL;
 }
 
-#ifdef CONFIG_PM_RUNTIME
-
 static int genpd_start_dev_no_timing(struct generic_pm_domain *genpd,
 				     struct device *dev)
 {
@@ -777,24 +775,6 @@ static int __init genpd_poweroff_unused(
 }
 late_initcall(genpd_poweroff_unused);
 
-#else
-
-static inline int genpd_dev_pm_qos_notifier(struct notifier_block *nb,
-					    unsigned long val, void *ptr)
-{
-	return NOTIFY_DONE;
-}
-
-static inline void
-genpd_queue_power_off_work(struct generic_pm_domain *genpd) {}
-
-static inline void genpd_power_off_work_fn(struct work_struct *work) {}
-
-#define pm_genpd_runtime_suspend	NULL
-#define pm_genpd_runtime_resume		NULL
-
-#endif /* CONFIG_PM_RUNTIME */
-
 #ifdef CONFIG_PM_SLEEP
 
 /**
@@ -1383,7 +1363,7 @@ void pm_genpd_syscore_poweron(struct dev
 }
 EXPORT_SYMBOL_GPL(pm_genpd_syscore_poweron);
 
-#else
+#else /* !CONFIG_PM_SLEEP */
 
 #define pm_genpd_prepare		NULL
 #define pm_genpd_suspend		NULL
@@ -2240,7 +2220,7 @@ int genpd_dev_pm_attach(struct device *d
 	return 0;
 }
 EXPORT_SYMBOL_GPL(genpd_dev_pm_attach);
-#endif
+#endif /* CONFIG_PM_GENERIC_DOMAINS_OF */
 
 
 /***        debugfs support        ***/
@@ -2256,10 +2236,8 @@ static struct dentry *pm_genpd_debugfs_d
 
 /*
  * TODO: This function is a slightly modified version of rtpm_status_show
- * from sysfs.c, but dependencies between PM_GENERIC_DOMAINS and PM_RUNTIME
- * are too loose to generalize it.
+ * from sysfs.c, so generalize it.
  */
-#ifdef CONFIG_PM_RUNTIME
 static void rtpm_status_str(struct seq_file *s, struct device *dev)
 {
 	static const char * const status_lookup[] = {
@@ -2281,12 +2259,6 @@ static void rtpm_status_str(struct seq_f
 
 	seq_puts(s, p);
 }
-#else
-static void rtpm_status_str(struct seq_file *s, struct device *dev)
-{
-	seq_puts(s, "active");
-}
-#endif
 
 static int pm_genpd_summary_one(struct seq_file *s,
 		struct generic_pm_domain *gpd)
Index: linux-pm/drivers/base/power/domain_governor.c
===================================================================
--- linux-pm.orig/drivers/base/power/domain_governor.c
+++ linux-pm/drivers/base/power/domain_governor.c
@@ -11,8 +11,6 @@
 #include <linux/pm_qos.h>
 #include <linux/hrtimer.h>
 
-#ifdef CONFIG_PM_RUNTIME
-
 static int dev_update_qos_constraint(struct device *dev, void *data)
 {
 	s64 *constraint_ns_p = data;
@@ -227,15 +225,6 @@ static bool always_on_power_down_ok(stru
 	return false;
 }
 
-#else /* !CONFIG_PM_RUNTIME */
-
-static inline bool default_stop_ok(struct device *dev) { return false; }
-
-#define default_power_down_ok	NULL
-#define always_on_power_down_ok	NULL
-
-#endif /* !CONFIG_PM_RUNTIME */
-
 struct dev_power_governor simple_qos_governor = {
 	.stop_ok = default_stop_ok,
 	.power_down_ok = default_power_down_ok,
Index: linux-pm/drivers/base/power/qos.c
===================================================================
--- linux-pm.orig/drivers/base/power/qos.c
+++ linux-pm/drivers/base/power/qos.c
@@ -599,7 +599,6 @@ int dev_pm_qos_add_ancestor_request(stru
 }
 EXPORT_SYMBOL_GPL(dev_pm_qos_add_ancestor_request);
 
-#ifdef CONFIG_PM_RUNTIME
 static void __dev_pm_qos_drop_user_request(struct device *dev,
 					   enum dev_pm_qos_req_type type)
 {
@@ -880,7 +879,3 @@ int dev_pm_qos_update_user_latency_toler
 	mutex_unlock(&dev_pm_qos_mtx);
 	return ret;
 }
-#else /* !CONFIG_PM_RUNTIME */
-static void __dev_pm_qos_hide_latency_limit(struct device *dev) {}
-static void __dev_pm_qos_hide_flags(struct device *dev) {}
-#endif /* CONFIG_PM_RUNTIME */
Index: linux-pm/drivers/base/power/runtime.c
===================================================================
--- linux-pm.orig/drivers/base/power/runtime.c
+++ linux-pm/drivers/base/power/runtime.c
@@ -45,8 +45,6 @@ static pm_callback_t __rpm_get_callback(
 #define RPM_GET_CALLBACK(dev, callback) \
 		__rpm_get_callback(dev, offsetof(struct dev_pm_ops, callback))
 
-#ifdef CONFIG_PM_RUNTIME
-
 static int rpm_resume(struct device *dev, int rpmflags);
 static int rpm_suspend(struct device *dev, int rpmflags);
 
@@ -1399,7 +1397,6 @@ void pm_runtime_remove(struct device *de
 	if (dev->power.irq_safe && dev->parent)
 		pm_runtime_put(dev->parent);
 }
-#endif
 
 /**
  * pm_runtime_force_suspend - Force a device into suspend state if needed.
@@ -1419,12 +1416,6 @@ int pm_runtime_force_suspend(struct devi
 	int ret = 0;
 
 	pm_runtime_disable(dev);
-
-	/*
-	 * Note that pm_runtime_status_suspended() returns false while
-	 * !CONFIG_PM_RUNTIME, which means the device will be put into low
-	 * power state.
-	 */
 	if (pm_runtime_status_suspended(dev))
 		return 0;
 
Index: linux-pm/drivers/base/power/sysfs.c
===================================================================
--- linux-pm.orig/drivers/base/power/sysfs.c
+++ linux-pm/drivers/base/power/sysfs.c
@@ -95,7 +95,6 @@
 const char power_group_name[] = "power";
 EXPORT_SYMBOL_GPL(power_group_name);
 
-#ifdef CONFIG_PM_RUNTIME
 static const char ctrl_auto[] = "auto";
 static const char ctrl_on[] = "on";
 
@@ -330,7 +329,6 @@ static ssize_t pm_qos_remote_wakeup_stor
 
 static DEVICE_ATTR(pm_qos_remote_wakeup, 0644,
 		   pm_qos_remote_wakeup_show, pm_qos_remote_wakeup_store);
-#endif /* CONFIG_PM_RUNTIME */
 
 #ifdef CONFIG_PM_SLEEP
 static const char _enabled[] = "enabled";
@@ -531,8 +529,6 @@ static DEVICE_ATTR(wakeup_prevent_sleep_
 #endif /* CONFIG_PM_SLEEP */
 
 #ifdef CONFIG_PM_ADVANCED_DEBUG
-#ifdef CONFIG_PM_RUNTIME
-
 static ssize_t rtpm_usagecount_show(struct device *dev,
 				    struct device_attribute *attr, char *buf)
 {
@@ -562,10 +558,7 @@ static DEVICE_ATTR(runtime_usage, 0444,
 static DEVICE_ATTR(runtime_active_kids, 0444, rtpm_children_show, NULL);
 static DEVICE_ATTR(runtime_enabled, 0444, rtpm_enabled_show, NULL);
 
-#endif
-
 #ifdef CONFIG_PM_SLEEP
-
 static ssize_t async_show(struct device *dev, struct device_attribute *attr,
 			  char *buf)
 {
@@ -595,7 +588,7 @@ static ssize_t async_store(struct device
 
 static DEVICE_ATTR(async, 0644, async_show, async_store);
 
-#endif
+#endif /* CONFIG_PM_SLEEP */
 #endif /* CONFIG_PM_ADVANCED_DEBUG */
 
 static struct attribute *power_attrs[] = {
@@ -603,12 +596,10 @@ static struct attribute *power_attrs[] =
 #ifdef CONFIG_PM_SLEEP
 	&dev_attr_async.attr,
 #endif
-#ifdef CONFIG_PM_RUNTIME
 	&dev_attr_runtime_status.attr,
 	&dev_attr_runtime_usage.attr,
 	&dev_attr_runtime_active_kids.attr,
 	&dev_attr_runtime_enabled.attr,
-#endif
 #endif /* CONFIG_PM_ADVANCED_DEBUG */
 	NULL,
 };
@@ -640,7 +631,6 @@ static struct attribute_group pm_wakeup_
 };
 
 static struct attribute *runtime_attrs[] = {
-#ifdef CONFIG_PM_RUNTIME
 #ifndef CONFIG_PM_ADVANCED_DEBUG
 	&dev_attr_runtime_status.attr,
 #endif
@@ -648,7 +638,6 @@ static struct attribute *runtime_attrs[]
 	&dev_attr_runtime_suspended_time.attr,
 	&dev_attr_runtime_active_time.attr,
 	&dev_attr_autosuspend_delay_ms.attr,
-#endif /* CONFIG_PM_RUNTIME */
 	NULL,
 };
 static struct attribute_group pm_runtime_attr_group = {
@@ -657,9 +646,7 @@ static struct attribute_group pm_runtime
 };
 
 static struct attribute *pm_qos_resume_latency_attrs[] = {
-#ifdef CONFIG_PM_RUNTIME
 	&dev_attr_pm_qos_resume_latency_us.attr,
-#endif /* CONFIG_PM_RUNTIME */
 	NULL,
 };
 static struct attribute_group pm_qos_resume_latency_attr_group = {
@@ -668,9 +655,7 @@ static struct attribute_group pm_qos_res
 };
 
 static struct attribute *pm_qos_latency_tolerance_attrs[] = {
-#ifdef CONFIG_PM_RUNTIME
 	&dev_attr_pm_qos_latency_tolerance_us.attr,
-#endif /* CONFIG_PM_RUNTIME */
 	NULL,
 };
 static struct attribute_group pm_qos_latency_tolerance_attr_group = {
@@ -679,10 +664,8 @@ static struct attribute_group pm_qos_lat
 };
 
 static struct attribute *pm_qos_flags_attrs[] = {
-#ifdef CONFIG_PM_RUNTIME
 	&dev_attr_pm_qos_no_power_off.attr,
 	&dev_attr_pm_qos_remote_wakeup.attr,
-#endif /* CONFIG_PM_RUNTIME */
 	NULL,
 };
 static struct attribute_group pm_qos_flags_attr_group = {
Index: linux-pm/include/linux/pm_domain.h
===================================================================
--- linux-pm.orig/include/linux/pm_domain.h
+++ linux-pm/include/linux/pm_domain.h
@@ -152,6 +152,7 @@ extern void pm_genpd_init(struct generic
 
 extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
 extern int pm_genpd_name_poweron(const char *domain_name);
+extern void pm_genpd_poweroff_unused(void);
 
 extern struct dev_power_governor simple_qos_governor;
 extern struct dev_power_governor pm_domain_always_on_gov;
@@ -226,6 +227,7 @@ static inline int pm_genpd_name_poweron(
 {
 	return -ENOSYS;
 }
+static inline void pm_genpd_poweroff_unused(void) {}
 #define simple_qos_governor NULL
 #define pm_domain_always_on_gov NULL
 #endif
@@ -242,12 +244,6 @@ static inline int pm_genpd_name_add_devi
 	return __pm_genpd_name_add_device(domain_name, dev, NULL);
 }
 
-#ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME
-extern void pm_genpd_poweroff_unused(void);
-#else
-static inline void pm_genpd_poweroff_unused(void) {}
-#endif
-
 #ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP
 extern void pm_genpd_syscore_poweroff(struct device *dev);
 extern void pm_genpd_syscore_poweron(struct device *dev);
Index: linux-pm/kernel/power/Kconfig
===================================================================
--- linux-pm.orig/kernel/power/Kconfig
+++ linux-pm/kernel/power/Kconfig
@@ -298,10 +298,6 @@ config PM_GENERIC_DOMAINS_SLEEP
 	def_bool y
 	depends on PM_SLEEP && PM_GENERIC_DOMAINS
 
-config PM_GENERIC_DOMAINS_RUNTIME
-	def_bool y
-	depends on PM_RUNTIME && PM_GENERIC_DOMAINS
-
 config PM_GENERIC_DOMAINS_OF
 	def_bool y
 	depends on PM_GENERIC_DOMAINS && OF
Index: linux-pm/include/linux/pm_qos.h
===================================================================
--- linux-pm.orig/include/linux/pm_qos.h
+++ linux-pm/include/linux/pm_qos.h
@@ -154,6 +154,23 @@ void dev_pm_qos_constraints_destroy(stru
 int dev_pm_qos_add_ancestor_request(struct device *dev,
 				    struct dev_pm_qos_request *req,
 				    enum dev_pm_qos_req_type type, s32 value);
+int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value);
+void dev_pm_qos_hide_latency_limit(struct device *dev);
+int dev_pm_qos_expose_flags(struct device *dev, s32 value);
+void dev_pm_qos_hide_flags(struct device *dev);
+int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set);
+s32 dev_pm_qos_get_user_latency_tolerance(struct device *dev);
+int dev_pm_qos_update_user_latency_tolerance(struct device *dev, s32 val);
+
+static inline s32 dev_pm_qos_requested_resume_latency(struct device *dev)
+{
+	return dev->power.qos->resume_latency_req->data.pnode.prio;
+}
+
+static inline s32 dev_pm_qos_requested_flags(struct device *dev)
+{
+	return dev->power.qos->flags_req->data.flr.flags;
+}
 #else
 static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev,
 							  s32 mask)
@@ -200,27 +217,6 @@ static inline int dev_pm_qos_add_ancesto
 						  enum dev_pm_qos_req_type type,
 						  s32 value)
 			{ return 0; }
-#endif
-
-#ifdef CONFIG_PM_RUNTIME
-int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value);
-void dev_pm_qos_hide_latency_limit(struct device *dev);
-int dev_pm_qos_expose_flags(struct device *dev, s32 value);
-void dev_pm_qos_hide_flags(struct device *dev);
-int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set);
-s32 dev_pm_qos_get_user_latency_tolerance(struct device *dev);
-int dev_pm_qos_update_user_latency_tolerance(struct device *dev, s32 val);
-
-static inline s32 dev_pm_qos_requested_resume_latency(struct device *dev)
-{
-	return dev->power.qos->resume_latency_req->data.pnode.prio;
-}
-
-static inline s32 dev_pm_qos_requested_flags(struct device *dev)
-{
-	return dev->power.qos->flags_req->data.flr.flags;
-}
-#else
 static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value)
 			{ return 0; }
 static inline void dev_pm_qos_hide_latency_limit(struct device *dev) {}


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

* [PATCH 3/4] ACPI / PM: Drop CONFIG_PM_RUNTIME from the ACPI core
  2014-11-27  0:37 [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code Rafael J. Wysocki
  2014-11-27  0:38 ` [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro Rafael J. Wysocki
  2014-11-27  0:39 ` [PATCH 2/4] PM: Drop CONFIG_PM_RUNTIME from the driver core Rafael J. Wysocki
@ 2014-11-27  0:40 ` Rafael J. Wysocki
  2014-11-27 22:06   ` [Update][PATCH " Rafael J. Wysocki
  2014-11-27  0:40 ` [PATCH 4/4] PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core Rafael J. Wysocki
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-11-27  0:40 UTC (permalink / raw)
  To: Linux PM list
  Cc: Linux PCI, Linux Kernel Mailing List, ACPI Devel Maling List,
	Alan Stern, Bjorn Helgaas, Kevin Hilman, Ulf Hansson,
	Geert Uytterhoeven

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so quite a few
#ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to
depend on CONFIG_PM.

Replace CONFIG_PM_RUNTIME with CONFIG_PM in the ACPI core code.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/acpi_lpss.c |    4 +---
 drivers/acpi/device_pm.c |    8 ++------
 drivers/acpi/pci_irq.c   |    2 +-
 include/linux/acpi.h     |   26 +++++++++++---------------
 4 files changed, 15 insertions(+), 25 deletions(-)

Index: linux-pm/drivers/acpi/acpi_lpss.c
===================================================================
--- linux-pm.orig/drivers/acpi/acpi_lpss.c
+++ linux-pm/drivers/acpi/acpi_lpss.c
@@ -588,7 +588,6 @@ static int acpi_lpss_resume_early(struct
 }
 #endif /* CONFIG_PM_SLEEP */
 
-#ifdef CONFIG_PM_RUNTIME
 static int acpi_lpss_runtime_suspend(struct device *dev)
 {
 	struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev));
@@ -631,11 +630,11 @@ static int acpi_lpss_runtime_resume(stru
 
 	return pm_generic_runtime_resume(dev);
 }
-#endif /* CONFIG_PM_RUNTIME */
 #endif /* CONFIG_PM */
 
 static struct dev_pm_domain acpi_lpss_pm_domain = {
 	.ops = {
+#ifdef CONFIG_PM
 #ifdef CONFIG_PM_SLEEP
 		.prepare = acpi_subsys_prepare,
 		.complete = acpi_subsys_complete,
@@ -647,7 +646,6 @@ static struct dev_pm_domain acpi_lpss_pm
 		.poweroff_late = acpi_lpss_suspend_late,
 		.restore_early = acpi_lpss_resume_early,
 #endif
-#ifdef CONFIG_PM_RUNTIME
 		.runtime_suspend = acpi_lpss_runtime_suspend,
 		.runtime_resume = acpi_lpss_runtime_resume,
 #endif
Index: linux-pm/drivers/acpi/pci_irq.c
===================================================================
--- linux-pm.orig/drivers/acpi/pci_irq.c
+++ linux-pm/drivers/acpi/pci_irq.c
@@ -484,7 +484,7 @@ void acpi_pci_irq_disable(struct pci_dev
 	/* Keep IOAPIC pin configuration when suspending */
 	if (dev->dev.power.is_prepared)
 		return;
-#ifdef	CONFIG_PM_RUNTIME
+#ifdef	CONFIG_PM
 	if (dev->dev.power.runtime_status == RPM_SUSPENDING)
 		return;
 #endif
Index: linux-pm/drivers/acpi/device_pm.c
===================================================================
--- linux-pm.orig/drivers/acpi/device_pm.c
+++ linux-pm/drivers/acpi/device_pm.c
@@ -692,7 +692,6 @@ static int acpi_device_wakeup(struct acp
 	return 0;
 }
 
-#ifdef CONFIG_PM_RUNTIME
 /**
  * acpi_pm_device_run_wake - Enable/disable remote wakeup for given device.
  * @dev: Device to enable/disable the platform to wake up.
@@ -714,7 +713,6 @@ int acpi_pm_device_run_wake(struct devic
 	return acpi_device_wakeup(adev, ACPI_STATE_S0, enable);
 }
 EXPORT_SYMBOL(acpi_pm_device_run_wake);
-#endif /* CONFIG_PM_RUNTIME */
 
 #ifdef CONFIG_PM_SLEEP
 /**
@@ -773,7 +771,6 @@ static int acpi_dev_pm_full_power(struct
 		acpi_device_set_power(adev, ACPI_STATE_D0) : 0;
 }
 
-#ifdef CONFIG_PM_RUNTIME
 /**
  * acpi_dev_runtime_suspend - Put device into a low-power state using ACPI.
  * @dev: Device to put into a low-power state.
@@ -855,7 +852,6 @@ int acpi_subsys_runtime_resume(struct de
 	return ret ? ret : pm_generic_runtime_resume(dev);
 }
 EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume);
-#endif /* CONFIG_PM_RUNTIME */
 
 #ifdef CONFIG_PM_SLEEP
 /**
@@ -1023,10 +1019,9 @@ EXPORT_SYMBOL_GPL(acpi_subsys_freeze);
 
 static struct dev_pm_domain acpi_general_pm_domain = {
 	.ops = {
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 		.runtime_suspend = acpi_subsys_runtime_suspend,
 		.runtime_resume = acpi_subsys_runtime_resume,
-#endif
 #ifdef CONFIG_PM_SLEEP
 		.prepare = acpi_subsys_prepare,
 		.complete = acpi_subsys_complete,
@@ -1038,6 +1033,7 @@ static struct dev_pm_domain acpi_general
 		.poweroff_late = acpi_subsys_suspend_late,
 		.restore_early = acpi_subsys_resume_early,
 #endif
+#endif
 	},
 };
 
Index: linux-pm/include/linux/acpi.h
===================================================================
--- linux-pm.orig/include/linux/acpi.h
+++ linux-pm/include/linux/acpi.h
@@ -567,16 +567,26 @@ static inline void arch_reserve_mem_area
 #define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0)
 #endif
 
-#if defined(CONFIG_ACPI) && defined(CONFIG_PM_RUNTIME)
+#if defined(CONFIG_ACPI) && defined(CONFIG_PM)
 int acpi_dev_runtime_suspend(struct device *dev);
 int acpi_dev_runtime_resume(struct device *dev);
 int acpi_subsys_runtime_suspend(struct device *dev);
 int acpi_subsys_runtime_resume(struct device *dev);
+struct acpi_device *acpi_dev_pm_get_node(struct device *dev);
+int acpi_dev_pm_attach(struct device *dev, bool power_on);
 #else
 static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; }
 static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; }
 static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; }
 static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; }
+static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
+{
+	return NULL;
+}
+static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
+{
+	return -ENODEV;
+}
 #endif
 
 #if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP)
@@ -599,20 +609,6 @@ static inline int acpi_subsys_suspend(st
 static inline int acpi_subsys_freeze(struct device *dev) { return 0; }
 #endif
 
-#if defined(CONFIG_ACPI) && defined(CONFIG_PM)
-struct acpi_device *acpi_dev_pm_get_node(struct device *dev);
-int acpi_dev_pm_attach(struct device *dev, bool power_on);
-#else
-static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
-{
-	return NULL;
-}
-static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
-{
-	return -ENODEV;
-}
-#endif
-
 #ifdef CONFIG_ACPI
 __printf(3, 4)
 void acpi_handle_printk(const char *level, acpi_handle handle,


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

* [PATCH 4/4] PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core
  2014-11-27  0:37 [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code Rafael J. Wysocki
                   ` (2 preceding siblings ...)
  2014-11-27  0:40 ` [PATCH 3/4] ACPI / PM: Drop CONFIG_PM_RUNTIME from the ACPI core Rafael J. Wysocki
@ 2014-11-27  0:40 ` Rafael J. Wysocki
  2014-11-27 22:41   ` [Update][PATCH " Rafael J. Wysocki
  2014-11-27  8:57 ` [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code Ulf Hansson
  2014-12-02  1:01 ` Kevin Hilman
  5 siblings, 1 reply; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-11-27  0:40 UTC (permalink / raw)
  To: Linux PM list
  Cc: Linux PCI, Linux Kernel Mailing List, ACPI Devel Maling List,
	Alan Stern, Bjorn Helgaas, Kevin Hilman, Ulf Hansson,
	Geert Uytterhoeven

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so quite a few
#ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to
depend on CONFIG_PM.

Replace CONFIG_PM_RUNTIME with CONFIG_PM in the ACPI core code.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/pci/pci-driver.c |   20 +++++++-------------
 drivers/pci/pci-sysfs.c  |    4 ++--
 drivers/pci/pcie/Kconfig |    2 +-
 3 files changed, 10 insertions(+), 16 deletions(-)

Index: linux-pm/drivers/pci/pcie/Kconfig
===================================================================
--- linux-pm.orig/drivers/pci/pcie/Kconfig
+++ linux-pm/drivers/pci/pcie/Kconfig
@@ -79,4 +79,4 @@ endchoice
 
 config PCIE_PME
 	def_bool y
-	depends on PCIEPORTBUS && PM_RUNTIME
+	depends on PCIEPORTBUS && PM
Index: linux-pm/drivers/pci/pci-driver.c
===================================================================
--- linux-pm.orig/drivers/pci/pci-driver.c
+++ linux-pm/drivers/pci/pci-driver.c
@@ -1104,7 +1104,7 @@ static int pci_pm_restore(struct device
 
 #endif /* !CONFIG_HIBERNATE_CALLBACKS */
 
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 
 static int pci_pm_runtime_suspend(struct device *dev)
 {
@@ -1200,16 +1200,6 @@ static int pci_pm_runtime_idle(struct de
 	return ret;
 }
 
-#else /* !CONFIG_PM_RUNTIME */
-
-#define pci_pm_runtime_suspend	NULL
-#define pci_pm_runtime_resume	NULL
-#define pci_pm_runtime_idle	NULL
-
-#endif /* !CONFIG_PM_RUNTIME */
-
-#ifdef CONFIG_PM
-
 static const struct dev_pm_ops pci_dev_pm_ops = {
 	.prepare = pci_pm_prepare,
 	.suspend = pci_pm_suspend,
@@ -1231,11 +1221,15 @@ static const struct dev_pm_ops pci_dev_p
 
 #define PCI_PM_OPS_PTR	(&pci_dev_pm_ops)
 
-#else /* !COMFIG_PM_OPS */
+#else /* !CONFIG_PM */
+
+#define pci_pm_runtime_suspend	NULL
+#define pci_pm_runtime_resume	NULL
+#define pci_pm_runtime_idle	NULL
 
 #define PCI_PM_OPS_PTR	NULL
 
-#endif /* !COMFIG_PM_OPS */
+#endif /* !CONFIG_PM */
 
 /**
  * __pci_register_driver - register a new pci driver
Index: linux-pm/drivers/pci/pci-sysfs.c
===================================================================
--- linux-pm.orig/drivers/pci/pci-sysfs.c
+++ linux-pm/drivers/pci/pci-sysfs.c
@@ -385,7 +385,7 @@ static ssize_t dev_bus_rescan_store(stru
 }
 static DEVICE_ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, dev_bus_rescan_store);
 
-#if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI)
+#if defined(CONFIG_PM) && defined(CONFIG_ACPI)
 static ssize_t d3cold_allowed_store(struct device *dev,
 				    struct device_attribute *attr,
 				    const char *buf, size_t count)
@@ -566,7 +566,7 @@ static struct attribute *pci_dev_attrs[]
 	&dev_attr_enable.attr,
 	&dev_attr_broken_parity_status.attr,
 	&dev_attr_msi_bus.attr,
-#if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI)
+#if defined(CONFIG_PM) && defined(CONFIG_ACPI)
 	&dev_attr_d3cold_allowed.attr,
 #endif
 #ifdef CONFIG_OF


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

* Re: [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code
  2014-11-27  0:37 [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code Rafael J. Wysocki
                   ` (3 preceding siblings ...)
  2014-11-27  0:40 ` [PATCH 4/4] PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core Rafael J. Wysocki
@ 2014-11-27  8:57 ` Ulf Hansson
  2014-11-27  9:20   ` Ulf Hansson
  2014-11-27 16:52   ` Rafael J. Wysocki
  2014-12-02  1:01 ` Kevin Hilman
  5 siblings, 2 replies; 23+ messages in thread
From: Ulf Hansson @ 2014-11-27  8:57 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM list, Linux PCI, Linux Kernel Mailing List,
	ACPI Devel Maling List, Alan Stern, Bjorn Helgaas, Kevin Hilman,
	Geert Uytterhoeven

On 27 November 2014 at 01:37, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> Hi,
>
> After commit b2b49ccbdd54 "PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
> selected" (currently in Linux next) CONFIG_PM_RUNTIME is set whenever
> CONFIG_PM is set, so CONFIG_PM can be used in #ifdefs instead of
> CONFIG_PM_RUNTIME which simplifies things in quite a few cases.
>
> For this reason, the following patches modify some core code to use
> CONFIG_PM instead of CONFIG_PM_RUNTIME.
>
> [1/4] Drop a macro which is redundant after the above commit.
> [2/4] Use PM instead of PM_RUNTIME in the core device PM code.
> [3/4] Use PM instead of PM_RUNTIME in the ACPI core.
> [4/4] Use PM instead of PM_RUNTIME in the PCI core.
>
> They build for me for all of the relevant combinations of options (on x86),
> but more testing (on the other architectures) would be welcome.

I really like the looks of this patchset!

Noticed that you have applied it for your bleeding edge branch, I
suppose that means you will get some "free" testing in linux-next?

Anyway, I have tested it for ux500 (including the genpd support for
it, available in linux-next). It works nicely!

I have also tested the two Kconfig options; CONFIG_PM_SLEEP (which
selects CONFIG_PM_RUNTIME) and for CONFIG_PM_RUNTIME (with
CONFIG_PM_SLEEP unset).

That brings me to a raise a question; why do we need to keep these two
configurations options? Couldn't we also have CONFIG_PM_RUNTIME to
select CONFIG_PM_SLEEP, that will further simplify things?

Kind regards
Uffe

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

* Re: [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code
  2014-11-27  8:57 ` [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code Ulf Hansson
@ 2014-11-27  9:20   ` Ulf Hansson
  2014-11-27 16:52   ` Rafael J. Wysocki
  1 sibling, 0 replies; 23+ messages in thread
From: Ulf Hansson @ 2014-11-27  9:20 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM list, Linux PCI, Linux Kernel Mailing List,
	ACPI Devel Maling List, Alan Stern, Bjorn Helgaas, Kevin Hilman,
	Geert Uytterhoeven

On 27 November 2014 at 09:57, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 27 November 2014 at 01:37, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
>> Hi,
>>
>> After commit b2b49ccbdd54 "PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
>> selected" (currently in Linux next) CONFIG_PM_RUNTIME is set whenever
>> CONFIG_PM is set, so CONFIG_PM can be used in #ifdefs instead of
>> CONFIG_PM_RUNTIME which simplifies things in quite a few cases.
>>
>> For this reason, the following patches modify some core code to use
>> CONFIG_PM instead of CONFIG_PM_RUNTIME.
>>
>> [1/4] Drop a macro which is redundant after the above commit.
>> [2/4] Use PM instead of PM_RUNTIME in the core device PM code.
>> [3/4] Use PM instead of PM_RUNTIME in the ACPI core.
>> [4/4] Use PM instead of PM_RUNTIME in the PCI core.
>>
>> They build for me for all of the relevant combinations of options (on x86),
>> but more testing (on the other architectures) would be welcome.
>
> I really like the looks of this patchset!
>
> Noticed that you have applied it for your bleeding edge branch, I
> suppose that means you will get some "free" testing in linux-next?
>
> Anyway, I have tested it for ux500 (including the genpd support for
> it, available in linux-next). It works nicely!
>
> I have also tested the two Kconfig options; CONFIG_PM_SLEEP (which
> selects CONFIG_PM_RUNTIME) and for CONFIG_PM_RUNTIME (with
> CONFIG_PM_SLEEP unset).
>
> That brings me to a raise a question; why do we need to keep these two
> configurations options? Couldn't we also have CONFIG_PM_RUNTIME to
> select CONFIG_PM_SLEEP, that will further simplify things?
>

I had look at it. Do you think the below approach could work?

I guess the questions is if there are some configurations that use
CONFIG_PM_RUNTIME but not CONFIG_PM_SLEEP. And if so, should we care?

diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index 6e7708c..425f83a 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -94,7 +94,6 @@ config PM_STD_PARTITION
 config PM_SLEEP
        def_bool y
        depends on SUSPEND || HIBERNATE_CALLBACKS
-       select PM_RUNTIME

 config PM_SLEEP_SMP
        def_bool y
@@ -131,21 +130,12 @@ config PM_WAKELOCKS_GC
        default y

 config PM_RUNTIME
-       bool "Run-time PM core functionality"
-       ---help---
-         Enable functionality allowing I/O devices to be put into energy-saving
-         (low power) states at run time (or autosuspended) after a specified
-         period of inactivity and woken up in response to a hardware-generated
-         wake-up event or a driver's request.
-
-         Hardware support is generally required for this functionality to work
-         and the bus type drivers of the buses the devices are on are
-         responsible for the actual handling of the autosuspend requests and
-         wake-up events.
+       def_bool y
+       depends on PM_SLEEP

 config PM
        def_bool y
-       depends on PM_SLEEP || PM_RUNTIME
+       depends on PM_SLEEP


Kind regards
Uffe

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

* Re: [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code
  2014-11-27  8:57 ` [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code Ulf Hansson
  2014-11-27  9:20   ` Ulf Hansson
@ 2014-11-27 16:52   ` Rafael J. Wysocki
  2014-11-27 17:00     ` Geert Uytterhoeven
  1 sibling, 1 reply; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-11-27 16:52 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Linux PM list, Linux PCI, Linux Kernel Mailing List,
	ACPI Devel Maling List, Alan Stern, Bjorn Helgaas, Kevin Hilman,
	Geert Uytterhoeven

On Thursday, November 27, 2014 09:57:33 AM Ulf Hansson wrote:
> On 27 November 2014 at 01:37, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > Hi,
> >
> > After commit b2b49ccbdd54 "PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
> > selected" (currently in Linux next) CONFIG_PM_RUNTIME is set whenever
> > CONFIG_PM is set, so CONFIG_PM can be used in #ifdefs instead of
> > CONFIG_PM_RUNTIME which simplifies things in quite a few cases.
> >
> > For this reason, the following patches modify some core code to use
> > CONFIG_PM instead of CONFIG_PM_RUNTIME.
> >
> > [1/4] Drop a macro which is redundant after the above commit.
> > [2/4] Use PM instead of PM_RUNTIME in the core device PM code.
> > [3/4] Use PM instead of PM_RUNTIME in the ACPI core.
> > [4/4] Use PM instead of PM_RUNTIME in the PCI core.
> >
> > They build for me for all of the relevant combinations of options (on x86),
> > but more testing (on the other architectures) would be welcome.
> 
> I really like the looks of this patchset!
> 
> Noticed that you have applied it for your bleeding edge branch, I
> suppose that means you will get some "free" testing in linux-next?
> 
> Anyway, I have tested it for ux500 (including the genpd support for
> it, available in linux-next). It works nicely!
> 
> I have also tested the two Kconfig options; CONFIG_PM_SLEEP (which
> selects CONFIG_PM_RUNTIME) and for CONFIG_PM_RUNTIME (with
> CONFIG_PM_SLEEP unset).
> 
> That brings me to a raise a question; why do we need to keep these two
> configurations options? Couldn't we also have CONFIG_PM_RUNTIME to
> select CONFIG_PM_SLEEP, that will further simplify things?

My plan is different.  I'm going to eliminate PM_RUNTIME from the code
and then replace it with PM as a selectable option.  Then, PM_SLEEP will
select PM (directly) and PM_RUNTIME can be entirely dropped.

So in the end we'll have one Kconfig option less, which is a win IMO.

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code
  2014-11-27 16:52   ` Rafael J. Wysocki
@ 2014-11-27 17:00     ` Geert Uytterhoeven
  2014-11-27 17:18       ` Alan Stern
  0 siblings, 1 reply; 23+ messages in thread
From: Geert Uytterhoeven @ 2014-11-27 17:00 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Ulf Hansson, Linux PM list, Linux PCI, Linux Kernel Mailing List,
	ACPI Devel Maling List, Alan Stern, Bjorn Helgaas, Kevin Hilman

Hi Rafael,

On Thu, Nov 27, 2014 at 5:52 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
>> I have also tested the two Kconfig options; CONFIG_PM_SLEEP (which
>> selects CONFIG_PM_RUNTIME) and for CONFIG_PM_RUNTIME (with
>> CONFIG_PM_SLEEP unset).
>>
>> That brings me to a raise a question; why do we need to keep these two
>> configurations options? Couldn't we also have CONFIG_PM_RUNTIME to
>> select CONFIG_PM_SLEEP, that will further simplify things?
>
> My plan is different.  I'm going to eliminate PM_RUNTIME from the code
> and then replace it with PM as a selectable option.  Then, PM_SLEEP will
> select PM (directly) and PM_RUNTIME can be entirely dropped.

What's your rationale for keeping PM_SLEEP, and not consolidating both
PM_RUNTIME and PM_SLEEP into PM? I.e. what am I missing, still
considering myself a PM newbie?

> So in the end we'll have one Kconfig option less, which is a win IMO.

Having two less may be a bigger win ;-)

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] 23+ messages in thread

* Re: [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code
  2014-11-27 17:00     ` Geert Uytterhoeven
@ 2014-11-27 17:18       ` Alan Stern
  2014-11-27 21:35         ` Rafael J. Wysocki
  0 siblings, 1 reply; 23+ messages in thread
From: Alan Stern @ 2014-11-27 17:18 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rafael J. Wysocki, Ulf Hansson, Linux PM list, Linux PCI,
	Linux Kernel Mailing List, ACPI Devel Maling List, Bjorn Helgaas,
	Kevin Hilman

On Thu, 27 Nov 2014, Geert Uytterhoeven wrote:

> Hi Rafael,
> 
> On Thu, Nov 27, 2014 at 5:52 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> >> I have also tested the two Kconfig options; CONFIG_PM_SLEEP (which
> >> selects CONFIG_PM_RUNTIME) and for CONFIG_PM_RUNTIME (with
> >> CONFIG_PM_SLEEP unset).
> >>
> >> That brings me to a raise a question; why do we need to keep these two
> >> configurations options? Couldn't we also have CONFIG_PM_RUNTIME to
> >> select CONFIG_PM_SLEEP, that will further simplify things?
> >
> > My plan is different.  I'm going to eliminate PM_RUNTIME from the code
> > and then replace it with PM as a selectable option.  Then, PM_SLEEP will
> > select PM (directly) and PM_RUNTIME can be entirely dropped.
> 
> What's your rationale for keeping PM_SLEEP, and not consolidating both
> PM_RUNTIME and PM_SLEEP into PM? I.e. what am I missing, still
> considering myself a PM newbie?
> 
> > So in the end we'll have one Kconfig option less, which is a win IMO.
> 
> Having two less may be a bigger win ;-)

I imagine that Rafael would like to continue supporting platforms that 
want to have runtime power management but not suspend or hibernation.  
A number of embedded systems might fall into this category.

Alan Stern


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

* Re: [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code
  2014-11-27 17:18       ` Alan Stern
@ 2014-11-27 21:35         ` Rafael J. Wysocki
  2014-11-27 22:34           ` Ulf Hansson
  0 siblings, 1 reply; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-11-27 21:35 UTC (permalink / raw)
  To: Alan Stern
  Cc: Geert Uytterhoeven, Ulf Hansson, Linux PM list, Linux PCI,
	Linux Kernel Mailing List, ACPI Devel Maling List, Bjorn Helgaas,
	Kevin Hilman

On Thursday, November 27, 2014 12:18:23 PM Alan Stern wrote:
> On Thu, 27 Nov 2014, Geert Uytterhoeven wrote:
> 
> > Hi Rafael,
> > 
> > On Thu, Nov 27, 2014 at 5:52 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > >> I have also tested the two Kconfig options; CONFIG_PM_SLEEP (which
> > >> selects CONFIG_PM_RUNTIME) and for CONFIG_PM_RUNTIME (with
> > >> CONFIG_PM_SLEEP unset).
> > >>
> > >> That brings me to a raise a question; why do we need to keep these two
> > >> configurations options? Couldn't we also have CONFIG_PM_RUNTIME to
> > >> select CONFIG_PM_SLEEP, that will further simplify things?
> > >
> > > My plan is different.  I'm going to eliminate PM_RUNTIME from the code
> > > and then replace it with PM as a selectable option.  Then, PM_SLEEP will
> > > select PM (directly) and PM_RUNTIME can be entirely dropped.
> > 
> > What's your rationale for keeping PM_SLEEP, and not consolidating both
> > PM_RUNTIME and PM_SLEEP into PM? I.e. what am I missing, still
> > considering myself a PM newbie?
> > 
> > > So in the end we'll have one Kconfig option less, which is a win IMO.
> > 
> > Having two less may be a bigger win ;-)
> 
> I imagine that Rafael would like to continue supporting platforms that 
> want to have runtime power management but not suspend or hibernation.  
> A number of embedded systems might fall into this category.

Right.

That said whether or not it is ever useful to set PM_RUNTIME alone is a good
question.  In my opinion it is useful today, at least on some platforms that
don't really support system suspend or hibernation in any form.  However, it
may not be the case any more when suspend-to-idle becomes mature enough,
because that should just work for any platform without any kind of special
support.  We're still missing some timekeeping bits there, but once that
gap has been covered, we may just eliminate PM_SLEEP as well if there's a
broad consensus on that.

Rafael


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

* [Replacement][PATCH 1/4] PM: Merge the SET*_RUNTIME_PM_OPS() macros
  2014-11-27  0:38 ` [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro Rafael J. Wysocki
@ 2014-11-27 22:05   ` Rafael J. Wysocki
  2014-11-29  0:52     ` Rafael J. Wysocki
  2014-12-03 14:15   ` [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro Ulf Hansson
  1 sibling, 1 reply; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-11-27 22:05 UTC (permalink / raw)
  To: Linux PM list
  Cc: Linux PCI, Linux Kernel Mailing List, ACPI Devel Maling List,
	Alan Stern, Bjorn Helgaas, Kevin Hilman, Ulf Hansson,
	Geert Uytterhoeven

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

The SET_PM_RUNTIME_PM_OPS() and SET_RUNTIME_PM_OPS() macros are
identical except that one of them is not empty for CONFIG_PM set,
while the other one is not empty for CONFIG_PM_RUNTIME set,
respectively.

However, after commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so one
of these macros is now redundant.

For this reason, replace SET_PM_RUNTIME_PM_OPS() with
SET_RUNTIME_PM_OPS() everywhere and redefine the SET_PM_RUNTIME_PM_OPS
symbol as SET_RUNTIME_PM_OPS in case new code is starting to use the
macro being removed here.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

It turns out that some new drivers are starting to use SET_PM_RUNTIME_PM_OPS,
so add a #define mapping it onto SET_RUNTIME_PM_OPS for them (we'll fix that
up when things settle).

---
 drivers/amba/bus.c                |    2 +-
 drivers/dma/ste_dma40.c           |    2 +-
 drivers/gpio/gpio-zynq.c          |    2 +-
 drivers/i2c/busses/i2c-hix5hd2.c  |    2 +-
 drivers/i2c/busses/i2c-nomadik.c  |    2 +-
 drivers/mmc/host/mmci.c           |    2 +-
 drivers/mmc/host/sh_mobile_sdhi.c |    2 +-
 drivers/mmc/host/tmio_mmc.c       |    2 +-
 drivers/spi/spi-pl022.c           |    2 +-
 include/linux/pm.h                |   11 ++---------
 10 files changed, 11 insertions(+), 18 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Index: linux-pm/drivers/amba/bus.c
===================================================================
--- linux-pm.orig/drivers/amba/bus.c
+++ linux-pm/drivers/amba/bus.c
@@ -124,7 +124,7 @@ static const struct dev_pm_ops amba_pm =
 	.thaw		= pm_generic_thaw,
 	.poweroff	= pm_generic_poweroff,
 	.restore	= pm_generic_restore,
-	SET_PM_RUNTIME_PM_OPS(
+	SET_RUNTIME_PM_OPS(
 		amba_pm_runtime_suspend,
 		amba_pm_runtime_resume,
 		NULL
Index: linux-pm/drivers/dma/ste_dma40.c
===================================================================
--- linux-pm.orig/drivers/dma/ste_dma40.c
+++ linux-pm/drivers/dma/ste_dma40.c
@@ -3051,7 +3051,7 @@ static int dma40_runtime_resume(struct d
 
 static const struct dev_pm_ops dma40_pm_ops = {
 	SET_LATE_SYSTEM_SLEEP_PM_OPS(dma40_suspend, dma40_resume)
-	SET_PM_RUNTIME_PM_OPS(dma40_runtime_suspend,
+	SET_RUNTIME_PM_OPS(dma40_runtime_suspend,
 				dma40_runtime_resume,
 				NULL)
 };
Index: linux-pm/drivers/gpio/gpio-zynq.c
===================================================================
--- linux-pm.orig/drivers/gpio/gpio-zynq.c
+++ linux-pm/drivers/gpio/gpio-zynq.c
@@ -578,7 +578,7 @@ static void zynq_gpio_free(struct gpio_c
 
 static const struct dev_pm_ops zynq_gpio_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume)
-	SET_PM_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend,
+	SET_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend,
 			zynq_gpio_runtime_resume, NULL)
 };
 
Index: linux-pm/drivers/i2c/busses/i2c-hix5hd2.c
===================================================================
--- linux-pm.orig/drivers/i2c/busses/i2c-hix5hd2.c
+++ linux-pm/drivers/i2c/busses/i2c-hix5hd2.c
@@ -528,7 +528,7 @@ static int hix5hd2_i2c_runtime_resume(st
 #endif
 
 static const struct dev_pm_ops hix5hd2_i2c_pm_ops = {
-	SET_PM_RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend,
+	SET_RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend,
 			      hix5hd2_i2c_runtime_resume,
 			      NULL)
 };
Index: linux-pm/drivers/i2c/busses/i2c-nomadik.c
===================================================================
--- linux-pm.orig/drivers/i2c/busses/i2c-nomadik.c
+++ linux-pm/drivers/i2c/busses/i2c-nomadik.c
@@ -932,7 +932,7 @@ static int nmk_i2c_runtime_resume(struct
 
 static const struct dev_pm_ops nmk_i2c_pm = {
 	SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early)
-	SET_PM_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
+	SET_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
 			nmk_i2c_runtime_resume,
 			NULL)
 };
Index: linux-pm/drivers/mmc/host/mmci.c
===================================================================
--- linux-pm.orig/drivers/mmc/host/mmci.c
+++ linux-pm/drivers/mmc/host/mmci.c
@@ -1843,7 +1843,7 @@ static int mmci_runtime_resume(struct de
 static const struct dev_pm_ops mmci_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
 				pm_runtime_force_resume)
-	SET_PM_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL)
+	SET_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL)
 };
 
 static struct amba_id mmci_ids[] = {
Index: linux-pm/drivers/mmc/host/sh_mobile_sdhi.c
===================================================================
--- linux-pm.orig/drivers/mmc/host/sh_mobile_sdhi.c
+++ linux-pm/drivers/mmc/host/sh_mobile_sdhi.c
@@ -375,7 +375,7 @@ static int sh_mobile_sdhi_remove(struct
 static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
 			pm_runtime_force_resume)
-	SET_PM_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
+	SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
 			tmio_mmc_host_runtime_resume,
 			NULL)
 };
Index: linux-pm/drivers/mmc/host/tmio_mmc.c
===================================================================
--- linux-pm.orig/drivers/mmc/host/tmio_mmc.c
+++ linux-pm/drivers/mmc/host/tmio_mmc.c
@@ -135,7 +135,7 @@ static int tmio_mmc_remove(struct platfo
 
 static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume)
-	SET_PM_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
+	SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
 			tmio_mmc_host_runtime_resume,
 			NULL)
 };
Index: linux-pm/drivers/spi/spi-pl022.c
===================================================================
--- linux-pm.orig/drivers/spi/spi-pl022.c
+++ linux-pm/drivers/spi/spi-pl022.c
@@ -2377,7 +2377,7 @@ static int pl022_runtime_resume(struct d
 
 static const struct dev_pm_ops pl022_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume)
-	SET_PM_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL)
+	SET_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL)
 };
 
 static struct vendor_data vendor_arm = {
Index: linux-pm/include/linux/pm.h
===================================================================
--- linux-pm.orig/include/linux/pm.h
+++ linux-pm/include/linux/pm.h
@@ -342,7 +342,7 @@ struct dev_pm_ops {
 #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
 #endif
 
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
 	.runtime_suspend = suspend_fn, \
 	.runtime_resume = resume_fn, \
@@ -351,14 +351,7 @@ struct dev_pm_ops {
 #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
 #endif
 
-#ifdef CONFIG_PM
-#define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
-	.runtime_suspend = suspend_fn, \
-	.runtime_resume = resume_fn, \
-	.runtime_idle = idle_fn,
-#else
-#define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
-#endif
+#define SET_PM_RUNTIME_PM_OPS	SET_RUNTIME_PM_OPS
 
 /*
  * Use this if you want to use the same suspend and resume callbacks for suspend


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

* [Update][PATCH 3/4] ACPI / PM: Drop CONFIG_PM_RUNTIME from the ACPI core
  2014-11-27  0:40 ` [PATCH 3/4] ACPI / PM: Drop CONFIG_PM_RUNTIME from the ACPI core Rafael J. Wysocki
@ 2014-11-27 22:06   ` Rafael J. Wysocki
  0 siblings, 0 replies; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-11-27 22:06 UTC (permalink / raw)
  To: Linux PM list
  Cc: Linux PCI, Linux Kernel Mailing List, ACPI Devel Maling List,
	Alan Stern, Bjorn Helgaas, Kevin Hilman, Ulf Hansson,
	Geert Uytterhoeven

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Subject: ACPI / PM: Drop CONFIG_PM_RUNTIME from the ACPI core

After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so quite a few
#ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to
depend on CONFIG_PM.

Replace CONFIG_PM_RUNTIME with CONFIG_PM in the ACPI core code.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

I missed include/acpi/acpi_bus.h in the previous version.

---
 drivers/acpi/acpi_lpss.c |    4 +---
 drivers/acpi/device_pm.c |    8 ++------
 drivers/acpi/pci_irq.c   |    2 +-
 include/acpi/acpi_bus.h  |    6 +-----
 include/linux/acpi.h     |   26 +++++++++++---------------
 5 files changed, 16 insertions(+), 30 deletions(-)

Index: linux-pm/drivers/acpi/acpi_lpss.c
===================================================================
--- linux-pm.orig/drivers/acpi/acpi_lpss.c
+++ linux-pm/drivers/acpi/acpi_lpss.c
@@ -588,7 +588,6 @@ static int acpi_lpss_resume_early(struct
 }
 #endif /* CONFIG_PM_SLEEP */
 
-#ifdef CONFIG_PM_RUNTIME
 static int acpi_lpss_runtime_suspend(struct device *dev)
 {
 	struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev));
@@ -631,11 +630,11 @@ static int acpi_lpss_runtime_resume(stru
 
 	return pm_generic_runtime_resume(dev);
 }
-#endif /* CONFIG_PM_RUNTIME */
 #endif /* CONFIG_PM */
 
 static struct dev_pm_domain acpi_lpss_pm_domain = {
 	.ops = {
+#ifdef CONFIG_PM
 #ifdef CONFIG_PM_SLEEP
 		.prepare = acpi_subsys_prepare,
 		.complete = acpi_subsys_complete,
@@ -647,7 +646,6 @@ static struct dev_pm_domain acpi_lpss_pm
 		.poweroff_late = acpi_lpss_suspend_late,
 		.restore_early = acpi_lpss_resume_early,
 #endif
-#ifdef CONFIG_PM_RUNTIME
 		.runtime_suspend = acpi_lpss_runtime_suspend,
 		.runtime_resume = acpi_lpss_runtime_resume,
 #endif
Index: linux-pm/drivers/acpi/pci_irq.c
===================================================================
--- linux-pm.orig/drivers/acpi/pci_irq.c
+++ linux-pm/drivers/acpi/pci_irq.c
@@ -484,7 +484,7 @@ void acpi_pci_irq_disable(struct pci_dev
 	/* Keep IOAPIC pin configuration when suspending */
 	if (dev->dev.power.is_prepared)
 		return;
-#ifdef	CONFIG_PM_RUNTIME
+#ifdef	CONFIG_PM
 	if (dev->dev.power.runtime_status == RPM_SUSPENDING)
 		return;
 #endif
Index: linux-pm/drivers/acpi/device_pm.c
===================================================================
--- linux-pm.orig/drivers/acpi/device_pm.c
+++ linux-pm/drivers/acpi/device_pm.c
@@ -692,7 +692,6 @@ static int acpi_device_wakeup(struct acp
 	return 0;
 }
 
-#ifdef CONFIG_PM_RUNTIME
 /**
  * acpi_pm_device_run_wake - Enable/disable remote wakeup for given device.
  * @dev: Device to enable/disable the platform to wake up.
@@ -714,7 +713,6 @@ int acpi_pm_device_run_wake(struct devic
 	return acpi_device_wakeup(adev, ACPI_STATE_S0, enable);
 }
 EXPORT_SYMBOL(acpi_pm_device_run_wake);
-#endif /* CONFIG_PM_RUNTIME */
 
 #ifdef CONFIG_PM_SLEEP
 /**
@@ -773,7 +771,6 @@ static int acpi_dev_pm_full_power(struct
 		acpi_device_set_power(adev, ACPI_STATE_D0) : 0;
 }
 
-#ifdef CONFIG_PM_RUNTIME
 /**
  * acpi_dev_runtime_suspend - Put device into a low-power state using ACPI.
  * @dev: Device to put into a low-power state.
@@ -855,7 +852,6 @@ int acpi_subsys_runtime_resume(struct de
 	return ret ? ret : pm_generic_runtime_resume(dev);
 }
 EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume);
-#endif /* CONFIG_PM_RUNTIME */
 
 #ifdef CONFIG_PM_SLEEP
 /**
@@ -1023,10 +1019,9 @@ EXPORT_SYMBOL_GPL(acpi_subsys_freeze);
 
 static struct dev_pm_domain acpi_general_pm_domain = {
 	.ops = {
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 		.runtime_suspend = acpi_subsys_runtime_suspend,
 		.runtime_resume = acpi_subsys_runtime_resume,
-#endif
 #ifdef CONFIG_PM_SLEEP
 		.prepare = acpi_subsys_prepare,
 		.complete = acpi_subsys_complete,
@@ -1038,6 +1033,7 @@ static struct dev_pm_domain acpi_general
 		.poweroff_late = acpi_subsys_suspend_late,
 		.restore_early = acpi_subsys_resume_early,
 #endif
+#endif
 	},
 };
 
Index: linux-pm/include/linux/acpi.h
===================================================================
--- linux-pm.orig/include/linux/acpi.h
+++ linux-pm/include/linux/acpi.h
@@ -567,16 +567,26 @@ static inline void arch_reserve_mem_area
 #define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0)
 #endif
 
-#if defined(CONFIG_ACPI) && defined(CONFIG_PM_RUNTIME)
+#if defined(CONFIG_ACPI) && defined(CONFIG_PM)
 int acpi_dev_runtime_suspend(struct device *dev);
 int acpi_dev_runtime_resume(struct device *dev);
 int acpi_subsys_runtime_suspend(struct device *dev);
 int acpi_subsys_runtime_resume(struct device *dev);
+struct acpi_device *acpi_dev_pm_get_node(struct device *dev);
+int acpi_dev_pm_attach(struct device *dev, bool power_on);
 #else
 static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; }
 static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; }
 static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; }
 static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; }
+static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
+{
+	return NULL;
+}
+static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
+{
+	return -ENODEV;
+}
 #endif
 
 #if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP)
@@ -599,20 +609,6 @@ static inline int acpi_subsys_suspend(st
 static inline int acpi_subsys_freeze(struct device *dev) { return 0; }
 #endif
 
-#if defined(CONFIG_ACPI) && defined(CONFIG_PM)
-struct acpi_device *acpi_dev_pm_get_node(struct device *dev);
-int acpi_dev_pm_attach(struct device *dev, bool power_on);
-#else
-static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
-{
-	return NULL;
-}
-static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
-{
-	return -ENODEV;
-}
-#endif
-
 #ifdef CONFIG_ACPI
 __printf(3, 4)
 void acpi_handle_printk(const char *level, acpi_handle handle,
Index: linux-pm/include/acpi/acpi_bus.h
===================================================================
--- linux-pm.orig/include/acpi/acpi_bus.h
+++ linux-pm/include/acpi/acpi_bus.h
@@ -544,6 +544,7 @@ acpi_status acpi_add_pm_notifier(struct
 				 void (*work_func)(struct work_struct *work));
 acpi_status acpi_remove_pm_notifier(struct acpi_device *adev);
 int acpi_pm_device_sleep_state(struct device *, int *, int);
+int acpi_pm_device_run_wake(struct device *, bool);
 #else
 static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
 					       struct device *dev,
@@ -563,11 +564,6 @@ static inline int acpi_pm_device_sleep_s
 	return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ?
 		m : ACPI_STATE_D0;
 }
-#endif
-
-#ifdef CONFIG_PM_RUNTIME
-int acpi_pm_device_run_wake(struct device *, bool);
-#else
 static inline int acpi_pm_device_run_wake(struct device *dev, bool enable)
 {
 	return -ENODEV;


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

* Re: [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code
  2014-11-27 21:35         ` Rafael J. Wysocki
@ 2014-11-27 22:34           ` Ulf Hansson
  2014-11-29  0:50             ` Rafael J. Wysocki
  0 siblings, 1 reply; 23+ messages in thread
From: Ulf Hansson @ 2014-11-27 22:34 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Alan Stern, Geert Uytterhoeven, Linux PM list, Linux PCI,
	Linux Kernel Mailing List, ACPI Devel Maling List, Bjorn Helgaas,
	Kevin Hilman

[...]

> That said whether or not it is ever useful to set PM_RUNTIME alone is a good
> question.  In my opinion it is useful today, at least on some platforms that
> don't really support system suspend or hibernation in any form.  However, it
> may not be the case any more when suspend-to-idle becomes mature enough,
> because that should just work for any platform without any kind of special
> support.  We're still missing some timekeeping bits there, but once that
> gap has been covered, we may just eliminate PM_SLEEP as well if there's a
> broad consensus on that.

That's sounds like a good approach, thanks for sharing your ideas and plans.

Feel free to add my reviewed-by tag to this patchset as well.

Kind regards
Uffe

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

* [Update][PATCH 4/4] PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core
  2014-11-27  0:40 ` [PATCH 4/4] PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core Rafael J. Wysocki
@ 2014-11-27 22:41   ` Rafael J. Wysocki
  2014-12-01 22:51     ` Bjorn Helgaas
  0 siblings, 1 reply; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-11-27 22:41 UTC (permalink / raw)
  To: Linux PM list
  Cc: Linux PCI, Linux Kernel Mailing List, ACPI Devel Maling List,
	Alan Stern, Bjorn Helgaas, Kevin Hilman, Ulf Hansson,
	Geert Uytterhoeven

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Subject: PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core

After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so quite a few
#ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to
depend on CONFIG_PM.

Replace CONFIG_PM_RUNTIME with CONFIG_PM in the PCI core code.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

Changelog fixup.

---
 drivers/pci/pci-driver.c |   20 +++++++-------------
 drivers/pci/pci-sysfs.c  |    4 ++--
 drivers/pci/pcie/Kconfig |    2 +-
 3 files changed, 10 insertions(+), 16 deletions(-)

Index: linux-pm/drivers/pci/pcie/Kconfig
===================================================================
--- linux-pm.orig/drivers/pci/pcie/Kconfig
+++ linux-pm/drivers/pci/pcie/Kconfig
@@ -79,4 +79,4 @@ endchoice
 
 config PCIE_PME
 	def_bool y
-	depends on PCIEPORTBUS && PM_RUNTIME
+	depends on PCIEPORTBUS && PM
Index: linux-pm/drivers/pci/pci-driver.c
===================================================================
--- linux-pm.orig/drivers/pci/pci-driver.c
+++ linux-pm/drivers/pci/pci-driver.c
@@ -1104,7 +1104,7 @@ static int pci_pm_restore(struct device
 
 #endif /* !CONFIG_HIBERNATE_CALLBACKS */
 
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 
 static int pci_pm_runtime_suspend(struct device *dev)
 {
@@ -1200,16 +1200,6 @@ static int pci_pm_runtime_idle(struct de
 	return ret;
 }
 
-#else /* !CONFIG_PM_RUNTIME */
-
-#define pci_pm_runtime_suspend	NULL
-#define pci_pm_runtime_resume	NULL
-#define pci_pm_runtime_idle	NULL
-
-#endif /* !CONFIG_PM_RUNTIME */
-
-#ifdef CONFIG_PM
-
 static const struct dev_pm_ops pci_dev_pm_ops = {
 	.prepare = pci_pm_prepare,
 	.suspend = pci_pm_suspend,
@@ -1231,11 +1221,15 @@ static const struct dev_pm_ops pci_dev_p
 
 #define PCI_PM_OPS_PTR	(&pci_dev_pm_ops)
 
-#else /* !COMFIG_PM_OPS */
+#else /* !CONFIG_PM */
+
+#define pci_pm_runtime_suspend	NULL
+#define pci_pm_runtime_resume	NULL
+#define pci_pm_runtime_idle	NULL
 
 #define PCI_PM_OPS_PTR	NULL
 
-#endif /* !COMFIG_PM_OPS */
+#endif /* !CONFIG_PM */
 
 /**
  * __pci_register_driver - register a new pci driver
Index: linux-pm/drivers/pci/pci-sysfs.c
===================================================================
--- linux-pm.orig/drivers/pci/pci-sysfs.c
+++ linux-pm/drivers/pci/pci-sysfs.c
@@ -385,7 +385,7 @@ static ssize_t dev_bus_rescan_store(stru
 }
 static DEVICE_ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, dev_bus_rescan_store);
 
-#if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI)
+#if defined(CONFIG_PM) && defined(CONFIG_ACPI)
 static ssize_t d3cold_allowed_store(struct device *dev,
 				    struct device_attribute *attr,
 				    const char *buf, size_t count)
@@ -566,7 +566,7 @@ static struct attribute *pci_dev_attrs[]
 	&dev_attr_enable.attr,
 	&dev_attr_broken_parity_status.attr,
 	&dev_attr_msi_bus.attr,
-#if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI)
+#if defined(CONFIG_PM) && defined(CONFIG_ACPI)
 	&dev_attr_d3cold_allowed.attr,
 #endif
 #ifdef CONFIG_OF


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

* Re: [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code
  2014-11-27 22:34           ` Ulf Hansson
@ 2014-11-29  0:50             ` Rafael J. Wysocki
  0 siblings, 0 replies; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-11-29  0:50 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Alan Stern, Geert Uytterhoeven, Linux PM list, Linux PCI,
	Linux Kernel Mailing List, ACPI Devel Maling List, Bjorn Helgaas,
	Kevin Hilman

On Thursday, November 27, 2014 11:34:03 PM Ulf Hansson wrote:
> [...]
> 
> > That said whether or not it is ever useful to set PM_RUNTIME alone is a good
> > question.  In my opinion it is useful today, at least on some platforms that
> > don't really support system suspend or hibernation in any form.  However, it
> > may not be the case any more when suspend-to-idle becomes mature enough,
> > because that should just work for any platform without any kind of special
> > support.  We're still missing some timekeeping bits there, but once that
> > gap has been covered, we may just eliminate PM_SLEEP as well if there's a
> > broad consensus on that.
> 
> That's sounds like a good approach, thanks for sharing your ideas and plans.
> 
> Feel free to add my reviewed-by tag to this patchset as well.

I'll do that, thanks!


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

* Re: [Replacement][PATCH 1/4] PM: Merge the SET*_RUNTIME_PM_OPS() macros
  2014-11-27 22:05   ` [Replacement][PATCH 1/4] PM: Merge the SET*_RUNTIME_PM_OPS() macros Rafael J. Wysocki
@ 2014-11-29  0:52     ` Rafael J. Wysocki
  0 siblings, 0 replies; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-11-29  0:52 UTC (permalink / raw)
  To: Linux PM list
  Cc: Linux PCI, Linux Kernel Mailing List, ACPI Devel Maling List,
	Alan Stern, Bjorn Helgaas, Kevin Hilman, Ulf Hansson,
	Geert Uytterhoeven

On Thursday, November 27, 2014 11:05:41 PM Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> The SET_PM_RUNTIME_PM_OPS() and SET_RUNTIME_PM_OPS() macros are
> identical except that one of them is not empty for CONFIG_PM set,
> while the other one is not empty for CONFIG_PM_RUNTIME set,
> respectively.
> 
> However, after commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
> PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so one
> of these macros is now redundant.
> 
> For this reason, replace SET_PM_RUNTIME_PM_OPS() with
> SET_RUNTIME_PM_OPS() everywhere and redefine the SET_PM_RUNTIME_PM_OPS
> symbol as SET_RUNTIME_PM_OPS in case new code is starting to use the
> macro being removed here.

It turns out that I need to defer this one, because it breaks builds for
CONFIG_PM selected without CONFIG_PM_SLEEP or CONFIG_PM_RUNTIME (which is
arguably invalid, but some defconfigs evidently do that).

I need to fix those defconfigs first.


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [Update][PATCH 4/4] PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core
  2014-11-27 22:41   ` [Update][PATCH " Rafael J. Wysocki
@ 2014-12-01 22:51     ` Bjorn Helgaas
  0 siblings, 0 replies; 23+ messages in thread
From: Bjorn Helgaas @ 2014-12-01 22:51 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM list, Linux PCI, Linux Kernel Mailing List,
	ACPI Devel Maling List, Alan Stern, Kevin Hilman, Ulf Hansson,
	Geert Uytterhoeven

On Thu, Nov 27, 2014 at 3:41 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Subject: PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core
>
> After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
> selected) PM_RUNTIME is always set if PM is set, so quite a few
> #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to
> depend on CONFIG_PM.
>
> Replace CONFIG_PM_RUNTIME with CONFIG_PM in the PCI core code.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

I acked this on IRC, and I think Rafael plans to merge this via his
tree, but for the archives:

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

> ---
>
> Changelog fixup.
>
> ---
>  drivers/pci/pci-driver.c |   20 +++++++-------------
>  drivers/pci/pci-sysfs.c  |    4 ++--
>  drivers/pci/pcie/Kconfig |    2 +-
>  3 files changed, 10 insertions(+), 16 deletions(-)
>
> Index: linux-pm/drivers/pci/pcie/Kconfig
> ===================================================================
> --- linux-pm.orig/drivers/pci/pcie/Kconfig
> +++ linux-pm/drivers/pci/pcie/Kconfig
> @@ -79,4 +79,4 @@ endchoice
>
>  config PCIE_PME
>         def_bool y
> -       depends on PCIEPORTBUS && PM_RUNTIME
> +       depends on PCIEPORTBUS && PM
> Index: linux-pm/drivers/pci/pci-driver.c
> ===================================================================
> --- linux-pm.orig/drivers/pci/pci-driver.c
> +++ linux-pm/drivers/pci/pci-driver.c
> @@ -1104,7 +1104,7 @@ static int pci_pm_restore(struct device
>
>  #endif /* !CONFIG_HIBERNATE_CALLBACKS */
>
> -#ifdef CONFIG_PM_RUNTIME
> +#ifdef CONFIG_PM
>
>  static int pci_pm_runtime_suspend(struct device *dev)
>  {
> @@ -1200,16 +1200,6 @@ static int pci_pm_runtime_idle(struct de
>         return ret;
>  }
>
> -#else /* !CONFIG_PM_RUNTIME */
> -
> -#define pci_pm_runtime_suspend NULL
> -#define pci_pm_runtime_resume  NULL
> -#define pci_pm_runtime_idle    NULL
> -
> -#endif /* !CONFIG_PM_RUNTIME */
> -
> -#ifdef CONFIG_PM
> -
>  static const struct dev_pm_ops pci_dev_pm_ops = {
>         .prepare = pci_pm_prepare,
>         .suspend = pci_pm_suspend,
> @@ -1231,11 +1221,15 @@ static const struct dev_pm_ops pci_dev_p
>
>  #define PCI_PM_OPS_PTR (&pci_dev_pm_ops)
>
> -#else /* !COMFIG_PM_OPS */
> +#else /* !CONFIG_PM */
> +
> +#define pci_pm_runtime_suspend NULL
> +#define pci_pm_runtime_resume  NULL
> +#define pci_pm_runtime_idle    NULL
>
>  #define PCI_PM_OPS_PTR NULL
>
> -#endif /* !COMFIG_PM_OPS */
> +#endif /* !CONFIG_PM */
>
>  /**
>   * __pci_register_driver - register a new pci driver
> Index: linux-pm/drivers/pci/pci-sysfs.c
> ===================================================================
> --- linux-pm.orig/drivers/pci/pci-sysfs.c
> +++ linux-pm/drivers/pci/pci-sysfs.c
> @@ -385,7 +385,7 @@ static ssize_t dev_bus_rescan_store(stru
>  }
>  static DEVICE_ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, dev_bus_rescan_store);
>
> -#if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI)
> +#if defined(CONFIG_PM) && defined(CONFIG_ACPI)
>  static ssize_t d3cold_allowed_store(struct device *dev,
>                                     struct device_attribute *attr,
>                                     const char *buf, size_t count)
> @@ -566,7 +566,7 @@ static struct attribute *pci_dev_attrs[]
>         &dev_attr_enable.attr,
>         &dev_attr_broken_parity_status.attr,
>         &dev_attr_msi_bus.attr,
> -#if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI)
> +#if defined(CONFIG_PM) && defined(CONFIG_ACPI)
>         &dev_attr_d3cold_allowed.attr,
>  #endif
>  #ifdef CONFIG_OF
>

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

* Re: [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code
  2014-11-27  0:37 [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code Rafael J. Wysocki
                   ` (4 preceding siblings ...)
  2014-11-27  8:57 ` [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code Ulf Hansson
@ 2014-12-02  1:01 ` Kevin Hilman
  5 siblings, 0 replies; 23+ messages in thread
From: Kevin Hilman @ 2014-12-02  1:01 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM list, Linux PCI, Linux Kernel Mailing List,
	ACPI Devel Maling List, Alan Stern, Bjorn Helgaas, Ulf Hansson,
	Geert Uytterhoeven

"Rafael J. Wysocki" <rjw@rjwysocki.net> writes:

> Hi,
>
> After commit b2b49ccbdd54 "PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
> selected" (currently in Linux next) CONFIG_PM_RUNTIME is set whenever
> CONFIG_PM is set, so CONFIG_PM can be used in #ifdefs instead of
> CONFIG_PM_RUNTIME which simplifies things in quite a few cases.
>
> For this reason, the following patches modify some core code to use
> CONFIG_PM instead of CONFIG_PM_RUNTIME.
>
> [1/4] Drop a macro which is redundant after the above commit.
> [2/4] Use PM instead of PM_RUNTIME in the core device PM code.
> [3/4] Use PM instead of PM_RUNTIME in the ACPI core.
> [4/4] Use PM instead of PM_RUNTIME in the PCI core.
>
> They build for me for all of the relevant combinations of options (on x86),
> but more testing (on the other architectures) would be welcome.

Acked-by: Kevin Hilman <khilman@linaro.org>

I gave this a quick boot test on all the OMAP boards I have, and it's
booting fine. As soon as this hits linux-next, it will be boot tested on
a pile of different ARM platforms, and will let you know what happens.

Kevin

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

* Re: [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro
  2014-11-27  0:38 ` [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro Rafael J. Wysocki
  2014-11-27 22:05   ` [Replacement][PATCH 1/4] PM: Merge the SET*_RUNTIME_PM_OPS() macros Rafael J. Wysocki
@ 2014-12-03 14:15   ` Ulf Hansson
  2014-12-03 22:51     ` Rafael J. Wysocki
  1 sibling, 1 reply; 23+ messages in thread
From: Ulf Hansson @ 2014-12-03 14:15 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM list, Linux PCI, Linux Kernel Mailing List,
	ACPI Devel Maling List, Alan Stern, Bjorn Helgaas, Kevin Hilman,
	Geert Uytterhoeven

On 27 November 2014 at 01:38, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> The SET_PM_RUNTIME_PM_OPS() and SET_RUNTIME_PM_OPS() macros are
> identical except that one of them is not empty for CONFIG_PM set,
> while the other one is not empty for CONFIG_PM_RUNTIME set,
> respectively.
>
> However, after commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
> PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so one
> of these macros is now redundant.
>
> For this reason, drop SET_PM_RUNTIME_PM_OPS() and replace it with
> SET_RUNTIME_PM_OPS() everywhere.

Hi Rafael,

Apparently, I have queued an mmc patch in my mmc tree, which means one
mmc driver starts using the SET_PM_RUNTIME_PM_OPS macro. It should
cause a build error in linux-next with @subject patch.

I have shared that patch through an immutable branch, I have also
checked potential conflicts and it shouldn't be any problems to pull
that in to your tree. Then you can fix $subject patch by also
converting the mmc driver to use SET_RUNTIME_PM_OPS macro.

The branch is available at:
git://git.linaro.org/people/ulf.hansson/mmc.git mmc_for_linux_pm

Kind regards
Uffe

>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  drivers/amba/bus.c                |    2 +-
>  drivers/dma/ste_dma40.c           |    2 +-
>  drivers/gpio/gpio-zynq.c          |    2 +-
>  drivers/i2c/busses/i2c-hix5hd2.c  |    2 +-
>  drivers/i2c/busses/i2c-nomadik.c  |    2 +-
>  drivers/mmc/host/mmci.c           |    2 +-
>  drivers/mmc/host/sh_mobile_sdhi.c |    2 +-
>  drivers/mmc/host/tmio_mmc.c       |    2 +-
>  drivers/spi/spi-pl022.c           |    2 +-
>  include/linux/pm.h                |   11 +----------
>  10 files changed, 10 insertions(+), 19 deletions(-)
>
> Index: linux-pm/drivers/amba/bus.c
> ===================================================================
> --- linux-pm.orig/drivers/amba/bus.c
> +++ linux-pm/drivers/amba/bus.c
> @@ -124,7 +124,7 @@ static const struct dev_pm_ops amba_pm =
>         .thaw           = pm_generic_thaw,
>         .poweroff       = pm_generic_poweroff,
>         .restore        = pm_generic_restore,
> -       SET_PM_RUNTIME_PM_OPS(
> +       SET_RUNTIME_PM_OPS(
>                 amba_pm_runtime_suspend,
>                 amba_pm_runtime_resume,
>                 NULL
> Index: linux-pm/drivers/dma/ste_dma40.c
> ===================================================================
> --- linux-pm.orig/drivers/dma/ste_dma40.c
> +++ linux-pm/drivers/dma/ste_dma40.c
> @@ -3051,7 +3051,7 @@ static int dma40_runtime_resume(struct d
>
>  static const struct dev_pm_ops dma40_pm_ops = {
>         SET_LATE_SYSTEM_SLEEP_PM_OPS(dma40_suspend, dma40_resume)
> -       SET_PM_RUNTIME_PM_OPS(dma40_runtime_suspend,
> +       SET_RUNTIME_PM_OPS(dma40_runtime_suspend,
>                                 dma40_runtime_resume,
>                                 NULL)
>  };
> Index: linux-pm/drivers/gpio/gpio-zynq.c
> ===================================================================
> --- linux-pm.orig/drivers/gpio/gpio-zynq.c
> +++ linux-pm/drivers/gpio/gpio-zynq.c
> @@ -578,7 +578,7 @@ static void zynq_gpio_free(struct gpio_c
>
>  static const struct dev_pm_ops zynq_gpio_dev_pm_ops = {
>         SET_SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume)
> -       SET_PM_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend,
> +       SET_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend,
>                         zynq_gpio_runtime_resume, NULL)
>  };
>
> Index: linux-pm/drivers/i2c/busses/i2c-hix5hd2.c
> ===================================================================
> --- linux-pm.orig/drivers/i2c/busses/i2c-hix5hd2.c
> +++ linux-pm/drivers/i2c/busses/i2c-hix5hd2.c
> @@ -528,7 +528,7 @@ static int hix5hd2_i2c_runtime_resume(st
>  #endif
>
>  static const struct dev_pm_ops hix5hd2_i2c_pm_ops = {
> -       SET_PM_RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend,
> +       SET_RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend,
>                               hix5hd2_i2c_runtime_resume,
>                               NULL)
>  };
> Index: linux-pm/drivers/i2c/busses/i2c-nomadik.c
> ===================================================================
> --- linux-pm.orig/drivers/i2c/busses/i2c-nomadik.c
> +++ linux-pm/drivers/i2c/busses/i2c-nomadik.c
> @@ -932,7 +932,7 @@ static int nmk_i2c_runtime_resume(struct
>
>  static const struct dev_pm_ops nmk_i2c_pm = {
>         SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early)
> -       SET_PM_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
> +       SET_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
>                         nmk_i2c_runtime_resume,
>                         NULL)
>  };
> Index: linux-pm/drivers/mmc/host/mmci.c
> ===================================================================
> --- linux-pm.orig/drivers/mmc/host/mmci.c
> +++ linux-pm/drivers/mmc/host/mmci.c
> @@ -1843,7 +1843,7 @@ static int mmci_runtime_resume(struct de
>  static const struct dev_pm_ops mmci_dev_pm_ops = {
>         SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
>                                 pm_runtime_force_resume)
> -       SET_PM_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL)
> +       SET_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL)
>  };
>
>  static struct amba_id mmci_ids[] = {
> Index: linux-pm/drivers/mmc/host/sh_mobile_sdhi.c
> ===================================================================
> --- linux-pm.orig/drivers/mmc/host/sh_mobile_sdhi.c
> +++ linux-pm/drivers/mmc/host/sh_mobile_sdhi.c
> @@ -375,7 +375,7 @@ static int sh_mobile_sdhi_remove(struct
>  static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
>         SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
>                         pm_runtime_force_resume)
> -       SET_PM_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
> +       SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
>                         tmio_mmc_host_runtime_resume,
>                         NULL)
>  };
> Index: linux-pm/drivers/mmc/host/tmio_mmc.c
> ===================================================================
> --- linux-pm.orig/drivers/mmc/host/tmio_mmc.c
> +++ linux-pm/drivers/mmc/host/tmio_mmc.c
> @@ -135,7 +135,7 @@ static int tmio_mmc_remove(struct platfo
>
>  static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
>         SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume)
> -       SET_PM_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
> +       SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
>                         tmio_mmc_host_runtime_resume,
>                         NULL)
>  };
> Index: linux-pm/drivers/spi/spi-pl022.c
> ===================================================================
> --- linux-pm.orig/drivers/spi/spi-pl022.c
> +++ linux-pm/drivers/spi/spi-pl022.c
> @@ -2377,7 +2377,7 @@ static int pl022_runtime_resume(struct d
>
>  static const struct dev_pm_ops pl022_dev_pm_ops = {
>         SET_SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume)
> -       SET_PM_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL)
> +       SET_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL)
>  };
>
>  static struct vendor_data vendor_arm = {
> Index: linux-pm/include/linux/pm.h
> ===================================================================
> --- linux-pm.orig/include/linux/pm.h
> +++ linux-pm/include/linux/pm.h
> @@ -342,7 +342,7 @@ struct dev_pm_ops {
>  #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
>  #endif
>
> -#ifdef CONFIG_PM_RUNTIME
> +#ifdef CONFIG_PM
>  #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
>         .runtime_suspend = suspend_fn, \
>         .runtime_resume = resume_fn, \
> @@ -351,15 +351,6 @@ struct dev_pm_ops {
>  #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
>  #endif
>
> -#ifdef CONFIG_PM
> -#define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
> -       .runtime_suspend = suspend_fn, \
> -       .runtime_resume = resume_fn, \
> -       .runtime_idle = idle_fn,
> -#else
> -#define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
> -#endif
> -
>  /*
>   * Use this if you want to use the same suspend and resume callbacks for suspend
>   * to RAM and hibernation.
>

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

* Re: [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro
  2014-12-03 14:15   ` [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro Ulf Hansson
@ 2014-12-03 22:51     ` Rafael J. Wysocki
  2014-12-04 10:04       ` Ulf Hansson
  0 siblings, 1 reply; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-12-03 22:51 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Linux PM list, Linux PCI, Linux Kernel Mailing List,
	ACPI Devel Maling List, Alan Stern, Bjorn Helgaas, Kevin Hilman,
	Geert Uytterhoeven

On Wednesday, December 03, 2014 03:15:49 PM Ulf Hansson wrote:
> On 27 November 2014 at 01:38, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >
> > The SET_PM_RUNTIME_PM_OPS() and SET_RUNTIME_PM_OPS() macros are
> > identical except that one of them is not empty for CONFIG_PM set,
> > while the other one is not empty for CONFIG_PM_RUNTIME set,
> > respectively.
> >
> > However, after commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
> > PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so one
> > of these macros is now redundant.
> >
> > For this reason, drop SET_PM_RUNTIME_PM_OPS() and replace it with
> > SET_RUNTIME_PM_OPS() everywhere.
> 
> Hi Rafael,
> 
> Apparently, I have queued an mmc patch in my mmc tree, which means one
> mmc driver starts using the SET_PM_RUNTIME_PM_OPS macro. It should
> cause a build error in linux-next with @subject patch.
> 
> I have shared that patch through an immutable branch, I have also
> checked potential conflicts and it shouldn't be any problems to pull
> that in to your tree. Then you can fix $subject patch by also
> converting the mmc driver to use SET_RUNTIME_PM_OPS macro.
> 
> The branch is available at:
> git://git.linaro.org/people/ulf.hansson/mmc.git mmc_for_linux_pm

Thanks for letting me know!

What about adding the following line to the $subject patch instead:

#define SET_PM_RUNTIME_PM_OPS	SET_RUNTIME_PM_OPS

and fixing things up when all has been merged?


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro
  2014-12-03 22:51     ` Rafael J. Wysocki
@ 2014-12-04 10:04       ` Ulf Hansson
  2014-12-04 21:48         ` Rafael J. Wysocki
  0 siblings, 1 reply; 23+ messages in thread
From: Ulf Hansson @ 2014-12-04 10:04 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM list, Linux PCI, Linux Kernel Mailing List,
	ACPI Devel Maling List, Alan Stern, Bjorn Helgaas, Kevin Hilman,
	Geert Uytterhoeven

On 3 December 2014 at 23:51, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> On Wednesday, December 03, 2014 03:15:49 PM Ulf Hansson wrote:
>> On 27 November 2014 at 01:38, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
>> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>> >
>> > The SET_PM_RUNTIME_PM_OPS() and SET_RUNTIME_PM_OPS() macros are
>> > identical except that one of them is not empty for CONFIG_PM set,
>> > while the other one is not empty for CONFIG_PM_RUNTIME set,
>> > respectively.
>> >
>> > However, after commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
>> > PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so one
>> > of these macros is now redundant.
>> >
>> > For this reason, drop SET_PM_RUNTIME_PM_OPS() and replace it with
>> > SET_RUNTIME_PM_OPS() everywhere.
>>
>> Hi Rafael,
>>
>> Apparently, I have queued an mmc patch in my mmc tree, which means one
>> mmc driver starts using the SET_PM_RUNTIME_PM_OPS macro. It should
>> cause a build error in linux-next with @subject patch.
>>
>> I have shared that patch through an immutable branch, I have also
>> checked potential conflicts and it shouldn't be any problems to pull
>> that in to your tree. Then you can fix $subject patch by also
>> converting the mmc driver to use SET_RUNTIME_PM_OPS macro.
>>
>> The branch is available at:
>> git://git.linaro.org/people/ulf.hansson/mmc.git mmc_for_linux_pm
>
> Thanks for letting me know!
>
> What about adding the following line to the $subject patch instead:
>
> #define SET_PM_RUNTIME_PM_OPS   SET_RUNTIME_PM_OPS
>
> and fixing things up when all has been merged?

That's an option.

On the other hand we will have a window of new users of
SET_PM_RUNTIME_PM_OPS, during the next release cycle. Or are you
saying that we should send fixes for the rc which takes care of the
removal of it?

Kind regards
Uffe

>
>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro
  2014-12-04 10:04       ` Ulf Hansson
@ 2014-12-04 21:48         ` Rafael J. Wysocki
  0 siblings, 0 replies; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-12-04 21:48 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Linux PM list, Linux PCI, Linux Kernel Mailing List,
	ACPI Devel Maling List, Alan Stern, Bjorn Helgaas, Kevin Hilman,
	Geert Uytterhoeven

On Thursday, December 04, 2014 11:04:20 AM Ulf Hansson wrote:
> On 3 December 2014 at 23:51, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > On Wednesday, December 03, 2014 03:15:49 PM Ulf Hansson wrote:
> >> On 27 November 2014 at 01:38, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> >> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >> >
> >> > The SET_PM_RUNTIME_PM_OPS() and SET_RUNTIME_PM_OPS() macros are
> >> > identical except that one of them is not empty for CONFIG_PM set,
> >> > while the other one is not empty for CONFIG_PM_RUNTIME set,
> >> > respectively.
> >> >
> >> > However, after commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
> >> > PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so one
> >> > of these macros is now redundant.
> >> >
> >> > For this reason, drop SET_PM_RUNTIME_PM_OPS() and replace it with
> >> > SET_RUNTIME_PM_OPS() everywhere.
> >>
> >> Hi Rafael,
> >>
> >> Apparently, I have queued an mmc patch in my mmc tree, which means one
> >> mmc driver starts using the SET_PM_RUNTIME_PM_OPS macro. It should
> >> cause a build error in linux-next with @subject patch.
> >>
> >> I have shared that patch through an immutable branch, I have also
> >> checked potential conflicts and it shouldn't be any problems to pull
> >> that in to your tree. Then you can fix $subject patch by also
> >> converting the mmc driver to use SET_RUNTIME_PM_OPS macro.
> >>
> >> The branch is available at:
> >> git://git.linaro.org/people/ulf.hansson/mmc.git mmc_for_linux_pm
> >
> > Thanks for letting me know!
> >
> > What about adding the following line to the $subject patch instead:
> >
> > #define SET_PM_RUNTIME_PM_OPS   SET_RUNTIME_PM_OPS
> >
> > and fixing things up when all has been merged?
> 
> That's an option.
> 
> On the other hand we will have a window of new users of
> SET_PM_RUNTIME_PM_OPS, during the next release cycle. Or are you
> saying that we should send fixes for the rc which takes care of the
> removal of it?

That is my plan.

It is quite usual for new users of stuff being reworked to appear at the
same time and that can always be addressed by doing a second round of
replacements after the merge window.

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

end of thread, other threads:[~2014-12-04 21:27 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-27  0:37 [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code Rafael J. Wysocki
2014-11-27  0:38 ` [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro Rafael J. Wysocki
2014-11-27 22:05   ` [Replacement][PATCH 1/4] PM: Merge the SET*_RUNTIME_PM_OPS() macros Rafael J. Wysocki
2014-11-29  0:52     ` Rafael J. Wysocki
2014-12-03 14:15   ` [PATCH 1/4] PM: Drop the SET_PM_RUNTIME_PM_OPS() macro Ulf Hansson
2014-12-03 22:51     ` Rafael J. Wysocki
2014-12-04 10:04       ` Ulf Hansson
2014-12-04 21:48         ` Rafael J. Wysocki
2014-11-27  0:39 ` [PATCH 2/4] PM: Drop CONFIG_PM_RUNTIME from the driver core Rafael J. Wysocki
2014-11-27  0:40 ` [PATCH 3/4] ACPI / PM: Drop CONFIG_PM_RUNTIME from the ACPI core Rafael J. Wysocki
2014-11-27 22:06   ` [Update][PATCH " Rafael J. Wysocki
2014-11-27  0:40 ` [PATCH 4/4] PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core Rafael J. Wysocki
2014-11-27 22:41   ` [Update][PATCH " Rafael J. Wysocki
2014-12-01 22:51     ` Bjorn Helgaas
2014-11-27  8:57 ` [PATCH 0/4] PM: Use CONFIG_PM instead of CONFIG_PM_RUNTIME in core code Ulf Hansson
2014-11-27  9:20   ` Ulf Hansson
2014-11-27 16:52   ` Rafael J. Wysocki
2014-11-27 17:00     ` Geert Uytterhoeven
2014-11-27 17:18       ` Alan Stern
2014-11-27 21:35         ` Rafael J. Wysocki
2014-11-27 22:34           ` Ulf Hansson
2014-11-29  0:50             ` Rafael J. Wysocki
2014-12-02  1:01 ` Kevin Hilman

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).