All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/24] PM / Domains: Generic OF-based support and cleanups
@ 2014-06-10 10:51 ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

Parts of this patchset has been posted earlier. To be able to smoothly continue
my work in re-factoring genpd I have collected patches into this patchset.

The complete patchset is available at the linux-pm_linux-next_genpd branch at:
git.linaro.org/people/ulf.hansson/linux-2.6.git
This branch is based upon Rafael's linux-pm tree's linux-next branch.

And important note. There are dependencies througout this patchset, which means
the all need to go together. I suggest we use Rafael's tree, thus I seek for
acks from the affected ARM SoC maintainers.


Tomasz Figa (3):
  base: power: Add generic OF-based power domain look-up
  drivercore: Bind/unbind power domain on probe/remove
  ARM: exynos: Move to generic power domain bindings

Ulf Hansson (21):
  PM / Domains: Ignore callbacks for subsys generic_pm_domain_data
  PM / Domains: Remove the pm_genpd_add|remove_callbacks APIs
  PM / Domains: Remove system PM callbacks from gpd_dev_ops
  ARM: shmobile: Drop dev_irq_safe from r8a7779 genpd config
  ARM: shmobile: Drop dev_irq_safe from R-mobile genpd config
  PM / Domains: Remove dev_irq_safe from genpd config
  PM / Domains: Remove redundant check for CONFIG_PM
  PM / Domains: Remove legacy API for adding devices through DT
  PM / Domains: Remove pm_genpd_syscore_switch() API
  PM / Domains: Remove genpd_queue_power_off_work() API
  PM / Domains: Add late_initcall to disable unused domains
  ARM: exynos: Leave disabling of unused pm domains to genpd
  ARM: s3c64xx: Leave disabling of unused pm domains to genpd
  drivers: sh: Leave disabling of unused pm domains to genpd
  PM / Domains: Remove default_stop_ok() API
  dt: bindings: ux500: Add documentation for power domains
  dt: bindings: ux500: Add header for power domains specifiers
  ARM: ux500: Initial support for power domains
  ARM: ux500: Enable Kconfig for the generic power domain
  ARM: ux500: Add DT node for ux500 power domains
  ARM: ux500: Add sdi[n] devices to VAPE power domain

 .../bindings/arm/exynos/power_domain.txt           |   12 +-
 .../devicetree/bindings/arm/ux500/power_domain.txt |   35 ++
 .../devicetree/bindings/power/power_domain.txt     |   51 ++
 arch/arm/boot/dts/ste-dbx5x0.dtsi                  |   11 +
 arch/arm/mach-exynos/exynos.c                      |    1 -
 arch/arm/mach-exynos/pm_domains.c                  |   81 +--
 arch/arm/mach-s3c64xx/common.c                     |    5 -
 arch/arm/mach-s3c64xx/common.h                     |    7 -
 arch/arm/mach-s3c64xx/mach-anw6410.c               |    1 -
 arch/arm/mach-s3c64xx/mach-crag6410.c              |    1 -
 arch/arm/mach-s3c64xx/mach-hmt.c                   |    1 -
 arch/arm/mach-s3c64xx/mach-mini6410.c              |    1 -
 arch/arm/mach-s3c64xx/mach-ncp.c                   |    1 -
 arch/arm/mach-s3c64xx/mach-real6410.c              |    1 -
 arch/arm/mach-s3c64xx/mach-smartq5.c               |    1 -
 arch/arm/mach-s3c64xx/mach-smartq7.c               |    1 -
 arch/arm/mach-s3c64xx/mach-smdk6400.c              |    1 -
 arch/arm/mach-s3c64xx/mach-smdk6410.c              |    1 -
 arch/arm/mach-s3c64xx/pm.c                         |    7 -
 arch/arm/mach-shmobile/pm-r8a7779.c                |    1 -
 arch/arm/mach-shmobile/pm-rmobile.c                |    1 -
 arch/arm/mach-ux500/Kconfig                        |    1 +
 arch/arm/mach-ux500/Makefile                       |    1 +
 arch/arm/mach-ux500/pm.c                           |    4 +
 arch/arm/mach-ux500/pm_domains.c                   |   77 +++
 arch/arm/mach-ux500/pm_domains.h                   |   17 +
 drivers/base/dd.c                                  |    9 +-
 drivers/base/power/domain.c                        |  638 ++++++++++----------
 drivers/base/power/domain_governor.c               |    7 +-
 drivers/sh/pm_runtime.c                            |   11 -
 include/dt-bindings/arm/ux500_pm_domains.h         |   15 +
 include/linux/pm_domain.h                          |  107 ++--
 kernel/power/Kconfig                               |    4 +
 33 files changed, 593 insertions(+), 520 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/ux500/power_domain.txt
 create mode 100644 Documentation/devicetree/bindings/power/power_domain.txt
 create mode 100644 arch/arm/mach-ux500/pm_domains.c
 create mode 100644 arch/arm/mach-ux500/pm_domains.h
 create mode 100644 include/dt-bindings/arm/ux500_pm_domains.h

-- 
1.7.9.5

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

* [PATCH 00/24] PM / Domains: Generic OF-based support and cleanups
@ 2014-06-10 10:51 ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

Parts of this patchset has been posted earlier. To be able to smoothly continue
my work in re-factoring genpd I have collected patches into this patchset.

The complete patchset is available at the linux-pm_linux-next_genpd branch at:
git.linaro.org/people/ulf.hansson/linux-2.6.git
This branch is based upon Rafael's linux-pm tree's linux-next branch.

And important note. There are dependencies througout this patchset, which means
the all need to go together. I suggest we use Rafael's tree, thus I seek for
acks from the affected ARM SoC maintainers.


Tomasz Figa (3):
  base: power: Add generic OF-based power domain look-up
  drivercore: Bind/unbind power domain on probe/remove
  ARM: exynos: Move to generic power domain bindings

Ulf Hansson (21):
  PM / Domains: Ignore callbacks for subsys generic_pm_domain_data
  PM / Domains: Remove the pm_genpd_add|remove_callbacks APIs
  PM / Domains: Remove system PM callbacks from gpd_dev_ops
  ARM: shmobile: Drop dev_irq_safe from r8a7779 genpd config
  ARM: shmobile: Drop dev_irq_safe from R-mobile genpd config
  PM / Domains: Remove dev_irq_safe from genpd config
  PM / Domains: Remove redundant check for CONFIG_PM
  PM / Domains: Remove legacy API for adding devices through DT
  PM / Domains: Remove pm_genpd_syscore_switch() API
  PM / Domains: Remove genpd_queue_power_off_work() API
  PM / Domains: Add late_initcall to disable unused domains
  ARM: exynos: Leave disabling of unused pm domains to genpd
  ARM: s3c64xx: Leave disabling of unused pm domains to genpd
  drivers: sh: Leave disabling of unused pm domains to genpd
  PM / Domains: Remove default_stop_ok() API
  dt: bindings: ux500: Add documentation for power domains
  dt: bindings: ux500: Add header for power domains specifiers
  ARM: ux500: Initial support for power domains
  ARM: ux500: Enable Kconfig for the generic power domain
  ARM: ux500: Add DT node for ux500 power domains
  ARM: ux500: Add sdi[n] devices to VAPE power domain

 .../bindings/arm/exynos/power_domain.txt           |   12 +-
 .../devicetree/bindings/arm/ux500/power_domain.txt |   35 ++
 .../devicetree/bindings/power/power_domain.txt     |   51 ++
 arch/arm/boot/dts/ste-dbx5x0.dtsi                  |   11 +
 arch/arm/mach-exynos/exynos.c                      |    1 -
 arch/arm/mach-exynos/pm_domains.c                  |   81 +--
 arch/arm/mach-s3c64xx/common.c                     |    5 -
 arch/arm/mach-s3c64xx/common.h                     |    7 -
 arch/arm/mach-s3c64xx/mach-anw6410.c               |    1 -
 arch/arm/mach-s3c64xx/mach-crag6410.c              |    1 -
 arch/arm/mach-s3c64xx/mach-hmt.c                   |    1 -
 arch/arm/mach-s3c64xx/mach-mini6410.c              |    1 -
 arch/arm/mach-s3c64xx/mach-ncp.c                   |    1 -
 arch/arm/mach-s3c64xx/mach-real6410.c              |    1 -
 arch/arm/mach-s3c64xx/mach-smartq5.c               |    1 -
 arch/arm/mach-s3c64xx/mach-smartq7.c               |    1 -
 arch/arm/mach-s3c64xx/mach-smdk6400.c              |    1 -
 arch/arm/mach-s3c64xx/mach-smdk6410.c              |    1 -
 arch/arm/mach-s3c64xx/pm.c                         |    7 -
 arch/arm/mach-shmobile/pm-r8a7779.c                |    1 -
 arch/arm/mach-shmobile/pm-rmobile.c                |    1 -
 arch/arm/mach-ux500/Kconfig                        |    1 +
 arch/arm/mach-ux500/Makefile                       |    1 +
 arch/arm/mach-ux500/pm.c                           |    4 +
 arch/arm/mach-ux500/pm_domains.c                   |   77 +++
 arch/arm/mach-ux500/pm_domains.h                   |   17 +
 drivers/base/dd.c                                  |    9 +-
 drivers/base/power/domain.c                        |  638 ++++++++++----------
 drivers/base/power/domain_governor.c               |    7 +-
 drivers/sh/pm_runtime.c                            |   11 -
 include/dt-bindings/arm/ux500_pm_domains.h         |   15 +
 include/linux/pm_domain.h                          |  107 ++--
 kernel/power/Kconfig                               |    4 +
 33 files changed, 593 insertions(+), 520 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/ux500/power_domain.txt
 create mode 100644 Documentation/devicetree/bindings/power/power_domain.txt
 create mode 100644 arch/arm/mach-ux500/pm_domains.c
 create mode 100644 arch/arm/mach-ux500/pm_domains.h
 create mode 100644 include/dt-bindings/arm/ux500_pm_domains.h

-- 
1.7.9.5

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

* [PATCH 01/24] base: power: Add generic OF-based power domain look-up
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Tomasz Figa

From: Tomasz Figa <t.figa@samsung.com>

This patch introduces generic code to perform power domain look-up using
device tree and automatically bind devices to their power domains.
Generic device tree binding is introduced to specify power domains of
devices in their device tree nodes.

Backwards compatibility with legacy Samsung-specific power domain
bindings is provided, but for now the new code is not compiled when
CONFIG_ARCH_EXYNOS is selected to avoid collision with legacy code. This
will change as soon as Exynos power domain code gets converted to use
the generic framework in further patch.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Reviewed-by: Mark Brown <broonie@linaro.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Reviewed-by: Philipp Zabel <philipp.zabel@gmail.com>
[on i.MX6 GK802]
Tested-by: Philipp Zabel <philipp.zabel@gmail.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 .../devicetree/bindings/power/power_domain.txt     |   51 ++++
 drivers/base/power/domain.c                        |  283 ++++++++++++++++++++
 include/linux/pm_domain.h                          |   46 ++++
 kernel/power/Kconfig                               |    4 +
 4 files changed, 384 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/power_domain.txt

diff --git a/Documentation/devicetree/bindings/power/power_domain.txt b/Documentation/devicetree/bindings/power/power_domain.txt
new file mode 100644
index 0000000..303d0a9
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/power_domain.txt
@@ -0,0 +1,51 @@
+* Generic power domains
+
+System on chip designs are often divided into multiple power domains that
+can be used for power gating of selected IP blocks for power saving by
+reduced leakage current.
+
+This device tree binding can be used to bind power domain consumer devices
+with their power domains provided by power domain providers. A power domain
+provider can be represented by any node in the device tree and can provide
+one or more power domains. A consumer node can refer to the provider by
+a phandle and a set of phandle arguments (so called power domain specifier)
+of length specified by #power-domain-cells property in the power domain
+provider node.
+
+==Power domain providers==
+
+Required properties:
+ - #power-domain-cells : Number of cells in a power domain specifier;
+   Typically 0 for nodes representing a single power domain and 1 for nodes
+   providing multiple power domains (e.g. power controllers), but can be
+   any value as specified by device tree binding documentation of particular
+   provider.
+
+Example:
+
+	power: power-controller@12340000 {
+		compatible = "foo,power-controller";
+		reg = <0x12340000 0x1000>;
+		#power-domain-cells = <1>;
+	};
+
+The node above defines a power controller that is a power domain provider
+and expects one cell as its phandle argument.
+
+==Power domain consumers==
+
+Required properties:
+ - power-domains : A phandle and power domain specifier as defined by bindings
+                   of power controller specified by phandle.
+
+Example:
+
+	leaky-device@12350000 {
+		compatible = "foo,i-leak-current";
+		reg = <0x12350000 0x1000>;
+		power-domains = <&power 0>;
+	};
+
+The node above defines a typical power domain consumer device, which is located
+inside power domain with index 0 of power controller represented by node with
+label "power".
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index eee55c1..dc766a7 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -8,6 +8,7 @@
 
 #include <linux/kernel.h>
 #include <linux/io.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/pm_domain.h>
 #include <linux/pm_qos.h>
@@ -2189,3 +2190,285 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
 	list_add(&genpd->gpd_list_node, &gpd_list);
 	mutex_unlock(&gpd_list_lock);
 }
+
+#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
+/*
+ * Device Tree based power domain providers.
+ *
+ * The code below implements generic device tree based power domain providers
+ * that bind device tree nodes with generic power domains registered in the
+ * system.
+ *
+ * Any driver that registers generic power domains and need to support binding
+ * of devices to these domains is supposed to register a power domain provider,
+ * which maps a power domain specifier retrieved from device tree to a power
+ * domain.
+ *
+ * Two simple mapping functions have been provided for convenience:
+ *  - of_genpd_xlate_simple() for 1:1 device tree node to domain mapping,
+ *  - of_genpd_xlate_onecell() for mapping of multiple domains per node
+ *    by index.
+ */
+
+/**
+ * struct of_genpd_provider - Power domain provider registration structure
+ * @link: Entry in global list of domain providers
+ * @node: Pointer to device tree node of domain provider
+ * @xlate: Provider-specific xlate callback mapping a set of specifier cells
+ *         into a power domain.
+ * @data: context pointer to be passed into @xlate callback
+ */
+struct of_genpd_provider {
+	struct list_head link;
+
+	struct device_node *node;
+	genpd_xlate_t xlate;
+	void *data;
+};
+
+/* List of registered power domain providers. */
+static LIST_HEAD(of_genpd_providers);
+/* Mutex to protect the list above. */
+static DEFINE_MUTEX(of_genpd_mutex);
+
+/**
+ * of_genpd_xlate_simple() - Xlate function for direct node-domain mapping
+ * @genpdspec: OF phandle args to map into a power domain
+ * @data: xlate function private data - pointer to struct generic_pm_domain
+ *
+ * This is a generic xlate function that can be used to model power domains
+ * that have their own device tree nodes. The private data of xlate function
+ * needs to be a valid pointer to struct generic_pm_domain.
+ */
+struct generic_pm_domain *of_genpd_xlate_simple(
+					struct of_phandle_args *genpdspec,
+					void *data)
+{
+	if (genpdspec->args_count != 0)
+		return ERR_PTR(-EINVAL);
+	return data;
+}
+EXPORT_SYMBOL_GPL(of_genpd_xlate_simple);
+
+/**
+ * of_genpd_xlate_onecell() - Xlate function for providers using single index.
+ * @genpdspec: OF phandle args to map into a power domain
+ * @data: xlate function private data - pointer to struct genpd_onecell_data
+ *
+ * This is a generic xlate function that can be used to model simple power
+ * domain controllers that have one device tree node and provide multiple
+ * power domains. A single cell is used as an index to an array of power
+ * domains specified in genpd_onecell_data struct when registering the
+ * provider.
+ */
+struct generic_pm_domain *of_genpd_xlate_onecell(
+					struct of_phandle_args *genpdspec,
+					void *data)
+{
+	struct genpd_onecell_data *genpd_data = data;
+	unsigned int idx = genpdspec->args[0];
+
+	if (genpdspec->args_count != 1)
+		return ERR_PTR(-EINVAL);
+
+	if (idx >= genpd_data->domain_num) {
+		pr_err("%s: invalid domain index %d\n", __func__, idx);
+		return ERR_PTR(-EINVAL);
+	}
+
+	return genpd_data->domains[idx];
+}
+EXPORT_SYMBOL_GPL(of_genpd_xlate_onecell);
+
+/**
+ * of_genpd_add_provider() - Register a domain provider for a node
+ * @np: Device node pointer associated with domain provider.
+ * @xlate: Callback for decoding domain from phandle arguments.
+ * @data: Context pointer for @genpd_src_get callback.
+ */
+int of_genpd_add_provider(struct device_node *np, genpd_xlate_t xlate,
+			  void *data)
+{
+	struct of_genpd_provider *cp;
+
+	cp = kzalloc(sizeof(*cp), GFP_KERNEL);
+	if (!cp)
+		return -ENOMEM;
+
+	cp->node = of_node_get(np);
+	cp->data = data;
+	cp->xlate = xlate;
+
+	mutex_lock(&of_genpd_mutex);
+	list_add(&cp->link, &of_genpd_providers);
+	mutex_unlock(&of_genpd_mutex);
+	pr_debug("Added domain provider from %s\n", np->full_name);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(of_genpd_add_provider);
+
+/**
+ * of_genpd_del_provider() - Remove a previously registered domain provider
+ * @np: Device node pointer associated with domain provider
+ */
+void of_genpd_del_provider(struct device_node *np)
+{
+	struct of_genpd_provider *cp;
+
+	mutex_lock(&of_genpd_mutex);
+	list_for_each_entry(cp, &of_genpd_providers, link) {
+		if (cp->node == np) {
+			list_del(&cp->link);
+			of_node_put(cp->node);
+			kfree(cp);
+			break;
+		}
+	}
+	mutex_unlock(&of_genpd_mutex);
+}
+EXPORT_SYMBOL_GPL(of_genpd_del_provider);
+
+/**
+ * of_genpd_get_from_provider() - Look-up power domain
+ * @genpdspec: OF phandle args to use for look-up
+ *
+ * Looks for domain provider under node specified by @genpdspec and if found
+ * uses xlate function of the provider to map phandle args to a power domain.
+ *
+ * Returns a valid pointer to struct generic_pm_domain on success or ERR_PTR()
+ * on failure.
+ */
+static struct generic_pm_domain *of_genpd_get_from_provider(
+					struct of_phandle_args *genpdspec)
+{
+	struct generic_pm_domain *genpd = ERR_PTR(-EPROBE_DEFER);
+	struct of_genpd_provider *provider;
+
+	mutex_lock(&of_genpd_mutex);
+
+	/* Check if we have such a provider in our array */
+	list_for_each_entry(provider, &of_genpd_providers, link) {
+		if (provider->node == genpdspec->np)
+			genpd = provider->xlate(genpdspec, provider->data);
+		if (!IS_ERR(genpd))
+			break;
+	}
+
+	mutex_unlock(&of_genpd_mutex);
+
+	return genpd;
+}
+
+/*
+ * Device<->domain binding using Device Tree look-up.
+ *
+ * The purpose of code below is to manage assignment of devices to their
+ * power domains in an automatic fashion, based on data read from device tree.
+ * The two functions, genpd_bind_domain() and genpd_unbind_domain() are
+ * intended to be called by higher level code that manages devices, i.e.
+ * really_probe() and __device_release_driver() to respectively bind and
+ * unbind device from its power domain.
+ *
+ * Both generic and legacy Samsung-specific DT bindings are supported to
+ * keep backwards compatibility with existing DTBs.
+ */
+
+/**
+ * genpd_bind_domain - Bind device to its power domain using Device Tree.
+ * @dev: Device to bind to its power domain.
+ *
+ * Tries to parse power domain specifier from device's OF node and if succeeds
+ * attaches the device to retrieved power domain.
+ *
+ * Returns 0 on success or negative error code otherwise.
+ */
+int genpd_bind_domain(struct device *dev)
+{
+	struct of_phandle_args pd_args;
+	struct generic_pm_domain *pd;
+	int ret;
+
+	if (!dev->of_node)
+		return 0;
+
+	ret = of_parse_phandle_with_args(dev->of_node, "power-domains",
+					"#power-domain-cells", 0, &pd_args);
+	if (ret < 0) {
+		if (ret != -ENOENT)
+			return ret;
+
+		/*
+		 * Try legacy Samsung-specific bindings
+		 * (for backwards compatibility of DT ABI)
+		 */
+		pd_args.args_count = 0;
+		pd_args.np = of_parse_phandle(dev->of_node,
+						"samsung,power-domain", 0);
+		if (!pd_args.np)
+			return 0;
+	}
+
+	pd = of_genpd_get_from_provider(&pd_args);
+	if (IS_ERR(pd)) {
+		if (PTR_ERR(pd) != -EPROBE_DEFER)
+			dev_err(dev, "failed to find power domain: %ld\n",
+				PTR_ERR(pd));
+		return PTR_ERR(pd);
+	}
+
+	dev_dbg(dev, "adding to power domain %s\n", pd->name);
+
+	while (1) {
+		ret = pm_genpd_add_device(pd, dev);
+		if (ret != -EAGAIN)
+			break;
+		cond_resched();
+	}
+
+	if (ret < 0) {
+		dev_err(dev, "failed to add to power domain %s: %d",
+			pd->name, ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+/**
+ * genpd_unbind_domain - Unbind device from its power domain.
+ * @dev: Device to unbind from its power domain.
+ *
+ * Unbinds device from power domain previously bound to it.
+ *
+ * Returns 0 on success or negative error code otherwise.
+ */
+int genpd_unbind_domain(struct device *dev)
+{
+	struct generic_pm_domain *pd = dev_to_genpd(dev);
+	int ret;
+
+	if (!dev->of_node || IS_ERR(pd))
+		return 0;
+
+	dev_dbg(dev, "removing from power domain %s\n", pd->name);
+
+	while (1) {
+		ret = pm_genpd_remove_device(pd, dev);
+		if (ret != -EAGAIN)
+			break;
+		cond_resched();
+	}
+
+	if (ret < 0) {
+		dev_err(dev, "failed to remove from power domain %s: %d",
+			pd->name, ret);
+		return ret;
+	}
+
+	/* Check if domain can be powered off after removing this device. */
+	genpd_queue_power_off_work(pd);
+
+	return 0;
+}
+#endif
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 7c1d252..04473d4 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -310,4 +310,50 @@ static inline void pm_genpd_syscore_poweron(struct device *dev)
 	pm_genpd_syscore_switch(dev, false);
 }
 
+/* OF power domain providers */
+struct of_device_id;
+
+struct genpd_onecell_data {
+	struct generic_pm_domain **domains;
+	unsigned int domain_num;
+};
+
+typedef struct generic_pm_domain *(*genpd_xlate_t)(struct of_phandle_args *args,
+						   void *data);
+
+#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
+int of_genpd_add_provider(struct device_node *np, genpd_xlate_t xlate,
+			  void *data);
+void of_genpd_del_provider(struct device_node *np);
+
+struct generic_pm_domain *of_genpd_xlate_simple(
+					struct of_phandle_args *genpdspec,
+					void *data);
+struct generic_pm_domain *of_genpd_xlate_onecell(
+					struct of_phandle_args *genpdspec,
+					void *data);
+
+int genpd_bind_domain(struct device *dev);
+int genpd_unbind_domain(struct device *dev);
+#else /* !CONFIG_PM_GENERIC_DOMAINS_OF */
+static inline int of_genpd_add_provider(struct device_node *np,
+					genpd_xlate_t xlate, void *data)
+{
+	return 0;
+}
+static inline void of_genpd_del_provider(struct device_node *np) {}
+
+#define of_genpd_xlate_simple		NULL
+#define of_genpd_xlate_onecell		NULL
+
+static inline int genpd_bind_domain(struct device *dev)
+{
+	return 0;
+}
+static inline int genpd_unbind_domain(struct device *dev)
+{
+	return 0;
+}
+#endif /* CONFIG_PM_GENERIC_DOMAINS_OF */
+
 #endif /* _LINUX_PM_DOMAIN_H */
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index 9a83d78..03b1551 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -305,6 +305,10 @@ 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 && !ARCH_EXYNOS
+
 config CPU_PM
 	bool
 	depends on SUSPEND || CPU_IDLE
-- 
1.7.9.5


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

* [PATCH 01/24] base: power: Add generic OF-based power domain look-up
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tomasz Figa <t.figa@samsung.com>

This patch introduces generic code to perform power domain look-up using
device tree and automatically bind devices to their power domains.
Generic device tree binding is introduced to specify power domains of
devices in their device tree nodes.

Backwards compatibility with legacy Samsung-specific power domain
bindings is provided, but for now the new code is not compiled when
CONFIG_ARCH_EXYNOS is selected to avoid collision with legacy code. This
will change as soon as Exynos power domain code gets converted to use
the generic framework in further patch.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Reviewed-by: Mark Brown <broonie@linaro.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Reviewed-by: Philipp Zabel <philipp.zabel@gmail.com>
[on i.MX6 GK802]
Tested-by: Philipp Zabel <philipp.zabel@gmail.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 .../devicetree/bindings/power/power_domain.txt     |   51 ++++
 drivers/base/power/domain.c                        |  283 ++++++++++++++++++++
 include/linux/pm_domain.h                          |   46 ++++
 kernel/power/Kconfig                               |    4 +
 4 files changed, 384 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/power_domain.txt

diff --git a/Documentation/devicetree/bindings/power/power_domain.txt b/Documentation/devicetree/bindings/power/power_domain.txt
new file mode 100644
index 0000000..303d0a9
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/power_domain.txt
@@ -0,0 +1,51 @@
+* Generic power domains
+
+System on chip designs are often divided into multiple power domains that
+can be used for power gating of selected IP blocks for power saving by
+reduced leakage current.
+
+This device tree binding can be used to bind power domain consumer devices
+with their power domains provided by power domain providers. A power domain
+provider can be represented by any node in the device tree and can provide
+one or more power domains. A consumer node can refer to the provider by
+a phandle and a set of phandle arguments (so called power domain specifier)
+of length specified by #power-domain-cells property in the power domain
+provider node.
+
+==Power domain providers==
+
+Required properties:
+ - #power-domain-cells : Number of cells in a power domain specifier;
+   Typically 0 for nodes representing a single power domain and 1 for nodes
+   providing multiple power domains (e.g. power controllers), but can be
+   any value as specified by device tree binding documentation of particular
+   provider.
+
+Example:
+
+	power: power-controller at 12340000 {
+		compatible = "foo,power-controller";
+		reg = <0x12340000 0x1000>;
+		#power-domain-cells = <1>;
+	};
+
+The node above defines a power controller that is a power domain provider
+and expects one cell as its phandle argument.
+
+==Power domain consumers==
+
+Required properties:
+ - power-domains : A phandle and power domain specifier as defined by bindings
+                   of power controller specified by phandle.
+
+Example:
+
+	leaky-device at 12350000 {
+		compatible = "foo,i-leak-current";
+		reg = <0x12350000 0x1000>;
+		power-domains = <&power 0>;
+	};
+
+The node above defines a typical power domain consumer device, which is located
+inside power domain with index 0 of power controller represented by node with
+label "power".
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index eee55c1..dc766a7 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -8,6 +8,7 @@
 
 #include <linux/kernel.h>
 #include <linux/io.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/pm_domain.h>
 #include <linux/pm_qos.h>
@@ -2189,3 +2190,285 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
 	list_add(&genpd->gpd_list_node, &gpd_list);
 	mutex_unlock(&gpd_list_lock);
 }
+
+#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
+/*
+ * Device Tree based power domain providers.
+ *
+ * The code below implements generic device tree based power domain providers
+ * that bind device tree nodes with generic power domains registered in the
+ * system.
+ *
+ * Any driver that registers generic power domains and need to support binding
+ * of devices to these domains is supposed to register a power domain provider,
+ * which maps a power domain specifier retrieved from device tree to a power
+ * domain.
+ *
+ * Two simple mapping functions have been provided for convenience:
+ *  - of_genpd_xlate_simple() for 1:1 device tree node to domain mapping,
+ *  - of_genpd_xlate_onecell() for mapping of multiple domains per node
+ *    by index.
+ */
+
+/**
+ * struct of_genpd_provider - Power domain provider registration structure
+ * @link: Entry in global list of domain providers
+ * @node: Pointer to device tree node of domain provider
+ * @xlate: Provider-specific xlate callback mapping a set of specifier cells
+ *         into a power domain.
+ * @data: context pointer to be passed into @xlate callback
+ */
+struct of_genpd_provider {
+	struct list_head link;
+
+	struct device_node *node;
+	genpd_xlate_t xlate;
+	void *data;
+};
+
+/* List of registered power domain providers. */
+static LIST_HEAD(of_genpd_providers);
+/* Mutex to protect the list above. */
+static DEFINE_MUTEX(of_genpd_mutex);
+
+/**
+ * of_genpd_xlate_simple() - Xlate function for direct node-domain mapping
+ * @genpdspec: OF phandle args to map into a power domain
+ * @data: xlate function private data - pointer to struct generic_pm_domain
+ *
+ * This is a generic xlate function that can be used to model power domains
+ * that have their own device tree nodes. The private data of xlate function
+ * needs to be a valid pointer to struct generic_pm_domain.
+ */
+struct generic_pm_domain *of_genpd_xlate_simple(
+					struct of_phandle_args *genpdspec,
+					void *data)
+{
+	if (genpdspec->args_count != 0)
+		return ERR_PTR(-EINVAL);
+	return data;
+}
+EXPORT_SYMBOL_GPL(of_genpd_xlate_simple);
+
+/**
+ * of_genpd_xlate_onecell() - Xlate function for providers using single index.
+ * @genpdspec: OF phandle args to map into a power domain
+ * @data: xlate function private data - pointer to struct genpd_onecell_data
+ *
+ * This is a generic xlate function that can be used to model simple power
+ * domain controllers that have one device tree node and provide multiple
+ * power domains. A single cell is used as an index to an array of power
+ * domains specified in genpd_onecell_data struct when registering the
+ * provider.
+ */
+struct generic_pm_domain *of_genpd_xlate_onecell(
+					struct of_phandle_args *genpdspec,
+					void *data)
+{
+	struct genpd_onecell_data *genpd_data = data;
+	unsigned int idx = genpdspec->args[0];
+
+	if (genpdspec->args_count != 1)
+		return ERR_PTR(-EINVAL);
+
+	if (idx >= genpd_data->domain_num) {
+		pr_err("%s: invalid domain index %d\n", __func__, idx);
+		return ERR_PTR(-EINVAL);
+	}
+
+	return genpd_data->domains[idx];
+}
+EXPORT_SYMBOL_GPL(of_genpd_xlate_onecell);
+
+/**
+ * of_genpd_add_provider() - Register a domain provider for a node
+ * @np: Device node pointer associated with domain provider.
+ * @xlate: Callback for decoding domain from phandle arguments.
+ * @data: Context pointer for @genpd_src_get callback.
+ */
+int of_genpd_add_provider(struct device_node *np, genpd_xlate_t xlate,
+			  void *data)
+{
+	struct of_genpd_provider *cp;
+
+	cp = kzalloc(sizeof(*cp), GFP_KERNEL);
+	if (!cp)
+		return -ENOMEM;
+
+	cp->node = of_node_get(np);
+	cp->data = data;
+	cp->xlate = xlate;
+
+	mutex_lock(&of_genpd_mutex);
+	list_add(&cp->link, &of_genpd_providers);
+	mutex_unlock(&of_genpd_mutex);
+	pr_debug("Added domain provider from %s\n", np->full_name);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(of_genpd_add_provider);
+
+/**
+ * of_genpd_del_provider() - Remove a previously registered domain provider
+ * @np: Device node pointer associated with domain provider
+ */
+void of_genpd_del_provider(struct device_node *np)
+{
+	struct of_genpd_provider *cp;
+
+	mutex_lock(&of_genpd_mutex);
+	list_for_each_entry(cp, &of_genpd_providers, link) {
+		if (cp->node == np) {
+			list_del(&cp->link);
+			of_node_put(cp->node);
+			kfree(cp);
+			break;
+		}
+	}
+	mutex_unlock(&of_genpd_mutex);
+}
+EXPORT_SYMBOL_GPL(of_genpd_del_provider);
+
+/**
+ * of_genpd_get_from_provider() - Look-up power domain
+ * @genpdspec: OF phandle args to use for look-up
+ *
+ * Looks for domain provider under node specified by @genpdspec and if found
+ * uses xlate function of the provider to map phandle args to a power domain.
+ *
+ * Returns a valid pointer to struct generic_pm_domain on success or ERR_PTR()
+ * on failure.
+ */
+static struct generic_pm_domain *of_genpd_get_from_provider(
+					struct of_phandle_args *genpdspec)
+{
+	struct generic_pm_domain *genpd = ERR_PTR(-EPROBE_DEFER);
+	struct of_genpd_provider *provider;
+
+	mutex_lock(&of_genpd_mutex);
+
+	/* Check if we have such a provider in our array */
+	list_for_each_entry(provider, &of_genpd_providers, link) {
+		if (provider->node == genpdspec->np)
+			genpd = provider->xlate(genpdspec, provider->data);
+		if (!IS_ERR(genpd))
+			break;
+	}
+
+	mutex_unlock(&of_genpd_mutex);
+
+	return genpd;
+}
+
+/*
+ * Device<->domain binding using Device Tree look-up.
+ *
+ * The purpose of code below is to manage assignment of devices to their
+ * power domains in an automatic fashion, based on data read from device tree.
+ * The two functions, genpd_bind_domain() and genpd_unbind_domain() are
+ * intended to be called by higher level code that manages devices, i.e.
+ * really_probe() and __device_release_driver() to respectively bind and
+ * unbind device from its power domain.
+ *
+ * Both generic and legacy Samsung-specific DT bindings are supported to
+ * keep backwards compatibility with existing DTBs.
+ */
+
+/**
+ * genpd_bind_domain - Bind device to its power domain using Device Tree.
+ * @dev: Device to bind to its power domain.
+ *
+ * Tries to parse power domain specifier from device's OF node and if succeeds
+ * attaches the device to retrieved power domain.
+ *
+ * Returns 0 on success or negative error code otherwise.
+ */
+int genpd_bind_domain(struct device *dev)
+{
+	struct of_phandle_args pd_args;
+	struct generic_pm_domain *pd;
+	int ret;
+
+	if (!dev->of_node)
+		return 0;
+
+	ret = of_parse_phandle_with_args(dev->of_node, "power-domains",
+					"#power-domain-cells", 0, &pd_args);
+	if (ret < 0) {
+		if (ret != -ENOENT)
+			return ret;
+
+		/*
+		 * Try legacy Samsung-specific bindings
+		 * (for backwards compatibility of DT ABI)
+		 */
+		pd_args.args_count = 0;
+		pd_args.np = of_parse_phandle(dev->of_node,
+						"samsung,power-domain", 0);
+		if (!pd_args.np)
+			return 0;
+	}
+
+	pd = of_genpd_get_from_provider(&pd_args);
+	if (IS_ERR(pd)) {
+		if (PTR_ERR(pd) != -EPROBE_DEFER)
+			dev_err(dev, "failed to find power domain: %ld\n",
+				PTR_ERR(pd));
+		return PTR_ERR(pd);
+	}
+
+	dev_dbg(dev, "adding to power domain %s\n", pd->name);
+
+	while (1) {
+		ret = pm_genpd_add_device(pd, dev);
+		if (ret != -EAGAIN)
+			break;
+		cond_resched();
+	}
+
+	if (ret < 0) {
+		dev_err(dev, "failed to add to power domain %s: %d",
+			pd->name, ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+/**
+ * genpd_unbind_domain - Unbind device from its power domain.
+ * @dev: Device to unbind from its power domain.
+ *
+ * Unbinds device from power domain previously bound to it.
+ *
+ * Returns 0 on success or negative error code otherwise.
+ */
+int genpd_unbind_domain(struct device *dev)
+{
+	struct generic_pm_domain *pd = dev_to_genpd(dev);
+	int ret;
+
+	if (!dev->of_node || IS_ERR(pd))
+		return 0;
+
+	dev_dbg(dev, "removing from power domain %s\n", pd->name);
+
+	while (1) {
+		ret = pm_genpd_remove_device(pd, dev);
+		if (ret != -EAGAIN)
+			break;
+		cond_resched();
+	}
+
+	if (ret < 0) {
+		dev_err(dev, "failed to remove from power domain %s: %d",
+			pd->name, ret);
+		return ret;
+	}
+
+	/* Check if domain can be powered off after removing this device. */
+	genpd_queue_power_off_work(pd);
+
+	return 0;
+}
+#endif
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 7c1d252..04473d4 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -310,4 +310,50 @@ static inline void pm_genpd_syscore_poweron(struct device *dev)
 	pm_genpd_syscore_switch(dev, false);
 }
 
+/* OF power domain providers */
+struct of_device_id;
+
+struct genpd_onecell_data {
+	struct generic_pm_domain **domains;
+	unsigned int domain_num;
+};
+
+typedef struct generic_pm_domain *(*genpd_xlate_t)(struct of_phandle_args *args,
+						   void *data);
+
+#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
+int of_genpd_add_provider(struct device_node *np, genpd_xlate_t xlate,
+			  void *data);
+void of_genpd_del_provider(struct device_node *np);
+
+struct generic_pm_domain *of_genpd_xlate_simple(
+					struct of_phandle_args *genpdspec,
+					void *data);
+struct generic_pm_domain *of_genpd_xlate_onecell(
+					struct of_phandle_args *genpdspec,
+					void *data);
+
+int genpd_bind_domain(struct device *dev);
+int genpd_unbind_domain(struct device *dev);
+#else /* !CONFIG_PM_GENERIC_DOMAINS_OF */
+static inline int of_genpd_add_provider(struct device_node *np,
+					genpd_xlate_t xlate, void *data)
+{
+	return 0;
+}
+static inline void of_genpd_del_provider(struct device_node *np) {}
+
+#define of_genpd_xlate_simple		NULL
+#define of_genpd_xlate_onecell		NULL
+
+static inline int genpd_bind_domain(struct device *dev)
+{
+	return 0;
+}
+static inline int genpd_unbind_domain(struct device *dev)
+{
+	return 0;
+}
+#endif /* CONFIG_PM_GENERIC_DOMAINS_OF */
+
 #endif /* _LINUX_PM_DOMAIN_H */
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index 9a83d78..03b1551 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -305,6 +305,10 @@ 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 && !ARCH_EXYNOS
+
 config CPU_PM
 	bool
 	depends on SUSPEND || CPU_IDLE
-- 
1.7.9.5

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

* [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Tomasz Figa

From: Tomasz Figa <t.figa@samsung.com>

On a number of platforms, devices are part of controllable power
domains, which need to be enabled before such devices can be accessed
and may be powered down when the device is idle to save some power.
This means that on systems that support power domain control using
generic power domains subsystem, it is necessary to add device to its
power domain before binding a driver to it and remove it from its power
domain after its driver is unbound to make sure that an unused device
does not affect power domain state.

Since this is not limited to particular busses and specific
archs/platforms, it is more convenient to do the above directly in
driver core, just as done with pinctrl default configuration. This patch
adds necessary code to really_probe() and __device_release_driver() to
achieve this and maintain consistent stack-like ordering of operations
happening when binding and unbinding a driver.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Philipp Zabel <philipp.zabel@gmail.com>
[on i.MX6 GK802]
Tested-by: Philipp Zabel <philipp.zabel@gmail.com>
Reviewed-by: Mark Brown <broonie@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/dd.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index e4ffbcf..80ad789 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -23,6 +23,7 @@
 #include <linux/kthread.h>
 #include <linux/wait.h>
 #include <linux/async.h>
+#include <linux/pm_domain.h>
 #include <linux/pm_runtime.h>
 #include <linux/pinctrl/devinfo.h>
 
@@ -287,6 +288,11 @@ static int really_probe(struct device *dev, struct device_driver *drv)
 
 	dev->driver = drv;
 
+	/* If using genpd, bind power domain now before probing */
+	ret = genpd_bind_domain(dev);
+	if (ret)
+		goto probe_failed;
+
 	/* If using pinctrl, bind pins now before probing */
 	ret = pinctrl_bind_pins(dev);
 	if (ret)
@@ -317,6 +323,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
 probe_failed:
 	devres_release_all(dev);
 	driver_sysfs_remove(dev);
+	genpd_unbind_domain(dev);
 	dev->driver = NULL;
 	dev_set_drvdata(dev, NULL);
 
@@ -530,7 +537,7 @@ static void __device_release_driver(struct device *dev)
 			blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
 						     BUS_NOTIFY_UNBOUND_DRIVER,
 						     dev);
-
+		genpd_unbind_domain(dev);
 	}
 }
 
-- 
1.7.9.5


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

* [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tomasz Figa <t.figa@samsung.com>

On a number of platforms, devices are part of controllable power
domains, which need to be enabled before such devices can be accessed
and may be powered down when the device is idle to save some power.
This means that on systems that support power domain control using
generic power domains subsystem, it is necessary to add device to its
power domain before binding a driver to it and remove it from its power
domain after its driver is unbound to make sure that an unused device
does not affect power domain state.

Since this is not limited to particular busses and specific
archs/platforms, it is more convenient to do the above directly in
driver core, just as done with pinctrl default configuration. This patch
adds necessary code to really_probe() and __device_release_driver() to
achieve this and maintain consistent stack-like ordering of operations
happening when binding and unbinding a driver.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Philipp Zabel <philipp.zabel@gmail.com>
[on i.MX6 GK802]
Tested-by: Philipp Zabel <philipp.zabel@gmail.com>
Reviewed-by: Mark Brown <broonie@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/dd.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index e4ffbcf..80ad789 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -23,6 +23,7 @@
 #include <linux/kthread.h>
 #include <linux/wait.h>
 #include <linux/async.h>
+#include <linux/pm_domain.h>
 #include <linux/pm_runtime.h>
 #include <linux/pinctrl/devinfo.h>
 
@@ -287,6 +288,11 @@ static int really_probe(struct device *dev, struct device_driver *drv)
 
 	dev->driver = drv;
 
+	/* If using genpd, bind power domain now before probing */
+	ret = genpd_bind_domain(dev);
+	if (ret)
+		goto probe_failed;
+
 	/* If using pinctrl, bind pins now before probing */
 	ret = pinctrl_bind_pins(dev);
 	if (ret)
@@ -317,6 +323,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
 probe_failed:
 	devres_release_all(dev);
 	driver_sysfs_remove(dev);
+	genpd_unbind_domain(dev);
 	dev->driver = NULL;
 	dev_set_drvdata(dev, NULL);
 
@@ -530,7 +537,7 @@ static void __device_release_driver(struct device *dev)
 			blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
 						     BUS_NOTIFY_UNBOUND_DRIVER,
 						     dev);
-
+		genpd_unbind_domain(dev);
 	}
 }
 
-- 
1.7.9.5

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

* [PATCH 03/24] ARM: exynos: Move to generic power domain bindings
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Tomasz Figa

From: Tomasz Figa <t.figa@samsung.com>

This patch moves Exynos power domain code to use the new generic power
domain look-up framework introduced by previous patch, allowing the new
code to be compiled with CONFIG_ARCH_EXYNOS selected as well.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
---
 .../bindings/arm/exynos/power_domain.txt           |   12 ++-
 arch/arm/mach-exynos/pm_domains.c                  |   81 +-------------------
 kernel/power/Kconfig                               |    2 +-
 3 files changed, 7 insertions(+), 88 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
index 5216b41..60f26a8 100644
--- a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
+++ b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
@@ -8,6 +8,8 @@ Required Properties:
     * samsung,exynos4210-pd - for exynos4210 type power domain.
 - reg: physical base address of the controller and length of memory mapped
     region.
+- #power-domain-cells: number of cells in power domain specifier;
+    must be 0.
 
 Node of a device using power domains must have a samsung,power-domain property
 defined with a phandle to respective power domain.
@@ -17,12 +19,8 @@ Example:
 	lcd0: power-domain-lcd0 {
 		compatible = "samsung,exynos4210-pd";
 		reg = <0x10023C00 0x10>;
+		#power-domain-cells = <0>;
 	};
 
-Example of the node using power domain:
-
-	node {
-		/* ... */
-		samsung,power-domain = <&lcd0>;
-		/* ... */
-	};
+See Documentation/devicetree/bindings/power/power_domain.txt for description
+of consumer-side bindings.
diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
index fe6570e..9cad3c6 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -73,89 +73,14 @@ static int exynos_pd_power_off(struct generic_pm_domain *domain)
 	return exynos_pd_power(domain, false);
 }
 
-static void exynos_add_device_to_domain(struct exynos_pm_domain *pd,
-					 struct device *dev)
-{
-	int ret;
-
-	dev_dbg(dev, "adding to power domain %s\n", pd->pd.name);
-
-	while (1) {
-		ret = pm_genpd_add_device(&pd->pd, dev);
-		if (ret != -EAGAIN)
-			break;
-		cond_resched();
-	}
-
-	pm_genpd_dev_need_restore(dev, true);
-}
-
-static void exynos_remove_device_from_domain(struct device *dev)
-{
-	struct generic_pm_domain *genpd = dev_to_genpd(dev);
-	int ret;
-
-	dev_dbg(dev, "removing from power domain %s\n", genpd->name);
-
-	while (1) {
-		ret = pm_genpd_remove_device(genpd, dev);
-		if (ret != -EAGAIN)
-			break;
-		cond_resched();
-	}
-}
-
-static void exynos_read_domain_from_dt(struct device *dev)
-{
-	struct platform_device *pd_pdev;
-	struct exynos_pm_domain *pd;
-	struct device_node *node;
-
-	node = of_parse_phandle(dev->of_node, "samsung,power-domain", 0);
-	if (!node)
-		return;
-	pd_pdev = of_find_device_by_node(node);
-	if (!pd_pdev)
-		return;
-	pd = platform_get_drvdata(pd_pdev);
-	exynos_add_device_to_domain(pd, dev);
-}
-
-static int exynos_pm_notifier_call(struct notifier_block *nb,
-				    unsigned long event, void *data)
-{
-	struct device *dev = data;
-
-	switch (event) {
-	case BUS_NOTIFY_BIND_DRIVER:
-		if (dev->of_node)
-			exynos_read_domain_from_dt(dev);
-
-		break;
-
-	case BUS_NOTIFY_UNBOUND_DRIVER:
-		exynos_remove_device_from_domain(dev);
-
-		break;
-	}
-	return NOTIFY_DONE;
-}
-
-static struct notifier_block platform_nb = {
-	.notifier_call = exynos_pm_notifier_call,
-};
-
 static __init int exynos4_pm_init_power_domain(void)
 {
-	struct platform_device *pdev;
 	struct device_node *np;
 
 	for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") {
 		struct exynos_pm_domain *pd;
 		int on;
 
-		pdev = of_find_device_by_node(np);
-
 		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
 		if (!pd) {
 			pr_err("%s: failed to allocate memory for domain\n",
@@ -168,17 +93,13 @@ static __init int exynos4_pm_init_power_domain(void)
 		pd->base = of_iomap(np, 0);
 		pd->pd.power_off = exynos_pd_power_off;
 		pd->pd.power_on = exynos_pd_power_on;
-		pd->pd.of_node = np;
-
-		platform_set_drvdata(pdev, pd);
 
 		on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN;
 
 		pm_genpd_init(&pd->pd, NULL, !on);
+		of_genpd_add_provider(np, of_genpd_xlate_simple, &pd->pd);
 	}
 
-	bus_register_notifier(&platform_bus_type, &platform_nb);
-
 	return 0;
 }
 arch_initcall(exynos4_pm_init_power_domain);
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index 03b1551..ed6187e 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -307,7 +307,7 @@ config PM_GENERIC_DOMAINS_RUNTIME
 
 config PM_GENERIC_DOMAINS_OF
 	def_bool y
-	depends on PM_GENERIC_DOMAINS && OF && !ARCH_EXYNOS
+	depends on PM_GENERIC_DOMAINS && OF
 
 config CPU_PM
 	bool
-- 
1.7.9.5


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

* [PATCH 03/24] ARM: exynos: Move to generic power domain bindings
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tomasz Figa <t.figa@samsung.com>

This patch moves Exynos power domain code to use the new generic power
domain look-up framework introduced by previous patch, allowing the new
code to be compiled with CONFIG_ARCH_EXYNOS selected as well.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
---
 .../bindings/arm/exynos/power_domain.txt           |   12 ++-
 arch/arm/mach-exynos/pm_domains.c                  |   81 +-------------------
 kernel/power/Kconfig                               |    2 +-
 3 files changed, 7 insertions(+), 88 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
index 5216b41..60f26a8 100644
--- a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
+++ b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
@@ -8,6 +8,8 @@ Required Properties:
     * samsung,exynos4210-pd - for exynos4210 type power domain.
 - reg: physical base address of the controller and length of memory mapped
     region.
+- #power-domain-cells: number of cells in power domain specifier;
+    must be 0.
 
 Node of a device using power domains must have a samsung,power-domain property
 defined with a phandle to respective power domain.
@@ -17,12 +19,8 @@ Example:
 	lcd0: power-domain-lcd0 {
 		compatible = "samsung,exynos4210-pd";
 		reg = <0x10023C00 0x10>;
+		#power-domain-cells = <0>;
 	};
 
-Example of the node using power domain:
-
-	node {
-		/* ... */
-		samsung,power-domain = <&lcd0>;
-		/* ... */
-	};
+See Documentation/devicetree/bindings/power/power_domain.txt for description
+of consumer-side bindings.
diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
index fe6570e..9cad3c6 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -73,89 +73,14 @@ static int exynos_pd_power_off(struct generic_pm_domain *domain)
 	return exynos_pd_power(domain, false);
 }
 
-static void exynos_add_device_to_domain(struct exynos_pm_domain *pd,
-					 struct device *dev)
-{
-	int ret;
-
-	dev_dbg(dev, "adding to power domain %s\n", pd->pd.name);
-
-	while (1) {
-		ret = pm_genpd_add_device(&pd->pd, dev);
-		if (ret != -EAGAIN)
-			break;
-		cond_resched();
-	}
-
-	pm_genpd_dev_need_restore(dev, true);
-}
-
-static void exynos_remove_device_from_domain(struct device *dev)
-{
-	struct generic_pm_domain *genpd = dev_to_genpd(dev);
-	int ret;
-
-	dev_dbg(dev, "removing from power domain %s\n", genpd->name);
-
-	while (1) {
-		ret = pm_genpd_remove_device(genpd, dev);
-		if (ret != -EAGAIN)
-			break;
-		cond_resched();
-	}
-}
-
-static void exynos_read_domain_from_dt(struct device *dev)
-{
-	struct platform_device *pd_pdev;
-	struct exynos_pm_domain *pd;
-	struct device_node *node;
-
-	node = of_parse_phandle(dev->of_node, "samsung,power-domain", 0);
-	if (!node)
-		return;
-	pd_pdev = of_find_device_by_node(node);
-	if (!pd_pdev)
-		return;
-	pd = platform_get_drvdata(pd_pdev);
-	exynos_add_device_to_domain(pd, dev);
-}
-
-static int exynos_pm_notifier_call(struct notifier_block *nb,
-				    unsigned long event, void *data)
-{
-	struct device *dev = data;
-
-	switch (event) {
-	case BUS_NOTIFY_BIND_DRIVER:
-		if (dev->of_node)
-			exynos_read_domain_from_dt(dev);
-
-		break;
-
-	case BUS_NOTIFY_UNBOUND_DRIVER:
-		exynos_remove_device_from_domain(dev);
-
-		break;
-	}
-	return NOTIFY_DONE;
-}
-
-static struct notifier_block platform_nb = {
-	.notifier_call = exynos_pm_notifier_call,
-};
-
 static __init int exynos4_pm_init_power_domain(void)
 {
-	struct platform_device *pdev;
 	struct device_node *np;
 
 	for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") {
 		struct exynos_pm_domain *pd;
 		int on;
 
-		pdev = of_find_device_by_node(np);
-
 		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
 		if (!pd) {
 			pr_err("%s: failed to allocate memory for domain\n",
@@ -168,17 +93,13 @@ static __init int exynos4_pm_init_power_domain(void)
 		pd->base = of_iomap(np, 0);
 		pd->pd.power_off = exynos_pd_power_off;
 		pd->pd.power_on = exynos_pd_power_on;
-		pd->pd.of_node = np;
-
-		platform_set_drvdata(pdev, pd);
 
 		on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN;
 
 		pm_genpd_init(&pd->pd, NULL, !on);
+		of_genpd_add_provider(np, of_genpd_xlate_simple, &pd->pd);
 	}
 
-	bus_register_notifier(&platform_bus_type, &platform_nb);
-
 	return 0;
 }
 arch_initcall(exynos4_pm_init_power_domain);
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index 03b1551..ed6187e 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -307,7 +307,7 @@ config PM_GENERIC_DOMAINS_RUNTIME
 
 config PM_GENERIC_DOMAINS_OF
 	def_bool y
-	depends on PM_GENERIC_DOMAINS && OF && !ARCH_EXYNOS
+	depends on PM_GENERIC_DOMAINS && OF
 
 config CPU_PM
 	bool
-- 
1.7.9.5

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

* [PATCH 04/24] PM / Domains: Ignore callbacks for subsys generic_pm_domain_data
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

In a step of simplifying the generic power domain let's move away from
using these callbacks.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |  131 +++----------------------------------------
 1 file changed, 8 insertions(+), 123 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index dc766a7..3a6d1e4 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -26,10 +26,6 @@
 	__routine = genpd->dev_ops.callback; 			\
 	if (__routine) {					\
 		__ret = __routine(dev); 			\
-	} else {						\
-		__routine = dev_gpd_data(dev)->ops.callback;	\
-		if (__routine) 					\
-			__ret = __routine(dev);			\
 	}							\
 	__ret;							\
 })
@@ -1978,10 +1974,6 @@ static int pm_genpd_default_save_state(struct device *dev)
 {
 	int (*cb)(struct device *__dev);
 
-	cb = dev_gpd_data(dev)->ops.save_state;
-	if (cb)
-		return cb(dev);
-
 	if (dev->type && dev->type->pm)
 		cb = dev->type->pm->runtime_suspend;
 	else if (dev->class && dev->class->pm)
@@ -2005,10 +1997,6 @@ static int pm_genpd_default_restore_state(struct device *dev)
 {
 	int (*cb)(struct device *__dev);
 
-	cb = dev_gpd_data(dev)->ops.restore_state;
-	if (cb)
-		return cb(dev);
-
 	if (dev->type && dev->type->pm)
 		cb = dev->type->pm->runtime_resume;
 	else if (dev->class && dev->class->pm)
@@ -2024,109 +2012,6 @@ static int pm_genpd_default_restore_state(struct device *dev)
 	return cb ? cb(dev) : 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
-
-/**
- * pm_genpd_default_suspend - Default "device suspend" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_suspend(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.suspend;
-
-	return cb ? cb(dev) : pm_generic_suspend(dev);
-}
-
-/**
- * pm_genpd_default_suspend_late - Default "late device suspend" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_suspend_late(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.suspend_late;
-
-	return cb ? cb(dev) : pm_generic_suspend_late(dev);
-}
-
-/**
- * pm_genpd_default_resume_early - Default "early device resume" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_resume_early(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.resume_early;
-
-	return cb ? cb(dev) : pm_generic_resume_early(dev);
-}
-
-/**
- * pm_genpd_default_resume - Default "device resume" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_resume(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.resume;
-
-	return cb ? cb(dev) : pm_generic_resume(dev);
-}
-
-/**
- * pm_genpd_default_freeze - Default "device freeze" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_freeze(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.freeze;
-
-	return cb ? cb(dev) : pm_generic_freeze(dev);
-}
-
-/**
- * pm_genpd_default_freeze_late - Default "late device freeze" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_freeze_late(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.freeze_late;
-
-	return cb ? cb(dev) : pm_generic_freeze_late(dev);
-}
-
-/**
- * pm_genpd_default_thaw_early - Default "early device thaw" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_thaw_early(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.thaw_early;
-
-	return cb ? cb(dev) : pm_generic_thaw_early(dev);
-}
-
-/**
- * pm_genpd_default_thaw - Default "device thaw" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_thaw(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.thaw;
-
-	return cb ? cb(dev) : pm_generic_thaw(dev);
-}
-
-#else /* !CONFIG_PM_SLEEP */
-
-#define pm_genpd_default_suspend	NULL
-#define pm_genpd_default_suspend_late	NULL
-#define pm_genpd_default_resume_early	NULL
-#define pm_genpd_default_resume		NULL
-#define pm_genpd_default_freeze		NULL
-#define pm_genpd_default_freeze_late	NULL
-#define pm_genpd_default_thaw_early	NULL
-#define pm_genpd_default_thaw		NULL
-
-#endif /* !CONFIG_PM_SLEEP */
-
 /**
  * pm_genpd_init - Initialize a generic I/O PM domain object.
  * @genpd: PM domain object to initialize.
@@ -2178,14 +2063,14 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
 	genpd->domain.ops.complete = pm_genpd_complete;
 	genpd->dev_ops.save_state = pm_genpd_default_save_state;
 	genpd->dev_ops.restore_state = pm_genpd_default_restore_state;
-	genpd->dev_ops.suspend = pm_genpd_default_suspend;
-	genpd->dev_ops.suspend_late = pm_genpd_default_suspend_late;
-	genpd->dev_ops.resume_early = pm_genpd_default_resume_early;
-	genpd->dev_ops.resume = pm_genpd_default_resume;
-	genpd->dev_ops.freeze = pm_genpd_default_freeze;
-	genpd->dev_ops.freeze_late = pm_genpd_default_freeze_late;
-	genpd->dev_ops.thaw_early = pm_genpd_default_thaw_early;
-	genpd->dev_ops.thaw = pm_genpd_default_thaw;
+	genpd->dev_ops.suspend = pm_generic_suspend;
+	genpd->dev_ops.suspend_late = pm_generic_suspend_late;
+	genpd->dev_ops.resume_early = pm_generic_resume_early;
+	genpd->dev_ops.resume = pm_generic_resume;
+	genpd->dev_ops.freeze = pm_generic_freeze;
+	genpd->dev_ops.freeze_late = pm_generic_freeze_late;
+	genpd->dev_ops.thaw_early = pm_generic_thaw_early;
+	genpd->dev_ops.thaw = pm_generic_thaw;
 	mutex_lock(&gpd_list_lock);
 	list_add(&genpd->gpd_list_node, &gpd_list);
 	mutex_unlock(&gpd_list_lock);
-- 
1.7.9.5


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

* [PATCH 04/24] PM / Domains: Ignore callbacks for subsys generic_pm_domain_data
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

In a step of simplifying the generic power domain let's move away from
using these callbacks.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |  131 +++----------------------------------------
 1 file changed, 8 insertions(+), 123 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index dc766a7..3a6d1e4 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -26,10 +26,6 @@
 	__routine = genpd->dev_ops.callback; 			\
 	if (__routine) {					\
 		__ret = __routine(dev); 			\
-	} else {						\
-		__routine = dev_gpd_data(dev)->ops.callback;	\
-		if (__routine) 					\
-			__ret = __routine(dev);			\
 	}							\
 	__ret;							\
 })
@@ -1978,10 +1974,6 @@ static int pm_genpd_default_save_state(struct device *dev)
 {
 	int (*cb)(struct device *__dev);
 
-	cb = dev_gpd_data(dev)->ops.save_state;
-	if (cb)
-		return cb(dev);
-
 	if (dev->type && dev->type->pm)
 		cb = dev->type->pm->runtime_suspend;
 	else if (dev->class && dev->class->pm)
@@ -2005,10 +1997,6 @@ static int pm_genpd_default_restore_state(struct device *dev)
 {
 	int (*cb)(struct device *__dev);
 
-	cb = dev_gpd_data(dev)->ops.restore_state;
-	if (cb)
-		return cb(dev);
-
 	if (dev->type && dev->type->pm)
 		cb = dev->type->pm->runtime_resume;
 	else if (dev->class && dev->class->pm)
@@ -2024,109 +2012,6 @@ static int pm_genpd_default_restore_state(struct device *dev)
 	return cb ? cb(dev) : 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
-
-/**
- * pm_genpd_default_suspend - Default "device suspend" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_suspend(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.suspend;
-
-	return cb ? cb(dev) : pm_generic_suspend(dev);
-}
-
-/**
- * pm_genpd_default_suspend_late - Default "late device suspend" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_suspend_late(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.suspend_late;
-
-	return cb ? cb(dev) : pm_generic_suspend_late(dev);
-}
-
-/**
- * pm_genpd_default_resume_early - Default "early device resume" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_resume_early(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.resume_early;
-
-	return cb ? cb(dev) : pm_generic_resume_early(dev);
-}
-
-/**
- * pm_genpd_default_resume - Default "device resume" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_resume(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.resume;
-
-	return cb ? cb(dev) : pm_generic_resume(dev);
-}
-
-/**
- * pm_genpd_default_freeze - Default "device freeze" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_freeze(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.freeze;
-
-	return cb ? cb(dev) : pm_generic_freeze(dev);
-}
-
-/**
- * pm_genpd_default_freeze_late - Default "late device freeze" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_freeze_late(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.freeze_late;
-
-	return cb ? cb(dev) : pm_generic_freeze_late(dev);
-}
-
-/**
- * pm_genpd_default_thaw_early - Default "early device thaw" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_thaw_early(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.thaw_early;
-
-	return cb ? cb(dev) : pm_generic_thaw_early(dev);
-}
-
-/**
- * pm_genpd_default_thaw - Default "device thaw" for PM domians.
- * @dev: Device to handle.
- */
-static int pm_genpd_default_thaw(struct device *dev)
-{
-	int (*cb)(struct device *__dev) = dev_gpd_data(dev)->ops.thaw;
-
-	return cb ? cb(dev) : pm_generic_thaw(dev);
-}
-
-#else /* !CONFIG_PM_SLEEP */
-
-#define pm_genpd_default_suspend	NULL
-#define pm_genpd_default_suspend_late	NULL
-#define pm_genpd_default_resume_early	NULL
-#define pm_genpd_default_resume		NULL
-#define pm_genpd_default_freeze		NULL
-#define pm_genpd_default_freeze_late	NULL
-#define pm_genpd_default_thaw_early	NULL
-#define pm_genpd_default_thaw		NULL
-
-#endif /* !CONFIG_PM_SLEEP */
-
 /**
  * pm_genpd_init - Initialize a generic I/O PM domain object.
  * @genpd: PM domain object to initialize.
@@ -2178,14 +2063,14 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
 	genpd->domain.ops.complete = pm_genpd_complete;
 	genpd->dev_ops.save_state = pm_genpd_default_save_state;
 	genpd->dev_ops.restore_state = pm_genpd_default_restore_state;
-	genpd->dev_ops.suspend = pm_genpd_default_suspend;
-	genpd->dev_ops.suspend_late = pm_genpd_default_suspend_late;
-	genpd->dev_ops.resume_early = pm_genpd_default_resume_early;
-	genpd->dev_ops.resume = pm_genpd_default_resume;
-	genpd->dev_ops.freeze = pm_genpd_default_freeze;
-	genpd->dev_ops.freeze_late = pm_genpd_default_freeze_late;
-	genpd->dev_ops.thaw_early = pm_genpd_default_thaw_early;
-	genpd->dev_ops.thaw = pm_genpd_default_thaw;
+	genpd->dev_ops.suspend = pm_generic_suspend;
+	genpd->dev_ops.suspend_late = pm_generic_suspend_late;
+	genpd->dev_ops.resume_early = pm_generic_resume_early;
+	genpd->dev_ops.resume = pm_generic_resume;
+	genpd->dev_ops.freeze = pm_generic_freeze;
+	genpd->dev_ops.freeze_late = pm_generic_freeze_late;
+	genpd->dev_ops.thaw_early = pm_generic_thaw_early;
+	genpd->dev_ops.thaw = pm_generic_thaw;
 	mutex_lock(&gpd_list_lock);
 	list_add(&genpd->gpd_list_node, &gpd_list);
 	mutex_unlock(&gpd_list_lock);
-- 
1.7.9.5

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

* [PATCH 05/24] PM / Domains: Remove the pm_genpd_add|remove_callbacks APIs
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

There are no users of these APIs. To simplify the generic power domain
let's remove them.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |  106 -------------------------------------------
 include/linux/pm_domain.h   |   20 --------
 2 files changed, 126 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 3a6d1e4..ab6597b 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1741,112 +1741,6 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
 }
 
 /**
- * pm_genpd_add_callbacks - Add PM domain callbacks to a given device.
- * @dev: Device to add the callbacks to.
- * @ops: Set of callbacks to add.
- * @td: Timing data to add to the device along with the callbacks (optional).
- *
- * Every call to this routine should be balanced with a call to
- * __pm_genpd_remove_callbacks() and they must not be nested.
- */
-int pm_genpd_add_callbacks(struct device *dev, struct gpd_dev_ops *ops,
-			   struct gpd_timing_data *td)
-{
-	struct generic_pm_domain_data *gpd_data_new, *gpd_data = NULL;
-	int ret = 0;
-
-	if (!(dev && ops))
-		return -EINVAL;
-
-	gpd_data_new = __pm_genpd_alloc_dev_data(dev);
-	if (!gpd_data_new)
-		return -ENOMEM;
-
-	pm_runtime_disable(dev);
-	device_pm_lock();
-
-	ret = dev_pm_get_subsys_data(dev);
-	if (ret)
-		goto out;
-
-	spin_lock_irq(&dev->power.lock);
-
-	if (dev->power.subsys_data->domain_data) {
-		gpd_data = to_gpd_data(dev->power.subsys_data->domain_data);
-	} else {
-		gpd_data = gpd_data_new;
-		dev->power.subsys_data->domain_data = &gpd_data->base;
-	}
-	gpd_data->refcount++;
-	gpd_data->ops = *ops;
-	if (td)
-		gpd_data->td = *td;
-
-	spin_unlock_irq(&dev->power.lock);
-
- out:
-	device_pm_unlock();
-	pm_runtime_enable(dev);
-
-	if (gpd_data != gpd_data_new)
-		__pm_genpd_free_dev_data(dev, gpd_data_new);
-
-	return ret;
-}
-EXPORT_SYMBOL_GPL(pm_genpd_add_callbacks);
-
-/**
- * __pm_genpd_remove_callbacks - Remove PM domain callbacks from a given device.
- * @dev: Device to remove the callbacks from.
- * @clear_td: If set, clear the device's timing data too.
- *
- * This routine can only be called after pm_genpd_add_callbacks().
- */
-int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
-{
-	struct generic_pm_domain_data *gpd_data = NULL;
-	bool remove = false;
-	int ret = 0;
-
-	if (!(dev && dev->power.subsys_data))
-		return -EINVAL;
-
-	pm_runtime_disable(dev);
-	device_pm_lock();
-
-	spin_lock_irq(&dev->power.lock);
-
-	if (dev->power.subsys_data->domain_data) {
-		gpd_data = to_gpd_data(dev->power.subsys_data->domain_data);
-		gpd_data->ops = (struct gpd_dev_ops){ NULL };
-		if (clear_td)
-			gpd_data->td = (struct gpd_timing_data){ 0 };
-
-		if (--gpd_data->refcount == 0) {
-			dev->power.subsys_data->domain_data = NULL;
-			remove = true;
-		}
-	} else {
-		ret = -EINVAL;
-	}
-
-	spin_unlock_irq(&dev->power.lock);
-
-	device_pm_unlock();
-	pm_runtime_enable(dev);
-
-	if (ret)
-		return ret;
-
-	dev_pm_put_subsys_data(dev);
-	if (remove)
-		__pm_genpd_free_dev_data(dev, gpd_data);
-
-	return 0;
-}
-EXPORT_SYMBOL_GPL(__pm_genpd_remove_callbacks);
-
-/**
  * pm_genpd_attach_cpuidle - Connect the given PM domain with cpuidle.
  * @genpd: PM domain to be connected with cpuidle.
  * @state: cpuidle state this domain can disable/enable.
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 04473d4..983efdc 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -108,7 +108,6 @@ struct gpd_timing_data {
 
 struct generic_pm_domain_data {
 	struct pm_domain_data base;
-	struct gpd_dev_ops ops;
 	struct gpd_timing_data td;
 	struct notifier_block nb;
 	struct mutex lock;
@@ -151,10 +150,6 @@ extern int pm_genpd_add_subdomain_names(const char *master_name,
 					const char *subdomain_name);
 extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
 				     struct generic_pm_domain *target);
-extern int pm_genpd_add_callbacks(struct device *dev,
-				  struct gpd_dev_ops *ops,
-				  struct gpd_timing_data *td);
-extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td);
 extern int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state);
 extern int pm_genpd_name_attach_cpuidle(const char *name, int state);
 extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd);
@@ -217,16 +212,6 @@ static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
 {
 	return -ENOSYS;
 }
-static inline int pm_genpd_add_callbacks(struct device *dev,
-					 struct gpd_dev_ops *ops,
-					 struct gpd_timing_data *td)
-{
-	return -ENOSYS;
-}
-static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
-{
-	return -ENOSYS;
-}
 static inline int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st)
 {
 	return -ENOSYS;
@@ -281,11 +266,6 @@ static inline int pm_genpd_name_add_device(const char *domain_name,
 	return __pm_genpd_name_add_device(domain_name, dev, NULL);
 }
 
-static inline int pm_genpd_remove_callbacks(struct device *dev)
-{
-	return __pm_genpd_remove_callbacks(dev, true);
-}
-
 #ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME
 extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
 extern void pm_genpd_poweroff_unused(void);
-- 
1.7.9.5


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

* [PATCH 05/24] PM / Domains: Remove the pm_genpd_add|remove_callbacks APIs
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

There are no users of these APIs. To simplify the generic power domain
let's remove them.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |  106 -------------------------------------------
 include/linux/pm_domain.h   |   20 --------
 2 files changed, 126 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 3a6d1e4..ab6597b 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1741,112 +1741,6 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
 }
 
 /**
- * pm_genpd_add_callbacks - Add PM domain callbacks to a given device.
- * @dev: Device to add the callbacks to.
- * @ops: Set of callbacks to add.
- * @td: Timing data to add to the device along with the callbacks (optional).
- *
- * Every call to this routine should be balanced with a call to
- * __pm_genpd_remove_callbacks() and they must not be nested.
- */
-int pm_genpd_add_callbacks(struct device *dev, struct gpd_dev_ops *ops,
-			   struct gpd_timing_data *td)
-{
-	struct generic_pm_domain_data *gpd_data_new, *gpd_data = NULL;
-	int ret = 0;
-
-	if (!(dev && ops))
-		return -EINVAL;
-
-	gpd_data_new = __pm_genpd_alloc_dev_data(dev);
-	if (!gpd_data_new)
-		return -ENOMEM;
-
-	pm_runtime_disable(dev);
-	device_pm_lock();
-
-	ret = dev_pm_get_subsys_data(dev);
-	if (ret)
-		goto out;
-
-	spin_lock_irq(&dev->power.lock);
-
-	if (dev->power.subsys_data->domain_data) {
-		gpd_data = to_gpd_data(dev->power.subsys_data->domain_data);
-	} else {
-		gpd_data = gpd_data_new;
-		dev->power.subsys_data->domain_data = &gpd_data->base;
-	}
-	gpd_data->refcount++;
-	gpd_data->ops = *ops;
-	if (td)
-		gpd_data->td = *td;
-
-	spin_unlock_irq(&dev->power.lock);
-
- out:
-	device_pm_unlock();
-	pm_runtime_enable(dev);
-
-	if (gpd_data != gpd_data_new)
-		__pm_genpd_free_dev_data(dev, gpd_data_new);
-
-	return ret;
-}
-EXPORT_SYMBOL_GPL(pm_genpd_add_callbacks);
-
-/**
- * __pm_genpd_remove_callbacks - Remove PM domain callbacks from a given device.
- * @dev: Device to remove the callbacks from.
- * @clear_td: If set, clear the device's timing data too.
- *
- * This routine can only be called after pm_genpd_add_callbacks().
- */
-int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
-{
-	struct generic_pm_domain_data *gpd_data = NULL;
-	bool remove = false;
-	int ret = 0;
-
-	if (!(dev && dev->power.subsys_data))
-		return -EINVAL;
-
-	pm_runtime_disable(dev);
-	device_pm_lock();
-
-	spin_lock_irq(&dev->power.lock);
-
-	if (dev->power.subsys_data->domain_data) {
-		gpd_data = to_gpd_data(dev->power.subsys_data->domain_data);
-		gpd_data->ops = (struct gpd_dev_ops){ NULL };
-		if (clear_td)
-			gpd_data->td = (struct gpd_timing_data){ 0 };
-
-		if (--gpd_data->refcount == 0) {
-			dev->power.subsys_data->domain_data = NULL;
-			remove = true;
-		}
-	} else {
-		ret = -EINVAL;
-	}
-
-	spin_unlock_irq(&dev->power.lock);
-
-	device_pm_unlock();
-	pm_runtime_enable(dev);
-
-	if (ret)
-		return ret;
-
-	dev_pm_put_subsys_data(dev);
-	if (remove)
-		__pm_genpd_free_dev_data(dev, gpd_data);
-
-	return 0;
-}
-EXPORT_SYMBOL_GPL(__pm_genpd_remove_callbacks);
-
-/**
  * pm_genpd_attach_cpuidle - Connect the given PM domain with cpuidle.
  * @genpd: PM domain to be connected with cpuidle.
  * @state: cpuidle state this domain can disable/enable.
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 04473d4..983efdc 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -108,7 +108,6 @@ struct gpd_timing_data {
 
 struct generic_pm_domain_data {
 	struct pm_domain_data base;
-	struct gpd_dev_ops ops;
 	struct gpd_timing_data td;
 	struct notifier_block nb;
 	struct mutex lock;
@@ -151,10 +150,6 @@ extern int pm_genpd_add_subdomain_names(const char *master_name,
 					const char *subdomain_name);
 extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
 				     struct generic_pm_domain *target);
-extern int pm_genpd_add_callbacks(struct device *dev,
-				  struct gpd_dev_ops *ops,
-				  struct gpd_timing_data *td);
-extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td);
 extern int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state);
 extern int pm_genpd_name_attach_cpuidle(const char *name, int state);
 extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd);
@@ -217,16 +212,6 @@ static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
 {
 	return -ENOSYS;
 }
-static inline int pm_genpd_add_callbacks(struct device *dev,
-					 struct gpd_dev_ops *ops,
-					 struct gpd_timing_data *td)
-{
-	return -ENOSYS;
-}
-static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
-{
-	return -ENOSYS;
-}
 static inline int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st)
 {
 	return -ENOSYS;
@@ -281,11 +266,6 @@ static inline int pm_genpd_name_add_device(const char *domain_name,
 	return __pm_genpd_name_add_device(domain_name, dev, NULL);
 }
 
-static inline int pm_genpd_remove_callbacks(struct device *dev)
-{
-	return __pm_genpd_remove_callbacks(dev, true);
-}
-
 #ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME
 extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
 extern void pm_genpd_poweroff_unused(void);
-- 
1.7.9.5

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

* [PATCH 06/24] PM / Domains: Remove system PM callbacks from gpd_dev_ops
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

There no users of these callbacks, let's simplify the generic power
domain by removing them.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |   64 ++++++-------------------------------------
 include/linux/pm_domain.h   |    8 ------
 2 files changed, 8 insertions(+), 64 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index ab6597b..da058e9 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -771,46 +771,6 @@ static bool genpd_dev_active_wakeup(struct generic_pm_domain *genpd,
 	return GENPD_DEV_CALLBACK(genpd, bool, active_wakeup, dev);
 }
 
-static int genpd_suspend_dev(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, suspend, dev);
-}
-
-static int genpd_suspend_late(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, suspend_late, dev);
-}
-
-static int genpd_resume_early(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, resume_early, dev);
-}
-
-static int genpd_resume_dev(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, resume, dev);
-}
-
-static int genpd_freeze_dev(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, freeze, dev);
-}
-
-static int genpd_freeze_late(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, freeze_late, dev);
-}
-
-static int genpd_thaw_early(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, thaw_early, dev);
-}
-
-static int genpd_thaw_dev(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, thaw, dev);
-}
-
 /**
  * pm_genpd_sync_poweroff - Synchronously power off a PM domain and its masters.
  * @genpd: PM domain to power off, if possible.
@@ -992,7 +952,7 @@ static int pm_genpd_suspend(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_suspend_dev(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_suspend(dev);
 }
 
 /**
@@ -1013,7 +973,7 @@ static int pm_genpd_suspend_late(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_suspend_late(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_suspend_late(dev);
 }
 
 /**
@@ -1100,7 +1060,7 @@ static int pm_genpd_resume_early(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_resume_early(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_resume_early(dev);
 }
 
 /**
@@ -1121,7 +1081,7 @@ static int pm_genpd_resume(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_resume_dev(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_resume(dev);
 }
 
 /**
@@ -1142,7 +1102,7 @@ static int pm_genpd_freeze(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_freeze_dev(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_freeze(dev);
 }
 
 /**
@@ -1164,7 +1124,7 @@ static int pm_genpd_freeze_late(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_freeze_late(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_freeze_late(dev);
 }
 
 /**
@@ -1228,7 +1188,7 @@ static int pm_genpd_thaw_early(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_thaw_early(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_thaw_early(dev);
 }
 
 /**
@@ -1249,7 +1209,7 @@ static int pm_genpd_thaw(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_thaw_dev(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_thaw(dev);
 }
 
 /**
@@ -1957,14 +1917,6 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
 	genpd->domain.ops.complete = pm_genpd_complete;
 	genpd->dev_ops.save_state = pm_genpd_default_save_state;
 	genpd->dev_ops.restore_state = pm_genpd_default_restore_state;
-	genpd->dev_ops.suspend = pm_generic_suspend;
-	genpd->dev_ops.suspend_late = pm_generic_suspend_late;
-	genpd->dev_ops.resume_early = pm_generic_resume_early;
-	genpd->dev_ops.resume = pm_generic_resume;
-	genpd->dev_ops.freeze = pm_generic_freeze;
-	genpd->dev_ops.freeze_late = pm_generic_freeze_late;
-	genpd->dev_ops.thaw_early = pm_generic_thaw_early;
-	genpd->dev_ops.thaw = pm_generic_thaw;
 	mutex_lock(&gpd_list_lock);
 	list_add(&genpd->gpd_list_node, &gpd_list);
 	mutex_unlock(&gpd_list_lock);
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 983efdc..87810a7 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -35,14 +35,6 @@ struct gpd_dev_ops {
 	int (*stop)(struct device *dev);
 	int (*save_state)(struct device *dev);
 	int (*restore_state)(struct device *dev);
-	int (*suspend)(struct device *dev);
-	int (*suspend_late)(struct device *dev);
-	int (*resume_early)(struct device *dev);
-	int (*resume)(struct device *dev);
-	int (*freeze)(struct device *dev);
-	int (*freeze_late)(struct device *dev);
-	int (*thaw_early)(struct device *dev);
-	int (*thaw)(struct device *dev);
 	bool (*active_wakeup)(struct device *dev);
 };
 
-- 
1.7.9.5


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

* [PATCH 06/24] PM / Domains: Remove system PM callbacks from gpd_dev_ops
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

There no users of these callbacks, let's simplify the generic power
domain by removing them.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |   64 ++++++-------------------------------------
 include/linux/pm_domain.h   |    8 ------
 2 files changed, 8 insertions(+), 64 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index ab6597b..da058e9 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -771,46 +771,6 @@ static bool genpd_dev_active_wakeup(struct generic_pm_domain *genpd,
 	return GENPD_DEV_CALLBACK(genpd, bool, active_wakeup, dev);
 }
 
-static int genpd_suspend_dev(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, suspend, dev);
-}
-
-static int genpd_suspend_late(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, suspend_late, dev);
-}
-
-static int genpd_resume_early(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, resume_early, dev);
-}
-
-static int genpd_resume_dev(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, resume, dev);
-}
-
-static int genpd_freeze_dev(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, freeze, dev);
-}
-
-static int genpd_freeze_late(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, freeze_late, dev);
-}
-
-static int genpd_thaw_early(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, thaw_early, dev);
-}
-
-static int genpd_thaw_dev(struct generic_pm_domain *genpd, struct device *dev)
-{
-	return GENPD_DEV_CALLBACK(genpd, int, thaw, dev);
-}
-
 /**
  * pm_genpd_sync_poweroff - Synchronously power off a PM domain and its masters.
  * @genpd: PM domain to power off, if possible.
@@ -992,7 +952,7 @@ static int pm_genpd_suspend(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_suspend_dev(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_suspend(dev);
 }
 
 /**
@@ -1013,7 +973,7 @@ static int pm_genpd_suspend_late(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_suspend_late(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_suspend_late(dev);
 }
 
 /**
@@ -1100,7 +1060,7 @@ static int pm_genpd_resume_early(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_resume_early(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_resume_early(dev);
 }
 
 /**
@@ -1121,7 +1081,7 @@ static int pm_genpd_resume(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_resume_dev(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_resume(dev);
 }
 
 /**
@@ -1142,7 +1102,7 @@ static int pm_genpd_freeze(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_freeze_dev(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_freeze(dev);
 }
 
 /**
@@ -1164,7 +1124,7 @@ static int pm_genpd_freeze_late(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_freeze_late(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_freeze_late(dev);
 }
 
 /**
@@ -1228,7 +1188,7 @@ static int pm_genpd_thaw_early(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_thaw_early(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_thaw_early(dev);
 }
 
 /**
@@ -1249,7 +1209,7 @@ static int pm_genpd_thaw(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	return genpd->suspend_power_off ? 0 : genpd_thaw_dev(genpd, dev);
+	return genpd->suspend_power_off ? 0 : pm_generic_thaw(dev);
 }
 
 /**
@@ -1957,14 +1917,6 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
 	genpd->domain.ops.complete = pm_genpd_complete;
 	genpd->dev_ops.save_state = pm_genpd_default_save_state;
 	genpd->dev_ops.restore_state = pm_genpd_default_restore_state;
-	genpd->dev_ops.suspend = pm_generic_suspend;
-	genpd->dev_ops.suspend_late = pm_generic_suspend_late;
-	genpd->dev_ops.resume_early = pm_generic_resume_early;
-	genpd->dev_ops.resume = pm_generic_resume;
-	genpd->dev_ops.freeze = pm_generic_freeze;
-	genpd->dev_ops.freeze_late = pm_generic_freeze_late;
-	genpd->dev_ops.thaw_early = pm_generic_thaw_early;
-	genpd->dev_ops.thaw = pm_generic_thaw;
 	mutex_lock(&gpd_list_lock);
 	list_add(&genpd->gpd_list_node, &gpd_list);
 	mutex_unlock(&gpd_list_lock);
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 983efdc..87810a7 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -35,14 +35,6 @@ struct gpd_dev_ops {
 	int (*stop)(struct device *dev);
 	int (*save_state)(struct device *dev);
 	int (*restore_state)(struct device *dev);
-	int (*suspend)(struct device *dev);
-	int (*suspend_late)(struct device *dev);
-	int (*resume_early)(struct device *dev);
-	int (*resume)(struct device *dev);
-	int (*freeze)(struct device *dev);
-	int (*freeze_late)(struct device *dev);
-	int (*thaw_early)(struct device *dev);
-	int (*thaw)(struct device *dev);
 	bool (*active_wakeup)(struct device *dev);
 };
 
-- 
1.7.9.5

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

* [PATCH 07/24] ARM: shmobile: Drop dev_irq_safe from r8a7779 genpd config
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

The dev_irq_safe configuration is redundant, genpd don't have any
special treatmeant for handling it. Let's remove it.

Cc: Simon Horman <horms@verge.net.au>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/mach-shmobile/pm-r8a7779.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c
index d6fe189..8cd2423 100644
--- a/arch/arm/mach-shmobile/pm-r8a7779.c
+++ b/arch/arm/mach-shmobile/pm-r8a7779.c
@@ -74,7 +74,6 @@ static void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
 	genpd->dev_ops.stop = pm_clk_suspend;
 	genpd->dev_ops.start = pm_clk_resume;
 	genpd->dev_ops.active_wakeup = pd_active_wakeup;
-	genpd->dev_irq_safe = true;
 	genpd->power_off = pd_power_down;
 	genpd->power_on = pd_power_up;
 
-- 
1.7.9.5


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

* [PATCH 07/24] ARM: shmobile: Drop dev_irq_safe from r8a7779 genpd config
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

The dev_irq_safe configuration is redundant, genpd don't have any
special treatmeant for handling it. Let's remove it.

Cc: Simon Horman <horms@verge.net.au>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/mach-shmobile/pm-r8a7779.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c
index d6fe189..8cd2423 100644
--- a/arch/arm/mach-shmobile/pm-r8a7779.c
+++ b/arch/arm/mach-shmobile/pm-r8a7779.c
@@ -74,7 +74,6 @@ static void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
 	genpd->dev_ops.stop = pm_clk_suspend;
 	genpd->dev_ops.start = pm_clk_resume;
 	genpd->dev_ops.active_wakeup = pd_active_wakeup;
-	genpd->dev_irq_safe = true;
 	genpd->power_off = pd_power_down;
 	genpd->power_on = pd_power_up;
 
-- 
1.7.9.5

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

* [PATCH 08/24] ARM: shmobile: Drop dev_irq_safe from R-mobile genpd config
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

The dev_irq_safe configuration is redundant, genpd don't have any
special treatmeant for handling it. Let's remove it.

Cc: Simon Horman <horms@verge.net.au>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/mach-shmobile/pm-rmobile.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c
index f710235..42b96da 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.c
+++ b/arch/arm/mach-shmobile/pm-rmobile.c
@@ -111,7 +111,6 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
 	genpd->dev_ops.stop		= pm_clk_suspend;
 	genpd->dev_ops.start		= pm_clk_resume;
 	genpd->dev_ops.active_wakeup	= rmobile_pd_active_wakeup;
-	genpd->dev_irq_safe		= true;
 	genpd->power_off		= rmobile_pd_power_down;
 	genpd->power_on			= rmobile_pd_power_up;
 	__rmobile_pd_power_up(rmobile_pd, false);
-- 
1.7.9.5


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

* [PATCH 08/24] ARM: shmobile: Drop dev_irq_safe from R-mobile genpd config
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

The dev_irq_safe configuration is redundant, genpd don't have any
special treatmeant for handling it. Let's remove it.

Cc: Simon Horman <horms@verge.net.au>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/mach-shmobile/pm-rmobile.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c
index f710235..42b96da 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.c
+++ b/arch/arm/mach-shmobile/pm-rmobile.c
@@ -111,7 +111,6 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
 	genpd->dev_ops.stop		= pm_clk_suspend;
 	genpd->dev_ops.start		= pm_clk_resume;
 	genpd->dev_ops.active_wakeup	= rmobile_pd_active_wakeup;
-	genpd->dev_irq_safe		= true;
 	genpd->power_off		= rmobile_pd_power_down;
 	genpd->power_on			= rmobile_pd_power_up;
 	__rmobile_pd_power_up(rmobile_pd, false);
-- 
1.7.9.5

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

* [PATCH 09/24] PM / Domains: Remove dev_irq_safe from genpd config
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

The genpd dev_irq_safe configuration overlaps with the runtime PM
pm_runtime_irq_safe() option. Let's remove it.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |    4 ----
 include/linux/pm_domain.h   |    1 -
 2 files changed, 5 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index da058e9..a2ebc77 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -616,8 +616,6 @@ static int pm_genpd_runtime_suspend(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	might_sleep_if(!genpd->dev_irq_safe);
-
 	stop_ok = genpd->gov ? genpd->gov->stop_ok : NULL;
 	if (stop_ok && !stop_ok(dev))
 		return -EBUSY;
@@ -662,8 +660,6 @@ static int pm_genpd_runtime_resume(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	might_sleep_if(!genpd->dev_irq_safe);
-
 	/* If power.irq_safe, the PM domain is never powered off. */
 	if (dev->power.irq_safe)
 		return genpd_start_dev_no_timing(genpd, dev);
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 87810a7..7aadf40 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -63,7 +63,6 @@ struct generic_pm_domain {
 	unsigned int suspended_count;	/* System suspend device counter */
 	unsigned int prepared_count;	/* Suspend counter of prepared devices */
 	bool suspend_power_off;	/* Power status before system suspend */
-	bool dev_irq_safe;	/* Device callbacks are IRQ-safe */
 	int (*power_off)(struct generic_pm_domain *domain);
 	s64 power_off_latency_ns;
 	int (*power_on)(struct generic_pm_domain *domain);
-- 
1.7.9.5


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

* [PATCH 09/24] PM / Domains: Remove dev_irq_safe from genpd config
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

The genpd dev_irq_safe configuration overlaps with the runtime PM
pm_runtime_irq_safe() option. Let's remove it.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |    4 ----
 include/linux/pm_domain.h   |    1 -
 2 files changed, 5 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index da058e9..a2ebc77 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -616,8 +616,6 @@ static int pm_genpd_runtime_suspend(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	might_sleep_if(!genpd->dev_irq_safe);
-
 	stop_ok = genpd->gov ? genpd->gov->stop_ok : NULL;
 	if (stop_ok && !stop_ok(dev))
 		return -EBUSY;
@@ -662,8 +660,6 @@ static int pm_genpd_runtime_resume(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	might_sleep_if(!genpd->dev_irq_safe);
-
 	/* If power.irq_safe, the PM domain is never powered off. */
 	if (dev->power.irq_safe)
 		return genpd_start_dev_no_timing(genpd, dev);
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 87810a7..7aadf40 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -63,7 +63,6 @@ struct generic_pm_domain {
 	unsigned int suspended_count;	/* System suspend device counter */
 	unsigned int prepared_count;	/* Suspend counter of prepared devices */
 	bool suspend_power_off;	/* Power status before system suspend */
-	bool dev_irq_safe;	/* Device callbacks are IRQ-safe */
 	int (*power_off)(struct generic_pm_domain *domain);
 	s64 power_off_latency_ns;
 	int (*power_on)(struct generic_pm_domain *domain);
-- 
1.7.9.5

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

* [PATCH 10/24] PM / Domains: Remove redundant check for CONFIG_PM
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

CONFIG_PM_GENERIC_DOMAINS depends on CONFIG_PM, thus there are no need
to check explicity for it.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index a2ebc77..0362360 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -67,8 +67,6 @@ static struct generic_pm_domain *pm_genpd_lookup_name(const char *domain_name)
 	return genpd;
 }
 
-#ifdef CONFIG_PM
-
 struct generic_pm_domain *dev_to_genpd(struct device *dev)
 {
 	if (IS_ERR_OR_NULL(dev->pm_domain))
@@ -282,8 +280,6 @@ int pm_genpd_name_poweron(const char *domain_name)
 	return genpd ? pm_genpd_poweron(genpd) : -EINVAL;
 }
 
-#endif /* CONFIG_PM */
-
 #ifdef CONFIG_PM_RUNTIME
 
 static int genpd_start_dev_no_timing(struct generic_pm_domain *genpd,
-- 
1.7.9.5


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

* [PATCH 10/24] PM / Domains: Remove redundant check for CONFIG_PM
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

CONFIG_PM_GENERIC_DOMAINS depends on CONFIG_PM, thus there are no need
to check explicity for it.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index a2ebc77..0362360 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -67,8 +67,6 @@ static struct generic_pm_domain *pm_genpd_lookup_name(const char *domain_name)
 	return genpd;
 }
 
-#ifdef CONFIG_PM
-
 struct generic_pm_domain *dev_to_genpd(struct device *dev)
 {
 	if (IS_ERR_OR_NULL(dev->pm_domain))
@@ -282,8 +280,6 @@ int pm_genpd_name_poweron(const char *domain_name)
 	return genpd ? pm_genpd_poweron(genpd) : -EINVAL;
 }
 
-#endif /* CONFIG_PM */
-
 #ifdef CONFIG_PM_RUNTIME
 
 static int genpd_start_dev_no_timing(struct generic_pm_domain *genpd,
-- 
1.7.9.5

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

* [PATCH 11/24] PM / Domains: Remove legacy API for adding devices through DT
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

There are no active clients of the legacy API and we now also have a
sophisticated way, where driver core deals with adding devices to genpd
while probing. So, let's remove the legacy API.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |   33 ---------------------------------
 include/linux/pm_domain.h   |   17 -----------------
 2 files changed, 50 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 0362360..3b29477 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1433,39 +1433,6 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
 }
 
 /**
- * __pm_genpd_of_add_device - Add a device to an I/O PM domain.
- * @genpd_node: Device tree node pointer representing a PM domain to which the
- *   the device is added to.
- * @dev: Device to be added.
- * @td: Set of PM QoS timing parameters to attach to the device.
- */
-int __pm_genpd_of_add_device(struct device_node *genpd_node, struct device *dev,
-			     struct gpd_timing_data *td)
-{
-	struct generic_pm_domain *genpd = NULL, *gpd;
-
-	dev_dbg(dev, "%s()\n", __func__);
-
-	if (IS_ERR_OR_NULL(genpd_node) || IS_ERR_OR_NULL(dev))
-		return -EINVAL;
-
-	mutex_lock(&gpd_list_lock);
-	list_for_each_entry(gpd, &gpd_list, gpd_list_node) {
-		if (gpd->of_node == genpd_node) {
-			genpd = gpd;
-			break;
-		}
-	}
-	mutex_unlock(&gpd_list_lock);
-
-	if (!genpd)
-		return -EINVAL;
-
-	return __pm_genpd_add_device(genpd, dev, td);
-}
-
-
-/**
  * __pm_genpd_name_add_device - Find I/O PM domain and add a device to it.
  * @domain_name: Name of the PM domain to add the device to.
  * @dev: Device to be added.
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 7aadf40..0e6205e 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -71,7 +71,6 @@ struct generic_pm_domain {
 	s64 max_off_time_ns;	/* Maximum allowed "suspended" time. */
 	bool max_off_time_changed;
 	bool cached_power_down_ok;
-	struct device_node *of_node; /* Node in device tree */
 	struct gpd_cpu_data *cpu_data;
 };
 
@@ -124,10 +123,6 @@ extern int __pm_genpd_add_device(struct generic_pm_domain *genpd,
 				 struct device *dev,
 				 struct gpd_timing_data *td);
 
-extern int __pm_genpd_of_add_device(struct device_node *genpd_node,
-				    struct device *dev,
-				    struct gpd_timing_data *td);
-
 extern int __pm_genpd_name_add_device(const char *domain_name,
 				      struct device *dev,
 				      struct gpd_timing_data *td);
@@ -170,12 +165,6 @@ static inline int __pm_genpd_add_device(struct generic_pm_domain *genpd,
 {
 	return -ENOSYS;
 }
-static inline int __pm_genpd_of_add_device(struct device_node *genpd_node,
-					   struct device *dev,
-					   struct gpd_timing_data *td)
-{
-	return -ENOSYS;
-}
 static inline int __pm_genpd_name_add_device(const char *domain_name,
 					     struct device *dev,
 					     struct gpd_timing_data *td)
@@ -245,12 +234,6 @@ static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
 	return __pm_genpd_add_device(genpd, dev, NULL);
 }
 
-static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
-					 struct device *dev)
-{
-	return __pm_genpd_of_add_device(genpd_node, dev, NULL);
-}
-
 static inline int pm_genpd_name_add_device(const char *domain_name,
 					   struct device *dev)
 {
-- 
1.7.9.5


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

* [PATCH 11/24] PM / Domains: Remove legacy API for adding devices through DT
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

There are no active clients of the legacy API and we now also have a
sophisticated way, where driver core deals with adding devices to genpd
while probing. So, let's remove the legacy API.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |   33 ---------------------------------
 include/linux/pm_domain.h   |   17 -----------------
 2 files changed, 50 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 0362360..3b29477 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1433,39 +1433,6 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
 }
 
 /**
- * __pm_genpd_of_add_device - Add a device to an I/O PM domain.
- * @genpd_node: Device tree node pointer representing a PM domain to which the
- *   the device is added to.
- * @dev: Device to be added.
- * @td: Set of PM QoS timing parameters to attach to the device.
- */
-int __pm_genpd_of_add_device(struct device_node *genpd_node, struct device *dev,
-			     struct gpd_timing_data *td)
-{
-	struct generic_pm_domain *genpd = NULL, *gpd;
-
-	dev_dbg(dev, "%s()\n", __func__);
-
-	if (IS_ERR_OR_NULL(genpd_node) || IS_ERR_OR_NULL(dev))
-		return -EINVAL;
-
-	mutex_lock(&gpd_list_lock);
-	list_for_each_entry(gpd, &gpd_list, gpd_list_node) {
-		if (gpd->of_node == genpd_node) {
-			genpd = gpd;
-			break;
-		}
-	}
-	mutex_unlock(&gpd_list_lock);
-
-	if (!genpd)
-		return -EINVAL;
-
-	return __pm_genpd_add_device(genpd, dev, td);
-}
-
-
-/**
  * __pm_genpd_name_add_device - Find I/O PM domain and add a device to it.
  * @domain_name: Name of the PM domain to add the device to.
  * @dev: Device to be added.
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 7aadf40..0e6205e 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -71,7 +71,6 @@ struct generic_pm_domain {
 	s64 max_off_time_ns;	/* Maximum allowed "suspended" time. */
 	bool max_off_time_changed;
 	bool cached_power_down_ok;
-	struct device_node *of_node; /* Node in device tree */
 	struct gpd_cpu_data *cpu_data;
 };
 
@@ -124,10 +123,6 @@ extern int __pm_genpd_add_device(struct generic_pm_domain *genpd,
 				 struct device *dev,
 				 struct gpd_timing_data *td);
 
-extern int __pm_genpd_of_add_device(struct device_node *genpd_node,
-				    struct device *dev,
-				    struct gpd_timing_data *td);
-
 extern int __pm_genpd_name_add_device(const char *domain_name,
 				      struct device *dev,
 				      struct gpd_timing_data *td);
@@ -170,12 +165,6 @@ static inline int __pm_genpd_add_device(struct generic_pm_domain *genpd,
 {
 	return -ENOSYS;
 }
-static inline int __pm_genpd_of_add_device(struct device_node *genpd_node,
-					   struct device *dev,
-					   struct gpd_timing_data *td)
-{
-	return -ENOSYS;
-}
 static inline int __pm_genpd_name_add_device(const char *domain_name,
 					     struct device *dev,
 					     struct gpd_timing_data *td)
@@ -245,12 +234,6 @@ static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
 	return __pm_genpd_add_device(genpd, dev, NULL);
 }
 
-static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
-					 struct device *dev)
-{
-	return __pm_genpd_of_add_device(genpd_node, dev, NULL);
-}
-
 static inline int pm_genpd_name_add_device(const char *domain_name,
 					   struct device *dev)
 {
-- 
1.7.9.5

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

* [PATCH 12/24] PM / Domains: Remove pm_genpd_syscore_switch() API
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

The pm_genpd_syscore_poweroff() API and pm_genpd_syscore_poweron() API
makes the pm_genpd_syscore_switch() API redundant.

Moreover, since there are no active users, let's just remove it.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |   17 ++++++++++++++---
 include/linux/pm_domain.h   |   16 ++++------------
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 3b29477..2d20766 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1293,13 +1293,13 @@ static void pm_genpd_complete(struct device *dev)
 }
 
 /**
- * pm_genpd_syscore_switch - Switch power during system core suspend or resume.
+ * genpd_syscore_switch - Switch power during system core suspend or resume.
  * @dev: Device that normally is marked as "always on" to switch power for.
  *
  * This routine may only be called during the system core (syscore) suspend or
  * resume phase for devices whose "always on" flags are set.
  */
-void pm_genpd_syscore_switch(struct device *dev, bool suspend)
+static void genpd_syscore_switch(struct device *dev, bool suspend)
 {
 	struct generic_pm_domain *genpd;
 
@@ -1315,7 +1315,18 @@ void pm_genpd_syscore_switch(struct device *dev, bool suspend)
 		genpd->suspended_count--;
 	}
 }
-EXPORT_SYMBOL_GPL(pm_genpd_syscore_switch);
+
+void pm_genpd_syscore_poweroff(struct device *dev)
+{
+	genpd_syscore_switch(dev, true);
+}
+EXPORT_SYMBOL_GPL(pm_genpd_syscore_poweroff);
+
+void pm_genpd_syscore_poweron(struct device *dev)
+{
+	genpd_syscore_switch(dev, false);
+}
+EXPORT_SYMBOL_GPL(pm_genpd_syscore_poweron);
 
 #else
 
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 0e6205e..eacf6a1 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -249,21 +249,13 @@ static inline void pm_genpd_poweroff_unused(void) {}
 #endif
 
 #ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP
-extern void pm_genpd_syscore_switch(struct device *dev, bool suspend);
+extern void pm_genpd_syscore_poweroff(struct device *dev);
+extern void pm_genpd_syscore_poweron(struct device *dev);
 #else
-static inline void pm_genpd_syscore_switch(struct device *dev, bool suspend) {}
+static inline void pm_genpd_syscore_poweroff(struct device *dev) {}
+static inline void pm_genpd_syscore_poweron(struct device *dev) {}
 #endif
 
-static inline void pm_genpd_syscore_poweroff(struct device *dev)
-{
-	pm_genpd_syscore_switch(dev, true);
-}
-
-static inline void pm_genpd_syscore_poweron(struct device *dev)
-{
-	pm_genpd_syscore_switch(dev, false);
-}
-
 /* OF power domain providers */
 struct of_device_id;
 
-- 
1.7.9.5


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

* [PATCH 12/24] PM / Domains: Remove pm_genpd_syscore_switch() API
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

The pm_genpd_syscore_poweroff() API and pm_genpd_syscore_poweron() API
makes the pm_genpd_syscore_switch() API redundant.

Moreover, since there are no active users, let's just remove it.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |   17 ++++++++++++++---
 include/linux/pm_domain.h   |   16 ++++------------
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 3b29477..2d20766 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1293,13 +1293,13 @@ static void pm_genpd_complete(struct device *dev)
 }
 
 /**
- * pm_genpd_syscore_switch - Switch power during system core suspend or resume.
+ * genpd_syscore_switch - Switch power during system core suspend or resume.
  * @dev: Device that normally is marked as "always on" to switch power for.
  *
  * This routine may only be called during the system core (syscore) suspend or
  * resume phase for devices whose "always on" flags are set.
  */
-void pm_genpd_syscore_switch(struct device *dev, bool suspend)
+static void genpd_syscore_switch(struct device *dev, bool suspend)
 {
 	struct generic_pm_domain *genpd;
 
@@ -1315,7 +1315,18 @@ void pm_genpd_syscore_switch(struct device *dev, bool suspend)
 		genpd->suspended_count--;
 	}
 }
-EXPORT_SYMBOL_GPL(pm_genpd_syscore_switch);
+
+void pm_genpd_syscore_poweroff(struct device *dev)
+{
+	genpd_syscore_switch(dev, true);
+}
+EXPORT_SYMBOL_GPL(pm_genpd_syscore_poweroff);
+
+void pm_genpd_syscore_poweron(struct device *dev)
+{
+	genpd_syscore_switch(dev, false);
+}
+EXPORT_SYMBOL_GPL(pm_genpd_syscore_poweron);
 
 #else
 
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 0e6205e..eacf6a1 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -249,21 +249,13 @@ static inline void pm_genpd_poweroff_unused(void) {}
 #endif
 
 #ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP
-extern void pm_genpd_syscore_switch(struct device *dev, bool suspend);
+extern void pm_genpd_syscore_poweroff(struct device *dev);
+extern void pm_genpd_syscore_poweron(struct device *dev);
 #else
-static inline void pm_genpd_syscore_switch(struct device *dev, bool suspend) {}
+static inline void pm_genpd_syscore_poweroff(struct device *dev) {}
+static inline void pm_genpd_syscore_poweron(struct device *dev) {}
 #endif
 
-static inline void pm_genpd_syscore_poweroff(struct device *dev)
-{
-	pm_genpd_syscore_switch(dev, true);
-}
-
-static inline void pm_genpd_syscore_poweron(struct device *dev)
-{
-	pm_genpd_syscore_switch(dev, false);
-}
-
 /* OF power domain providers */
 struct of_device_id;
 
-- 
1.7.9.5

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

* [PATCH 13/24] PM / Domains: Remove genpd_queue_power_off_work() API
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

There are no active users of this API. Let's remove it and if future
needs shows up which could consider to have a get/put API instead.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |    5 ++++-
 include/linux/pm_domain.h   |    2 --
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 2d20766..825e81d 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -423,7 +423,7 @@ static bool genpd_abort_poweroff(struct generic_pm_domain *genpd)
  * Queue up the execution of pm_genpd_poweroff() unless it's already been done
  * before.
  */
-void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
+static void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
 {
 	queue_work(pm_wq, &genpd->power_off_work);
 }
@@ -730,6 +730,9 @@ static inline int genpd_dev_pm_qos_notifier(struct notifier_block *nb,
 	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
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index eacf6a1..5cd8000 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -241,10 +241,8 @@ static inline int pm_genpd_name_add_device(const char *domain_name,
 }
 
 #ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME
-extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
 extern void pm_genpd_poweroff_unused(void);
 #else
-static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {}
 static inline void pm_genpd_poweroff_unused(void) {}
 #endif
 
-- 
1.7.9.5


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

* [PATCH 13/24] PM / Domains: Remove genpd_queue_power_off_work() API
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

There are no active users of this API. Let's remove it and if future
needs shows up which could consider to have a get/put API instead.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |    5 ++++-
 include/linux/pm_domain.h   |    2 --
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 2d20766..825e81d 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -423,7 +423,7 @@ static bool genpd_abort_poweroff(struct generic_pm_domain *genpd)
  * Queue up the execution of pm_genpd_poweroff() unless it's already been done
  * before.
  */
-void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
+static void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
 {
 	queue_work(pm_wq, &genpd->power_off_work);
 }
@@ -730,6 +730,9 @@ static inline int genpd_dev_pm_qos_notifier(struct notifier_block *nb,
 	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
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index eacf6a1..5cd8000 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -241,10 +241,8 @@ static inline int pm_genpd_name_add_device(const char *domain_name,
 }
 
 #ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME
-extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
 extern void pm_genpd_poweroff_unused(void);
 #else
-static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {}
 static inline void pm_genpd_poweroff_unused(void) {}
 #endif
 
-- 
1.7.9.5

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

* [PATCH 14/24] PM / Domains: Add late_initcall to disable unused domains
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

As default behavior let genpd at late init try to disable the unused
domains.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 825e81d..095a4fa4 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -722,6 +722,13 @@ void pm_genpd_poweroff_unused(void)
 	mutex_unlock(&gpd_list_lock);
 }
 
+static int __init genpd_poweroff_unused(void)
+{
+	pm_genpd_poweroff_unused();
+	return 0;
+}
+late_initcall(genpd_poweroff_unused);
+
 #else
 
 static inline int genpd_dev_pm_qos_notifier(struct notifier_block *nb,
-- 
1.7.9.5


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

* [PATCH 14/24] PM / Domains: Add late_initcall to disable unused domains
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

As default behavior let genpd at late init try to disable the unused
domains.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 825e81d..095a4fa4 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -722,6 +722,13 @@ void pm_genpd_poweroff_unused(void)
 	mutex_unlock(&gpd_list_lock);
 }
 
+static int __init genpd_poweroff_unused(void)
+{
+	pm_genpd_poweroff_unused();
+	return 0;
+}
+late_initcall(genpd_poweroff_unused);
+
 #else
 
 static inline int genpd_dev_pm_qos_notifier(struct notifier_block *nb,
-- 
1.7.9.5

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

* [PATCH 15/24] ARM: exynos: Leave disabling of unused pm domains to genpd
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

Since genpd at late init, will try to disable unused domains we don't
need to handle it from here as well.

Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/mach-exynos/exynos.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index bc43e22..82ab996 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -193,7 +193,6 @@ void __init exynos_init_late(void)
 		/* to be supported later */
 		return;
 
-	pm_genpd_poweroff_unused();
 	exynos_pm_init();
 }
 
-- 
1.7.9.5


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

* [PATCH 15/24] ARM: exynos: Leave disabling of unused pm domains to genpd
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

Since genpd at late init, will try to disable unused domains we don't
need to handle it from here as well.

Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/mach-exynos/exynos.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index bc43e22..82ab996 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -193,7 +193,6 @@ void __init exynos_init_late(void)
 		/* to be supported later */
 		return;
 
-	pm_genpd_poweroff_unused();
 	exynos_pm_init();
 }
 
-- 
1.7.9.5

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

* [PATCH 16/24] ARM: s3c64xx: Leave disabling of unused pm domains to genpd
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

Since genpd at late init, will try to disable unused domains we don't
need to handle it from machine specific code as well.

Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/mach-s3c64xx/common.c        |    5 -----
 arch/arm/mach-s3c64xx/common.h        |    7 -------
 arch/arm/mach-s3c64xx/mach-anw6410.c  |    1 -
 arch/arm/mach-s3c64xx/mach-crag6410.c |    1 -
 arch/arm/mach-s3c64xx/mach-hmt.c      |    1 -
 arch/arm/mach-s3c64xx/mach-mini6410.c |    1 -
 arch/arm/mach-s3c64xx/mach-ncp.c      |    1 -
 arch/arm/mach-s3c64xx/mach-real6410.c |    1 -
 arch/arm/mach-s3c64xx/mach-smartq5.c  |    1 -
 arch/arm/mach-s3c64xx/mach-smartq7.c  |    1 -
 arch/arm/mach-s3c64xx/mach-smdk6400.c |    1 -
 arch/arm/mach-s3c64xx/mach-smdk6410.c |    1 -
 arch/arm/mach-s3c64xx/pm.c            |    7 -------
 13 files changed, 29 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
index 5c45aae..16547f2 100644
--- a/arch/arm/mach-s3c64xx/common.c
+++ b/arch/arm/mach-s3c64xx/common.c
@@ -440,8 +440,3 @@ void s3c64xx_restart(enum reboot_mode mode, const char *cmd)
 	/* if all else fails, or mode was for soft, jump to 0 */
 	soft_restart(0);
 }
-
-void __init s3c64xx_init_late(void)
-{
-	s3c64xx_pm_late_initcall();
-}
diff --git a/arch/arm/mach-s3c64xx/common.h b/arch/arm/mach-s3c64xx/common.h
index 7043e7a..9eb8644 100644
--- a/arch/arm/mach-s3c64xx/common.h
+++ b/arch/arm/mach-s3c64xx/common.h
@@ -23,7 +23,6 @@ void s3c64xx_init_irq(u32 vic0, u32 vic1);
 void s3c64xx_init_io(struct map_desc *mach_desc, int size);
 
 void s3c64xx_restart(enum reboot_mode mode, const char *cmd);
-void s3c64xx_init_late(void);
 
 void s3c64xx_clk_init(struct device_node *np, unsigned long xtal_f,
 	unsigned long xusbxti_f, bool is_s3c6400, void __iomem *reg_base);
@@ -52,12 +51,6 @@ extern void s3c6410_map_io(void);
 #define s3c6410_init NULL
 #endif
 
-#ifdef CONFIG_PM
-int __init s3c64xx_pm_late_initcall(void);
-#else
-static inline int s3c64xx_pm_late_initcall(void) { return 0; }
-#endif
-
 #ifdef CONFIG_S3C64XX_PL080
 extern struct pl08x_platform_data s3c64xx_dma0_plat_data;
 extern struct pl08x_platform_data s3c64xx_dma1_plat_data;
diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
index 55eb6a6..7889d2a 100644
--- a/arch/arm/mach-s3c64xx/mach-anw6410.c
+++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
@@ -234,7 +234,6 @@ MACHINE_START(ANW6410, "A&W6410")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= anw6410_map_io,
 	.init_machine	= anw6410_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index 4b0199f..5db6d01 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -858,7 +858,6 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= crag6410_map_io,
 	.init_machine	= crag6410_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index 72cee08..cb081b9 100644
--- a/arch/arm/mach-s3c64xx/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.c
@@ -278,7 +278,6 @@ MACHINE_START(HMT, "Airgoo-HMT")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= hmt_map_io,
 	.init_machine	= hmt_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index 9cbc076..ab61af5 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -366,7 +366,6 @@ MACHINE_START(MINI6410, "MINI6410")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= mini6410_map_io,
 	.init_machine	= mini6410_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
index 67f06a9..2d540a2 100644
--- a/arch/arm/mach-s3c64xx/mach-ncp.c
+++ b/arch/arm/mach-s3c64xx/mach-ncp.c
@@ -104,7 +104,6 @@ MACHINE_START(NCP, "NCP")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= ncp_map_io,
 	.init_machine	= ncp_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index fbad2af..85fa959 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -335,7 +335,6 @@ MACHINE_START(REAL6410, "REAL6410")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= real6410_map_io,
 	.init_machine	= real6410_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
index dec4c08..33224ab 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq5.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -156,7 +156,6 @@ MACHINE_START(SMARTQ5, "SmartQ 5")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= smartq_map_io,
 	.init_machine	= smartq5_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
index 27b3220..fc7fece 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq7.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
@@ -172,7 +172,6 @@ MACHINE_START(SMARTQ7, "SmartQ 7")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= smartq_map_io,
 	.init_machine	= smartq7_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
index c85d1cb..86a660d 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
@@ -93,7 +93,6 @@ MACHINE_START(SMDK6400, "SMDK6400")
 	.init_irq	= s3c6400_init_irq,
 	.map_io		= smdk6400_map_io,
 	.init_machine	= smdk6400_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index c6a8b2a..48f171a 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -706,7 +706,6 @@ MACHINE_START(SMDK6410, "SMDK6410")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= smdk6410_map_io,
 	.init_machine	= smdk6410_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index 6b37694..aaf7bea 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -347,10 +347,3 @@ static __init int s3c64xx_pm_initcall(void)
 	return 0;
 }
 arch_initcall(s3c64xx_pm_initcall);
-
-int __init s3c64xx_pm_late_initcall(void)
-{
-	pm_genpd_poweroff_unused();
-
-	return 0;
-}
-- 
1.7.9.5


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

* [PATCH 16/24] ARM: s3c64xx: Leave disabling of unused pm domains to genpd
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

Since genpd at late init, will try to disable unused domains we don't
need to handle it from machine specific code as well.

Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/mach-s3c64xx/common.c        |    5 -----
 arch/arm/mach-s3c64xx/common.h        |    7 -------
 arch/arm/mach-s3c64xx/mach-anw6410.c  |    1 -
 arch/arm/mach-s3c64xx/mach-crag6410.c |    1 -
 arch/arm/mach-s3c64xx/mach-hmt.c      |    1 -
 arch/arm/mach-s3c64xx/mach-mini6410.c |    1 -
 arch/arm/mach-s3c64xx/mach-ncp.c      |    1 -
 arch/arm/mach-s3c64xx/mach-real6410.c |    1 -
 arch/arm/mach-s3c64xx/mach-smartq5.c  |    1 -
 arch/arm/mach-s3c64xx/mach-smartq7.c  |    1 -
 arch/arm/mach-s3c64xx/mach-smdk6400.c |    1 -
 arch/arm/mach-s3c64xx/mach-smdk6410.c |    1 -
 arch/arm/mach-s3c64xx/pm.c            |    7 -------
 13 files changed, 29 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
index 5c45aae..16547f2 100644
--- a/arch/arm/mach-s3c64xx/common.c
+++ b/arch/arm/mach-s3c64xx/common.c
@@ -440,8 +440,3 @@ void s3c64xx_restart(enum reboot_mode mode, const char *cmd)
 	/* if all else fails, or mode was for soft, jump to 0 */
 	soft_restart(0);
 }
-
-void __init s3c64xx_init_late(void)
-{
-	s3c64xx_pm_late_initcall();
-}
diff --git a/arch/arm/mach-s3c64xx/common.h b/arch/arm/mach-s3c64xx/common.h
index 7043e7a..9eb8644 100644
--- a/arch/arm/mach-s3c64xx/common.h
+++ b/arch/arm/mach-s3c64xx/common.h
@@ -23,7 +23,6 @@ void s3c64xx_init_irq(u32 vic0, u32 vic1);
 void s3c64xx_init_io(struct map_desc *mach_desc, int size);
 
 void s3c64xx_restart(enum reboot_mode mode, const char *cmd);
-void s3c64xx_init_late(void);
 
 void s3c64xx_clk_init(struct device_node *np, unsigned long xtal_f,
 	unsigned long xusbxti_f, bool is_s3c6400, void __iomem *reg_base);
@@ -52,12 +51,6 @@ extern void s3c6410_map_io(void);
 #define s3c6410_init NULL
 #endif
 
-#ifdef CONFIG_PM
-int __init s3c64xx_pm_late_initcall(void);
-#else
-static inline int s3c64xx_pm_late_initcall(void) { return 0; }
-#endif
-
 #ifdef CONFIG_S3C64XX_PL080
 extern struct pl08x_platform_data s3c64xx_dma0_plat_data;
 extern struct pl08x_platform_data s3c64xx_dma1_plat_data;
diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
index 55eb6a6..7889d2a 100644
--- a/arch/arm/mach-s3c64xx/mach-anw6410.c
+++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
@@ -234,7 +234,6 @@ MACHINE_START(ANW6410, "A&W6410")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= anw6410_map_io,
 	.init_machine	= anw6410_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index 4b0199f..5db6d01 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -858,7 +858,6 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= crag6410_map_io,
 	.init_machine	= crag6410_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index 72cee08..cb081b9 100644
--- a/arch/arm/mach-s3c64xx/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.c
@@ -278,7 +278,6 @@ MACHINE_START(HMT, "Airgoo-HMT")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= hmt_map_io,
 	.init_machine	= hmt_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index 9cbc076..ab61af5 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -366,7 +366,6 @@ MACHINE_START(MINI6410, "MINI6410")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= mini6410_map_io,
 	.init_machine	= mini6410_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
index 67f06a9..2d540a2 100644
--- a/arch/arm/mach-s3c64xx/mach-ncp.c
+++ b/arch/arm/mach-s3c64xx/mach-ncp.c
@@ -104,7 +104,6 @@ MACHINE_START(NCP, "NCP")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= ncp_map_io,
 	.init_machine	= ncp_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index fbad2af..85fa959 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -335,7 +335,6 @@ MACHINE_START(REAL6410, "REAL6410")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= real6410_map_io,
 	.init_machine	= real6410_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
index dec4c08..33224ab 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq5.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -156,7 +156,6 @@ MACHINE_START(SMARTQ5, "SmartQ 5")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= smartq_map_io,
 	.init_machine	= smartq5_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
index 27b3220..fc7fece 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq7.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
@@ -172,7 +172,6 @@ MACHINE_START(SMARTQ7, "SmartQ 7")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= smartq_map_io,
 	.init_machine	= smartq7_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
index c85d1cb..86a660d 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
@@ -93,7 +93,6 @@ MACHINE_START(SMDK6400, "SMDK6400")
 	.init_irq	= s3c6400_init_irq,
 	.map_io		= smdk6400_map_io,
 	.init_machine	= smdk6400_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index c6a8b2a..48f171a 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -706,7 +706,6 @@ MACHINE_START(SMDK6410, "SMDK6410")
 	.init_irq	= s3c6410_init_irq,
 	.map_io		= smdk6410_map_io,
 	.init_machine	= smdk6410_machine_init,
-	.init_late	= s3c64xx_init_late,
 	.init_time	= samsung_timer_init,
 	.restart	= s3c64xx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index 6b37694..aaf7bea 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -347,10 +347,3 @@ static __init int s3c64xx_pm_initcall(void)
 	return 0;
 }
 arch_initcall(s3c64xx_pm_initcall);
-
-int __init s3c64xx_pm_late_initcall(void)
-{
-	pm_genpd_poweroff_unused();
-
-	return 0;
-}
-- 
1.7.9.5

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

* [PATCH 17/24] drivers: sh: Leave disabling of unused pm domains to genpd
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51     ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek,
	linux-pm-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Kevin Hilman,
	Alan Stern, Greg Kroah-Hartman, Daniel Lezcano, Tomasz Figa,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Linus Walleij, Simon Horman,
	Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd, Philipp Zabel,
	Mark Brown, Ulf Hansson

Since genpd at late init, will try to disable unused domains we don't
need to handle it from here as well.

Cc: Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
Cc: Magnus Damm <magnus.damm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 drivers/sh/pm_runtime.c |   11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c
index 10c65eb..ea8b081 100644
--- a/drivers/sh/pm_runtime.c
+++ b/drivers/sh/pm_runtime.c
@@ -50,8 +50,6 @@ static struct pm_clk_notifier_block platform_bus_notifier = {
 	.con_ids = { NULL, },
 };
 
-static bool default_pm_on;
-
 static int __init sh_pm_runtime_init(void)
 {
 	if (IS_ENABLED(CONFIG_ARCH_SHMOBILE_MULTI)) {
@@ -68,16 +66,7 @@ static int __init sh_pm_runtime_init(void)
 			return 0;
 	}
 
-	default_pm_on = true;
 	pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
 	return 0;
 }
 core_initcall(sh_pm_runtime_init);
-
-static int __init sh_pm_runtime_late_init(void)
-{
-	if (default_pm_on)
-		pm_genpd_poweroff_unused();
-	return 0;
-}
-late_initcall(sh_pm_runtime_late_init);
-- 
1.7.9.5

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

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

* [PATCH 17/24] drivers: sh: Leave disabling of unused pm domains to genpd
@ 2014-06-10 10:51     ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

Since genpd at late init, will try to disable unused domains we don't
need to handle it from here as well.

Cc: Simon Horman <horms@verge.net.au>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/sh/pm_runtime.c |   11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c
index 10c65eb..ea8b081 100644
--- a/drivers/sh/pm_runtime.c
+++ b/drivers/sh/pm_runtime.c
@@ -50,8 +50,6 @@ static struct pm_clk_notifier_block platform_bus_notifier = {
 	.con_ids = { NULL, },
 };
 
-static bool default_pm_on;
-
 static int __init sh_pm_runtime_init(void)
 {
 	if (IS_ENABLED(CONFIG_ARCH_SHMOBILE_MULTI)) {
@@ -68,16 +66,7 @@ static int __init sh_pm_runtime_init(void)
 			return 0;
 	}
 
-	default_pm_on = true;
 	pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
 	return 0;
 }
 core_initcall(sh_pm_runtime_init);
-
-static int __init sh_pm_runtime_late_init(void)
-{
-	if (default_pm_on)
-		pm_genpd_poweroff_unused();
-	return 0;
-}
-late_initcall(sh_pm_runtime_late_init);
-- 
1.7.9.5

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

* [PATCH 18/24] PM / Domains: Remove default_stop_ok() API
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

There are currently no need to export default_stop_ok() as an API,
instead let's keep it local to the domain governor.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain_governor.c |    7 ++-----
 include/linux/pm_domain.h            |    9 +--------
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/base/power/domain_governor.c b/drivers/base/power/domain_governor.c
index a089e3b..d88a62e 100644
--- a/drivers/base/power/domain_governor.c
+++ b/drivers/base/power/domain_governor.c
@@ -42,7 +42,7 @@ static int dev_update_qos_constraint(struct device *dev, void *data)
  * default_stop_ok - Default PM domain governor routine for stopping devices.
  * @dev: Device to check.
  */
-bool default_stop_ok(struct device *dev)
+static bool default_stop_ok(struct device *dev)
 {
 	struct gpd_timing_data *td = &dev_gpd_data(dev)->td;
 	unsigned long flags;
@@ -229,10 +229,7 @@ static bool always_on_power_down_ok(struct dev_pm_domain *domain)
 
 #else /* !CONFIG_PM_RUNTIME */
 
-bool default_stop_ok(struct device *dev)
-{
-	return false;
-}
+static inline bool default_stop_ok(struct device *dev) { return false; }
 
 #define default_power_down_ok	NULL
 #define always_on_power_down_ok	NULL
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 5cd8000..e94d8ae 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -116,8 +116,6 @@ static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev)
 	return to_gpd_data(dev->power.subsys_data->domain_data);
 }
 
-extern struct dev_power_governor simple_qos_governor;
-
 extern struct generic_pm_domain *dev_to_genpd(struct device *dev);
 extern int __pm_genpd_add_device(struct generic_pm_domain *genpd,
 				 struct device *dev,
@@ -146,8 +144,7 @@ extern void pm_genpd_init(struct generic_pm_domain *genpd,
 extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
 extern int pm_genpd_name_poweron(const char *domain_name);
 
-extern bool default_stop_ok(struct device *dev);
-
+extern struct dev_power_governor simple_qos_governor;
 extern struct dev_power_governor pm_domain_always_on_gov;
 #else
 
@@ -220,10 +217,6 @@ static inline int pm_genpd_name_poweron(const char *domain_name)
 {
 	return -ENOSYS;
 }
-static inline bool default_stop_ok(struct device *dev)
-{
-	return false;
-}
 #define simple_qos_governor NULL
 #define pm_domain_always_on_gov NULL
 #endif
-- 
1.7.9.5


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

* [PATCH 18/24] PM / Domains: Remove default_stop_ok() API
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

There are currently no need to export default_stop_ok() as an API,
instead let's keep it local to the domain governor.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain_governor.c |    7 ++-----
 include/linux/pm_domain.h            |    9 +--------
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/base/power/domain_governor.c b/drivers/base/power/domain_governor.c
index a089e3b..d88a62e 100644
--- a/drivers/base/power/domain_governor.c
+++ b/drivers/base/power/domain_governor.c
@@ -42,7 +42,7 @@ static int dev_update_qos_constraint(struct device *dev, void *data)
  * default_stop_ok - Default PM domain governor routine for stopping devices.
  * @dev: Device to check.
  */
-bool default_stop_ok(struct device *dev)
+static bool default_stop_ok(struct device *dev)
 {
 	struct gpd_timing_data *td = &dev_gpd_data(dev)->td;
 	unsigned long flags;
@@ -229,10 +229,7 @@ static bool always_on_power_down_ok(struct dev_pm_domain *domain)
 
 #else /* !CONFIG_PM_RUNTIME */
 
-bool default_stop_ok(struct device *dev)
-{
-	return false;
-}
+static inline bool default_stop_ok(struct device *dev) { return false; }
 
 #define default_power_down_ok	NULL
 #define always_on_power_down_ok	NULL
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 5cd8000..e94d8ae 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -116,8 +116,6 @@ static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev)
 	return to_gpd_data(dev->power.subsys_data->domain_data);
 }
 
-extern struct dev_power_governor simple_qos_governor;
-
 extern struct generic_pm_domain *dev_to_genpd(struct device *dev);
 extern int __pm_genpd_add_device(struct generic_pm_domain *genpd,
 				 struct device *dev,
@@ -146,8 +144,7 @@ extern void pm_genpd_init(struct generic_pm_domain *genpd,
 extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
 extern int pm_genpd_name_poweron(const char *domain_name);
 
-extern bool default_stop_ok(struct device *dev);
-
+extern struct dev_power_governor simple_qos_governor;
 extern struct dev_power_governor pm_domain_always_on_gov;
 #else
 
@@ -220,10 +217,6 @@ static inline int pm_genpd_name_poweron(const char *domain_name)
 {
 	return -ENOSYS;
 }
-static inline bool default_stop_ok(struct device *dev)
-{
-	return false;
-}
 #define simple_qos_governor NULL
 #define pm_domain_always_on_gov NULL
 #endif
-- 
1.7.9.5

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

* [PATCH 19/24] dt: bindings: ux500: Add documentation for power domains
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: devicetree@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 .../devicetree/bindings/arm/ux500/power_domain.txt |   35 ++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/ux500/power_domain.txt

diff --git a/Documentation/devicetree/bindings/arm/ux500/power_domain.txt b/Documentation/devicetree/bindings/arm/ux500/power_domain.txt
new file mode 100644
index 0000000..1c98f01
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/ux500/power_domain.txt
@@ -0,0 +1,35 @@
+* ST-Ericsson UX500 Power Domains
+
+UX500 supports multiple power domains which are used to gate power to one or
+more peripherals on the SOC.
+
+The implementation of power domains for UX500 are based upon the generic power
+domain and use the corresponding DT bindings.
+
+==Power domain providers==
+
+Required properties:
+ - compatible: Must be "stericsson,ux500-pm-domains".
+ - #power-domain-cells : Number of cells in a power domain specifier, must be 1.
+
+Example:
+	pm_domains: pm_domains0 {
+		compatible = "stericsson,ux500-pm-domains";
+		#power-domain-cells = <1>;
+	};
+
+==Power domain consumers==
+
+Required properties:
+ - power-domains: A phandle and power domain specifier. Below are the list of
+		valid specifiers:
+
+		Index	Specifier
+		-----	---------
+		0	DOMAIN_VAPE
+
+Example:
+	sdi0_per1@80126000 {
+		compatible = "arm,pl18x", "arm,primecell";
+		power-domains = <&pm_domains DOMAIN_VAPE>
+	};
-- 
1.7.9.5


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

* [PATCH 19/24] dt: bindings: ux500: Add documentation for power domains
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: devicetree at vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 .../devicetree/bindings/arm/ux500/power_domain.txt |   35 ++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/ux500/power_domain.txt

diff --git a/Documentation/devicetree/bindings/arm/ux500/power_domain.txt b/Documentation/devicetree/bindings/arm/ux500/power_domain.txt
new file mode 100644
index 0000000..1c98f01
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/ux500/power_domain.txt
@@ -0,0 +1,35 @@
+* ST-Ericsson UX500 Power Domains
+
+UX500 supports multiple power domains which are used to gate power to one or
+more peripherals on the SOC.
+
+The implementation of power domains for UX500 are based upon the generic power
+domain and use the corresponding DT bindings.
+
+==Power domain providers==
+
+Required properties:
+ - compatible: Must be "stericsson,ux500-pm-domains".
+ - #power-domain-cells : Number of cells in a power domain specifier, must be 1.
+
+Example:
+	pm_domains: pm_domains0 {
+		compatible = "stericsson,ux500-pm-domains";
+		#power-domain-cells = <1>;
+	};
+
+==Power domain consumers==
+
+Required properties:
+ - power-domains: A phandle and power domain specifier. Below are the list of
+		valid specifiers:
+
+		Index	Specifier
+		-----	---------
+		0	DOMAIN_VAPE
+
+Example:
+	sdi0_per1 at 80126000 {
+		compatible = "arm,pl18x", "arm,primecell";
+		power-domains = <&pm_domains DOMAIN_VAPE>
+	};
-- 
1.7.9.5

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

* [PATCH 20/24] dt: bindings: ux500: Add header for power domains specifiers
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: devicetree@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 include/dt-bindings/arm/ux500_pm_domains.h |   15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 include/dt-bindings/arm/ux500_pm_domains.h

diff --git a/include/dt-bindings/arm/ux500_pm_domains.h b/include/dt-bindings/arm/ux500_pm_domains.h
new file mode 100644
index 0000000..73cf25a
--- /dev/null
+++ b/include/dt-bindings/arm/ux500_pm_domains.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright (C) 2014 Linaro Ltd.
+ *
+ * Author: Ulf Hansson <ulf.hansson@linaro.org>
+ * License terms: GNU General Public License (GPL) version 2
+ */
+#ifndef _DT_BINDINGS_ARM_UX500_PM_DOMAINS_H
+#define _DT_BINDINGS_ARM_UX500_PM_DOMAINS_H
+
+#define DOMAIN_VAPE		0
+
+/* Number of power domains. */
+#define NR_DOMAINS		(DOMAIN_VAPE + 1)
+
+#endif
-- 
1.7.9.5


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

* [PATCH 20/24] dt: bindings: ux500: Add header for power domains specifiers
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: devicetree at vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 include/dt-bindings/arm/ux500_pm_domains.h |   15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 include/dt-bindings/arm/ux500_pm_domains.h

diff --git a/include/dt-bindings/arm/ux500_pm_domains.h b/include/dt-bindings/arm/ux500_pm_domains.h
new file mode 100644
index 0000000..73cf25a
--- /dev/null
+++ b/include/dt-bindings/arm/ux500_pm_domains.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright (C) 2014 Linaro Ltd.
+ *
+ * Author: Ulf Hansson <ulf.hansson@linaro.org>
+ * License terms: GNU General Public License (GPL) version 2
+ */
+#ifndef _DT_BINDINGS_ARM_UX500_PM_DOMAINS_H
+#define _DT_BINDINGS_ARM_UX500_PM_DOMAINS_H
+
+#define DOMAIN_VAPE		0
+
+/* Number of power domains. */
+#define NR_DOMAINS		(DOMAIN_VAPE + 1)
+
+#endif
-- 
1.7.9.5

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

* [PATCH 21/24] ARM: ux500: Initial support for power domains
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51     ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek,
	linux-pm-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Kevin Hilman,
	Alan Stern, Greg Kroah-Hartman, Daniel Lezcano, Tomasz Figa,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Linus Walleij, Simon Horman,
	Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd, Philipp Zabel,
	Mark Brown, Ulf Hansson

The ux500 SoC uses the generic power domain and requires the domains to
be specified through DT.

Currently the callbacks for handling power gating are empty functions
which shall be implemented once each device are handled properly from a
runtime PM perspective.

Cc: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Tomasz Figa <tomasz.figa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 arch/arm/mach-ux500/Makefile     |    1 +
 arch/arm/mach-ux500/pm.c         |    4 ++
 arch/arm/mach-ux500/pm_domains.c |   77 ++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-ux500/pm_domains.h |   17 +++++++++
 4 files changed, 99 insertions(+)
 create mode 100644 arch/arm/mach-ux500/pm_domains.c
 create mode 100644 arch/arm/mach-ux500/pm_domains.h

diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index 9741de95..4418a50 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -9,5 +9,6 @@ obj-$(CONFIG_MACH_MOP500)	+= board-mop500-regulators.o \
 				board-mop500-audio.o
 obj-$(CONFIG_SMP)		+= platsmp.o headsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)	+= hotplug.o
+obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
 
 CFLAGS_hotplug.o		+= -march=armv7-a
diff --git a/arch/arm/mach-ux500/pm.c b/arch/arm/mach-ux500/pm.c
index b80a9a2..2cb587b 100644
--- a/arch/arm/mach-ux500/pm.c
+++ b/arch/arm/mach-ux500/pm.c
@@ -17,6 +17,7 @@
 #include <linux/platform_data/arm-ux500-pm.h>
 
 #include "db8500-regs.h"
+#include "pm_domains.h"
 
 /* ARM WFI Standby signal register */
 #define PRCM_ARM_WFI_STANDBY    (prcmu_base + 0x130)
@@ -191,4 +192,7 @@ void __init ux500_pm_init(u32 phy_base, u32 size)
 
 	/* Set up ux500 suspend callbacks. */
 	suspend_set_ops(UX500_SUSPEND_OPS);
+
+	/* Initialize ux500 power domains */
+	ux500_pm_domains_init();
 }
diff --git a/arch/arm/mach-ux500/pm_domains.c b/arch/arm/mach-ux500/pm_domains.c
new file mode 100644
index 0000000..dbc115b
--- /dev/null
+++ b/arch/arm/mach-ux500/pm_domains.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2014 Linaro Ltd.
+ *
+ * Author: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
+ * License terms: GNU General Public License (GPL) version 2
+ *
+ * Implements power domains as generic power domains for ux500.
+ */
+#include <linux/printk.h>
+#include <linux/slab.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/pm_domain.h>
+
+#include <dt-bindings/arm/ux500_pm_domains.h>
+#include "pm_domains.h"
+
+static int pd_power_off(struct generic_pm_domain *domain)
+{
+	/*
+	 * Handle the gating of the power domain regulator here.
+	 * Drivers/subsystems operating the devices in the power domain needs
+	 * to handle register context save/restore to be able to enable power
+	 * domain gating/ungating.
+	 */
+	return 0;
+}
+
+static int pd_power_on(struct generic_pm_domain *domain)
+{
+	/*
+	 * Handle the ungating of the power domain regulator here.
+	 * Drivers/subsystems operating the devices in the power domain needs
+	 * to handle register context save/restore to be able to enable power
+	 * domain gating/ungating.
+	 */
+	return 0;
+}
+
+static struct generic_pm_domain ux500_pm_domain_vape = {
+	.name = "VAPE",
+	.power_off = pd_power_off,
+	.power_on = pd_power_on,
+};
+
+static struct generic_pm_domain *ux500_pm_domains[NR_DOMAINS] = {
+	[DOMAIN_VAPE] = &ux500_pm_domain_vape,
+};
+
+static struct of_device_id ux500_pm_domain_matches[] = {
+	{ .compatible = "stericsson,ux500-pm-domains", },
+	{ },
+};
+
+int __init ux500_pm_domains_init(void)
+{
+	struct device_node *np;
+	struct genpd_onecell_data *genpd_data;
+	int i;
+
+	np = of_find_matching_node(NULL, ux500_pm_domain_matches);
+	if (!np)
+		return -ENODEV;
+
+	genpd_data = kzalloc(sizeof(*genpd_data), GFP_KERNEL);
+	if (!genpd_data)
+		return -ENOMEM;
+
+	genpd_data->domain_num = ARRAY_SIZE(ux500_pm_domains);
+	genpd_data->domains = ux500_pm_domains;
+
+	for (i = 0; i < ARRAY_SIZE(ux500_pm_domains); ++i)
+		pm_genpd_init(ux500_pm_domains[i], NULL, false);
+
+	of_genpd_add_provider(np, of_genpd_xlate_onecell, genpd_data);
+	return 0;
+}
diff --git a/arch/arm/mach-ux500/pm_domains.h b/arch/arm/mach-ux500/pm_domains.h
new file mode 100644
index 0000000..263d3ba
--- /dev/null
+++ b/arch/arm/mach-ux500/pm_domains.h
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2014 Linaro Ltd.
+ *
+ * Author: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
+ * License terms: GNU General Public License (GPL) version 2
+ */
+
+#ifndef __MACH_UX500_PM_DOMAINS_H
+#define __MACH_UX500_PM_DOMAINS_H
+
+#ifdef CONFIG_PM_GENERIC_DOMAINS
+extern int __init ux500_pm_domains_init(void);
+#else
+static inline int ux500_pm_domains_init(void) { return 0; }
+#endif
+
+#endif
-- 
1.7.9.5

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

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

* [PATCH 21/24] ARM: ux500: Initial support for power domains
@ 2014-06-10 10:51     ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

The ux500 SoC uses the generic power domain and requires the domains to
be specified through DT.

Currently the callbacks for handling power gating are empty functions
which shall be implemented once each device are handled properly from a
runtime PM perspective.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: devicetree at vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/mach-ux500/Makefile     |    1 +
 arch/arm/mach-ux500/pm.c         |    4 ++
 arch/arm/mach-ux500/pm_domains.c |   77 ++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-ux500/pm_domains.h |   17 +++++++++
 4 files changed, 99 insertions(+)
 create mode 100644 arch/arm/mach-ux500/pm_domains.c
 create mode 100644 arch/arm/mach-ux500/pm_domains.h

diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index 9741de95..4418a50 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -9,5 +9,6 @@ obj-$(CONFIG_MACH_MOP500)	+= board-mop500-regulators.o \
 				board-mop500-audio.o
 obj-$(CONFIG_SMP)		+= platsmp.o headsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)	+= hotplug.o
+obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
 
 CFLAGS_hotplug.o		+= -march=armv7-a
diff --git a/arch/arm/mach-ux500/pm.c b/arch/arm/mach-ux500/pm.c
index b80a9a2..2cb587b 100644
--- a/arch/arm/mach-ux500/pm.c
+++ b/arch/arm/mach-ux500/pm.c
@@ -17,6 +17,7 @@
 #include <linux/platform_data/arm-ux500-pm.h>
 
 #include "db8500-regs.h"
+#include "pm_domains.h"
 
 /* ARM WFI Standby signal register */
 #define PRCM_ARM_WFI_STANDBY    (prcmu_base + 0x130)
@@ -191,4 +192,7 @@ void __init ux500_pm_init(u32 phy_base, u32 size)
 
 	/* Set up ux500 suspend callbacks. */
 	suspend_set_ops(UX500_SUSPEND_OPS);
+
+	/* Initialize ux500 power domains */
+	ux500_pm_domains_init();
 }
diff --git a/arch/arm/mach-ux500/pm_domains.c b/arch/arm/mach-ux500/pm_domains.c
new file mode 100644
index 0000000..dbc115b
--- /dev/null
+++ b/arch/arm/mach-ux500/pm_domains.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2014 Linaro Ltd.
+ *
+ * Author: Ulf Hansson <ulf.hansson@linaro.org>
+ * License terms: GNU General Public License (GPL) version 2
+ *
+ * Implements power domains as generic power domains for ux500.
+ */
+#include <linux/printk.h>
+#include <linux/slab.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/pm_domain.h>
+
+#include <dt-bindings/arm/ux500_pm_domains.h>
+#include "pm_domains.h"
+
+static int pd_power_off(struct generic_pm_domain *domain)
+{
+	/*
+	 * Handle the gating of the power domain regulator here.
+	 * Drivers/subsystems operating the devices in the power domain needs
+	 * to handle register context save/restore to be able to enable power
+	 * domain gating/ungating.
+	 */
+	return 0;
+}
+
+static int pd_power_on(struct generic_pm_domain *domain)
+{
+	/*
+	 * Handle the ungating of the power domain regulator here.
+	 * Drivers/subsystems operating the devices in the power domain needs
+	 * to handle register context save/restore to be able to enable power
+	 * domain gating/ungating.
+	 */
+	return 0;
+}
+
+static struct generic_pm_domain ux500_pm_domain_vape = {
+	.name = "VAPE",
+	.power_off = pd_power_off,
+	.power_on = pd_power_on,
+};
+
+static struct generic_pm_domain *ux500_pm_domains[NR_DOMAINS] = {
+	[DOMAIN_VAPE] = &ux500_pm_domain_vape,
+};
+
+static struct of_device_id ux500_pm_domain_matches[] = {
+	{ .compatible = "stericsson,ux500-pm-domains", },
+	{ },
+};
+
+int __init ux500_pm_domains_init(void)
+{
+	struct device_node *np;
+	struct genpd_onecell_data *genpd_data;
+	int i;
+
+	np = of_find_matching_node(NULL, ux500_pm_domain_matches);
+	if (!np)
+		return -ENODEV;
+
+	genpd_data = kzalloc(sizeof(*genpd_data), GFP_KERNEL);
+	if (!genpd_data)
+		return -ENOMEM;
+
+	genpd_data->domain_num = ARRAY_SIZE(ux500_pm_domains);
+	genpd_data->domains = ux500_pm_domains;
+
+	for (i = 0; i < ARRAY_SIZE(ux500_pm_domains); ++i)
+		pm_genpd_init(ux500_pm_domains[i], NULL, false);
+
+	of_genpd_add_provider(np, of_genpd_xlate_onecell, genpd_data);
+	return 0;
+}
diff --git a/arch/arm/mach-ux500/pm_domains.h b/arch/arm/mach-ux500/pm_domains.h
new file mode 100644
index 0000000..263d3ba
--- /dev/null
+++ b/arch/arm/mach-ux500/pm_domains.h
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2014 Linaro Ltd.
+ *
+ * Author: Ulf Hansson <ulf.hansson@linaro.org>
+ * License terms: GNU General Public License (GPL) version 2
+ */
+
+#ifndef __MACH_UX500_PM_DOMAINS_H
+#define __MACH_UX500_PM_DOMAINS_H
+
+#ifdef CONFIG_PM_GENERIC_DOMAINS
+extern int __init ux500_pm_domains_init(void);
+#else
+static inline int ux500_pm_domains_init(void) { return 0; }
+#endif
+
+#endif
-- 
1.7.9.5

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

* [PATCH 22/24] ARM: ux500: Enable Kconfig for the generic power domain
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

Since ux500 uses genpd, this will enable the power domain support.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: devicetree@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/mach-ux500/Kconfig |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index b41a42d..aaf8cfd 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -33,6 +33,7 @@ config UX500_SOC_DB8500
 	select PINCTRL_AB8540
 	select REGULATOR
 	select REGULATOR_DB8500_PRCMU
+	select PM_GENERIC_DOMAINS if PM
 
 menu "Ux500 target platform (boards)"
 
-- 
1.7.9.5


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

* [PATCH 22/24] ARM: ux500: Enable Kconfig for the generic power domain
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

Since ux500 uses genpd, this will enable the power domain support.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: devicetree at vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/mach-ux500/Kconfig |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index b41a42d..aaf8cfd 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -33,6 +33,7 @@ config UX500_SOC_DB8500
 	select PINCTRL_AB8540
 	select REGULATOR
 	select REGULATOR_DB8500_PRCMU
+	select PM_GENERIC_DOMAINS if PM
 
 menu "Ux500 target platform (boards)"
 
-- 
1.7.9.5

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

* [PATCH 23/24] ARM: ux500: Add DT node for ux500 power domains
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: devicetree@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/boot/dts/ste-dbx5x0.dtsi |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/ste-dbx5x0.dtsi b/arch/arm/boot/dts/ste-dbx5x0.dtsi
index e41eedc..29a7013 100644
--- a/arch/arm/boot/dts/ste-dbx5x0.dtsi
+++ b/arch/arm/boot/dts/ste-dbx5x0.dtsi
@@ -43,6 +43,10 @@
 			interrupts = <0 7 IRQ_TYPE_LEVEL_HIGH>;
 		};
 
+		pm_domains: pm_domains0 {
+			compatible = "stericsson,ux500-pm-domains";
+			#power-domain-cells = <1>;
+		};
 
 		clocks {
 			compatible = "stericsson,u8500-clks";
-- 
1.7.9.5


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

* [PATCH 23/24] ARM: ux500: Add DT node for ux500 power domains
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: devicetree at vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/boot/dts/ste-dbx5x0.dtsi |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/ste-dbx5x0.dtsi b/arch/arm/boot/dts/ste-dbx5x0.dtsi
index e41eedc..29a7013 100644
--- a/arch/arm/boot/dts/ste-dbx5x0.dtsi
+++ b/arch/arm/boot/dts/ste-dbx5x0.dtsi
@@ -43,6 +43,10 @@
 			interrupts = <0 7 IRQ_TYPE_LEVEL_HIGH>;
 		};
 
+		pm_domains: pm_domains0 {
+			compatible = "stericsson,ux500-pm-domains";
+			#power-domain-cells = <1>;
+		};
 
 		clocks {
 			compatible = "stericsson,u8500-clks";
-- 
1.7.9.5

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

* [PATCH 24/24] ARM: ux500: Add sdi[n] devices to VAPE power domain
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-10 10:51   ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Ulf Hansson

Since ux500 uses the mmci host driver for these devices and since that
driver are well behaving from a runtime PM perspective, we can now add
these device to the VAPE power domain.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: devicetree@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/boot/dts/ste-dbx5x0.dtsi |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/ste-dbx5x0.dtsi b/arch/arm/boot/dts/ste-dbx5x0.dtsi
index 29a7013..630690b 100644
--- a/arch/arm/boot/dts/ste-dbx5x0.dtsi
+++ b/arch/arm/boot/dts/ste-dbx5x0.dtsi
@@ -11,6 +11,7 @@
 
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/mfd/dbx500-prcmu.h>
+#include <dt-bindings/arm/ux500_pm_domains.h>
 #include "skeleton.dtsi"
 
 / {
@@ -840,6 +841,7 @@
 
 			clocks = <&prcc_kclk 1 5>, <&prcc_pclk 1 5>;
 			clock-names = "sdi", "apb_pclk";
+			power-domains = <&pm_domains DOMAIN_VAPE>;
 
 			status = "disabled";
 		};
@@ -855,6 +857,7 @@
 
 			clocks = <&prcc_kclk 2 4>, <&prcc_pclk 2 6>;
 			clock-names = "sdi", "apb_pclk";
+			power-domains = <&pm_domains DOMAIN_VAPE>;
 
 			status = "disabled";
 		};
@@ -870,6 +873,7 @@
 
 			clocks = <&prcc_kclk 3 4>, <&prcc_pclk 3 4>;
 			clock-names = "sdi", "apb_pclk";
+			power-domains = <&pm_domains DOMAIN_VAPE>;
 
 			status = "disabled";
 		};
@@ -881,6 +885,7 @@
 
 			clocks = <&prcc_kclk 2 5>, <&prcc_pclk 2 7>;
 			clock-names = "sdi", "apb_pclk";
+			power-domains = <&pm_domains DOMAIN_VAPE>;
 
 			status = "disabled";
 		};
@@ -896,6 +901,7 @@
 
 			clocks = <&prcc_kclk 2 2>, <&prcc_pclk 2 4>;
 			clock-names = "sdi", "apb_pclk";
+			power-domains = <&pm_domains DOMAIN_VAPE>;
 
 			status = "disabled";
 		};
@@ -907,6 +913,7 @@
 
 			clocks = <&prcc_kclk 3 7>, <&prcc_pclk 3 7>;
 			clock-names = "sdi", "apb_pclk";
+			power-domains = <&pm_domains DOMAIN_VAPE>;
 
 			status = "disabled";
 		};
-- 
1.7.9.5


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

* [PATCH 24/24] ARM: ux500: Add sdi[n] devices to VAPE power domain
@ 2014-06-10 10:51   ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

Since ux500 uses the mmci host driver for these devices and since that
driver are well behaving from a runtime PM perspective, we can now add
these device to the VAPE power domain.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: devicetree at vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 arch/arm/boot/dts/ste-dbx5x0.dtsi |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/ste-dbx5x0.dtsi b/arch/arm/boot/dts/ste-dbx5x0.dtsi
index 29a7013..630690b 100644
--- a/arch/arm/boot/dts/ste-dbx5x0.dtsi
+++ b/arch/arm/boot/dts/ste-dbx5x0.dtsi
@@ -11,6 +11,7 @@
 
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/mfd/dbx500-prcmu.h>
+#include <dt-bindings/arm/ux500_pm_domains.h>
 #include "skeleton.dtsi"
 
 / {
@@ -840,6 +841,7 @@
 
 			clocks = <&prcc_kclk 1 5>, <&prcc_pclk 1 5>;
 			clock-names = "sdi", "apb_pclk";
+			power-domains = <&pm_domains DOMAIN_VAPE>;
 
 			status = "disabled";
 		};
@@ -855,6 +857,7 @@
 
 			clocks = <&prcc_kclk 2 4>, <&prcc_pclk 2 6>;
 			clock-names = "sdi", "apb_pclk";
+			power-domains = <&pm_domains DOMAIN_VAPE>;
 
 			status = "disabled";
 		};
@@ -870,6 +873,7 @@
 
 			clocks = <&prcc_kclk 3 4>, <&prcc_pclk 3 4>;
 			clock-names = "sdi", "apb_pclk";
+			power-domains = <&pm_domains DOMAIN_VAPE>;
 
 			status = "disabled";
 		};
@@ -881,6 +885,7 @@
 
 			clocks = <&prcc_kclk 2 5>, <&prcc_pclk 2 7>;
 			clock-names = "sdi", "apb_pclk";
+			power-domains = <&pm_domains DOMAIN_VAPE>;
 
 			status = "disabled";
 		};
@@ -896,6 +901,7 @@
 
 			clocks = <&prcc_kclk 2 2>, <&prcc_pclk 2 4>;
 			clock-names = "sdi", "apb_pclk";
+			power-domains = <&pm_domains DOMAIN_VAPE>;
 
 			status = "disabled";
 		};
@@ -907,6 +913,7 @@
 
 			clocks = <&prcc_kclk 3 7>, <&prcc_pclk 3 7>;
 			clock-names = "sdi", "apb_pclk";
+			power-domains = <&pm_domains DOMAIN_VAPE>;
 
 			status = "disabled";
 		};
-- 
1.7.9.5

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

* Re: [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
  2014-06-10 10:51   ` Ulf Hansson
@ 2014-06-10 12:11     ` Rafael J. Wysocki
  -1 siblings, 0 replies; 92+ messages in thread
From: Rafael J. Wysocki @ 2014-06-10 12:11 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm,
	linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Tomasz Figa

On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> From: Tomasz Figa <t.figa@samsung.com>
>
> On a number of platforms, devices are part of controllable power
> domains, which need to be enabled before such devices can be accessed
> and may be powered down when the device is idle to save some power.
> This means that on systems that support power domain control using
> generic power domains subsystem, it is necessary to add device to its
> power domain before binding a driver to it and remove it from its power
> domain after its driver is unbound to make sure that an unused device
> does not affect power domain state.
>
> Since this is not limited to particular busses and specific
> archs/platforms,

Actually, this isn't correrct.  It is limited to the platforms that
use Device Trees now.

Moreover, it is not consistent with the way we add devices to the ACPI PM
domain, which is the ACPI counterpart of this.

Rafael

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

* [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
@ 2014-06-10 12:11     ` Rafael J. Wysocki
  0 siblings, 0 replies; 92+ messages in thread
From: Rafael J. Wysocki @ 2014-06-10 12:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> From: Tomasz Figa <t.figa@samsung.com>
>
> On a number of platforms, devices are part of controllable power
> domains, which need to be enabled before such devices can be accessed
> and may be powered down when the device is idle to save some power.
> This means that on systems that support power domain control using
> generic power domains subsystem, it is necessary to add device to its
> power domain before binding a driver to it and remove it from its power
> domain after its driver is unbound to make sure that an unused device
> does not affect power domain state.
>
> Since this is not limited to particular busses and specific
> archs/platforms,

Actually, this isn't correrct.  It is limited to the platforms that
use Device Trees now.

Moreover, it is not consistent with the way we add devices to the ACPI PM
domain, which is the ACPI counterpart of this.

Rafael

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

* Re: [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
  2014-06-10 12:11     ` Rafael J. Wysocki
@ 2014-06-10 12:53       ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 12:53 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm,
	linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Tomasz Figa

On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
> On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> From: Tomasz Figa <t.figa@samsung.com>
>>
>> On a number of platforms, devices are part of controllable power
>> domains, which need to be enabled before such devices can be accessed
>> and may be powered down when the device is idle to save some power.
>> This means that on systems that support power domain control using
>> generic power domains subsystem, it is necessary to add device to its
>> power domain before binding a driver to it and remove it from its power
>> domain after its driver is unbound to make sure that an unused device
>> does not affect power domain state.
>>
>> Since this is not limited to particular busses and specific
>> archs/platforms,
>
> Actually, this isn't correrct.  It is limited to the platforms that
> use Device Trees now.

Correct, we should update the commit message/docs.

>
> Moreover, it is not consistent with the way we add devices to the ACPI PM
> domain, which is the ACPI counterpart of this.

I am not sure why you think consistency for ACPI is important here.
ACPI PM will still be able to handle it's domain/device registering as
before. There are even other pm_domains that don't use genpd which
need to handle this themselves.

Or are you saying that you prefer bus notifiers in favour of making
use of the driver core for this matter? Shouldn't the driver core
handle most of the common things for a device driver? Let's compare
how the pinctrls are being managed in the driver core, for example.

Kind regards
Ulf Hansson

>
> Rafael

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

* [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
@ 2014-06-10 12:53       ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 12:53 UTC (permalink / raw)
  To: linux-arm-kernel

On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
> On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> From: Tomasz Figa <t.figa@samsung.com>
>>
>> On a number of platforms, devices are part of controllable power
>> domains, which need to be enabled before such devices can be accessed
>> and may be powered down when the device is idle to save some power.
>> This means that on systems that support power domain control using
>> generic power domains subsystem, it is necessary to add device to its
>> power domain before binding a driver to it and remove it from its power
>> domain after its driver is unbound to make sure that an unused device
>> does not affect power domain state.
>>
>> Since this is not limited to particular busses and specific
>> archs/platforms,
>
> Actually, this isn't correrct.  It is limited to the platforms that
> use Device Trees now.

Correct, we should update the commit message/docs.

>
> Moreover, it is not consistent with the way we add devices to the ACPI PM
> domain, which is the ACPI counterpart of this.

I am not sure why you think consistency for ACPI is important here.
ACPI PM will still be able to handle it's domain/device registering as
before. There are even other pm_domains that don't use genpd which
need to handle this themselves.

Or are you saying that you prefer bus notifiers in favour of making
use of the driver core for this matter? Shouldn't the driver core
handle most of the common things for a device driver? Let's compare
how the pinctrls are being managed in the driver core, for example.

Kind regards
Ulf Hansson

>
> Rafael

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

* Re: [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
  2014-06-10 21:27         ` Rafael J. Wysocki
@ 2014-06-10 21:27           ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 92+ messages in thread
From: Greg Kroah-Hartman @ 2014-06-10 21:27 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Ulf Hansson, Rafael J. Wysocki, Len Brown, Pavel Machek,
	linux-pm, linux-arm-kernel, Kevin Hilman, Alan Stern,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Tomasz Figa

On Tue, Jun 10, 2014 at 11:27:45PM +0200, Rafael J. Wysocki wrote:
> On Tuesday, June 10, 2014 02:53:26 PM Ulf Hansson wrote:
> > On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
> > > On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> > >> From: Tomasz Figa <t.figa@samsung.com>
> > >>
> > >> On a number of platforms, devices are part of controllable power
> > >> domains, which need to be enabled before such devices can be accessed
> > >> and may be powered down when the device is idle to save some power.
> > >> This means that on systems that support power domain control using
> > >> generic power domains subsystem, it is necessary to add device to its
> > >> power domain before binding a driver to it and remove it from its power
> > >> domain after its driver is unbound to make sure that an unused device
> > >> does not affect power domain state.
> > >>
> > >> Since this is not limited to particular busses and specific
> > >> archs/platforms,
> > >
> > > Actually, this isn't correrct.  It is limited to the platforms that
> > > use Device Trees now.
> > 
> > Correct, we should update the commit message/docs.
> > 
> > >
> > > Moreover, it is not consistent with the way we add devices to the ACPI PM
> > > domain, which is the ACPI counterpart of this.
> > 
> > I am not sure why you think consistency for ACPI is important here.
> > ACPI PM will still be able to handle it's domain/device registering as
> > before. There are even other pm_domains that don't use genpd which
> > need to handle this themselves.
> 
> My point is that doing things like that in different places for different
> firmware interfaces is confusing and likely to lead to coding mistakes in
> the future.
> 
> > Or are you saying that you prefer bus notifiers in favour of making
> > use of the driver core for this matter?
> 
> Well, please grep for acpi_dev_pm_attach() and see where it is done.
> Surely not in drivers/base/dd.c.  Also I'm not sure why you're talking
> about bus notifiers in this context.
> 
> > Shouldn't the driver core handle most of the common things for a device
> > driver?
> 
> Common, yes.  Platform-specific, no.
> 
> > Let's compare how the pinctrls are being managed in the driver core, for
> > example.
> 
> pinctrl has Device Trees support only at the moment (as far as firmware
> interfaces go) and quite frankly I'm not sure if/how we'll need to change
> it to cover ACPI as well.
> 
> But for power domains, please keep that stuff away from dd.c.  That is,
> unless Greg specifically disagrees with me and decides to apply this
> patch regardless. :-)

Nope, no disagreement from me toward you at all here, keep up the good
work :)

greg k-h

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

* [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
@ 2014-06-10 21:27           ` Greg Kroah-Hartman
  0 siblings, 0 replies; 92+ messages in thread
From: Greg Kroah-Hartman @ 2014-06-10 21:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 10, 2014 at 11:27:45PM +0200, Rafael J. Wysocki wrote:
> On Tuesday, June 10, 2014 02:53:26 PM Ulf Hansson wrote:
> > On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
> > > On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> > >> From: Tomasz Figa <t.figa@samsung.com>
> > >>
> > >> On a number of platforms, devices are part of controllable power
> > >> domains, which need to be enabled before such devices can be accessed
> > >> and may be powered down when the device is idle to save some power.
> > >> This means that on systems that support power domain control using
> > >> generic power domains subsystem, it is necessary to add device to its
> > >> power domain before binding a driver to it and remove it from its power
> > >> domain after its driver is unbound to make sure that an unused device
> > >> does not affect power domain state.
> > >>
> > >> Since this is not limited to particular busses and specific
> > >> archs/platforms,
> > >
> > > Actually, this isn't correrct.  It is limited to the platforms that
> > > use Device Trees now.
> > 
> > Correct, we should update the commit message/docs.
> > 
> > >
> > > Moreover, it is not consistent with the way we add devices to the ACPI PM
> > > domain, which is the ACPI counterpart of this.
> > 
> > I am not sure why you think consistency for ACPI is important here.
> > ACPI PM will still be able to handle it's domain/device registering as
> > before. There are even other pm_domains that don't use genpd which
> > need to handle this themselves.
> 
> My point is that doing things like that in different places for different
> firmware interfaces is confusing and likely to lead to coding mistakes in
> the future.
> 
> > Or are you saying that you prefer bus notifiers in favour of making
> > use of the driver core for this matter?
> 
> Well, please grep for acpi_dev_pm_attach() and see where it is done.
> Surely not in drivers/base/dd.c.  Also I'm not sure why you're talking
> about bus notifiers in this context.
> 
> > Shouldn't the driver core handle most of the common things for a device
> > driver?
> 
> Common, yes.  Platform-specific, no.
> 
> > Let's compare how the pinctrls are being managed in the driver core, for
> > example.
> 
> pinctrl has Device Trees support only at the moment (as far as firmware
> interfaces go) and quite frankly I'm not sure if/how we'll need to change
> it to cover ACPI as well.
> 
> But for power domains, please keep that stuff away from dd.c.  That is,
> unless Greg specifically disagrees with me and decides to apply this
> patch regardless. :-)

Nope, no disagreement from me toward you at all here, keep up the good
work :)

greg k-h

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

* Re: [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
  2014-06-10 12:53       ` Ulf Hansson
@ 2014-06-10 21:27         ` Rafael J. Wysocki
  -1 siblings, 0 replies; 92+ messages in thread
From: Rafael J. Wysocki @ 2014-06-10 21:27 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm,
	linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Tomasz Figa

On Tuesday, June 10, 2014 02:53:26 PM Ulf Hansson wrote:
> On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
> > On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> >> From: Tomasz Figa <t.figa@samsung.com>
> >>
> >> On a number of platforms, devices are part of controllable power
> >> domains, which need to be enabled before such devices can be accessed
> >> and may be powered down when the device is idle to save some power.
> >> This means that on systems that support power domain control using
> >> generic power domains subsystem, it is necessary to add device to its
> >> power domain before binding a driver to it and remove it from its power
> >> domain after its driver is unbound to make sure that an unused device
> >> does not affect power domain state.
> >>
> >> Since this is not limited to particular busses and specific
> >> archs/platforms,
> >
> > Actually, this isn't correrct.  It is limited to the platforms that
> > use Device Trees now.
> 
> Correct, we should update the commit message/docs.
> 
> >
> > Moreover, it is not consistent with the way we add devices to the ACPI PM
> > domain, which is the ACPI counterpart of this.
> 
> I am not sure why you think consistency for ACPI is important here.
> ACPI PM will still be able to handle it's domain/device registering as
> before. There are even other pm_domains that don't use genpd which
> need to handle this themselves.

My point is that doing things like that in different places for different
firmware interfaces is confusing and likely to lead to coding mistakes in
the future.

> Or are you saying that you prefer bus notifiers in favour of making
> use of the driver core for this matter?

Well, please grep for acpi_dev_pm_attach() and see where it is done.
Surely not in drivers/base/dd.c.  Also I'm not sure why you're talking
about bus notifiers in this context.

> Shouldn't the driver core handle most of the common things for a device
> driver?

Common, yes.  Platform-specific, no.

> Let's compare how the pinctrls are being managed in the driver core, for
> example.

pinctrl has Device Trees support only at the moment (as far as firmware
interfaces go) and quite frankly I'm not sure if/how we'll need to change
it to cover ACPI as well.

But for power domains, please keep that stuff away from dd.c.  That is,
unless Greg specifically disagrees with me and decides to apply this
patch regardless. :-)

Rafael


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

* [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
@ 2014-06-10 21:27         ` Rafael J. Wysocki
  0 siblings, 0 replies; 92+ messages in thread
From: Rafael J. Wysocki @ 2014-06-10 21:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday, June 10, 2014 02:53:26 PM Ulf Hansson wrote:
> On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
> > On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> >> From: Tomasz Figa <t.figa@samsung.com>
> >>
> >> On a number of platforms, devices are part of controllable power
> >> domains, which need to be enabled before such devices can be accessed
> >> and may be powered down when the device is idle to save some power.
> >> This means that on systems that support power domain control using
> >> generic power domains subsystem, it is necessary to add device to its
> >> power domain before binding a driver to it and remove it from its power
> >> domain after its driver is unbound to make sure that an unused device
> >> does not affect power domain state.
> >>
> >> Since this is not limited to particular busses and specific
> >> archs/platforms,
> >
> > Actually, this isn't correrct.  It is limited to the platforms that
> > use Device Trees now.
> 
> Correct, we should update the commit message/docs.
> 
> >
> > Moreover, it is not consistent with the way we add devices to the ACPI PM
> > domain, which is the ACPI counterpart of this.
> 
> I am not sure why you think consistency for ACPI is important here.
> ACPI PM will still be able to handle it's domain/device registering as
> before. There are even other pm_domains that don't use genpd which
> need to handle this themselves.

My point is that doing things like that in different places for different
firmware interfaces is confusing and likely to lead to coding mistakes in
the future.

> Or are you saying that you prefer bus notifiers in favour of making
> use of the driver core for this matter?

Well, please grep for acpi_dev_pm_attach() and see where it is done.
Surely not in drivers/base/dd.c.  Also I'm not sure why you're talking
about bus notifiers in this context.

> Shouldn't the driver core handle most of the common things for a device
> driver?

Common, yes.  Platform-specific, no.

> Let's compare how the pinctrls are being managed in the driver core, for
> example.

pinctrl has Device Trees support only at the moment (as far as firmware
interfaces go) and quite frankly I'm not sure if/how we'll need to change
it to cover ACPI as well.

But for power domains, please keep that stuff away from dd.c.  That is,
unless Greg specifically disagrees with me and decides to apply this
patch regardless. :-)

Rafael

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

* Re: [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
  2014-06-10 21:27           ` Greg Kroah-Hartman
@ 2014-06-10 21:42             ` Tomasz Figa
  -1 siblings, 0 replies; 92+ messages in thread
From: Tomasz Figa @ 2014-06-10 21:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki
  Cc: Ulf Hansson, Rafael J. Wysocki, Len Brown, Pavel Machek,
	linux-pm, linux-arm-kernel, Kevin Hilman, Alan Stern,
	Daniel Lezcano, devicetree, Linus Walleij, Simon Horman,
	Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd, Philipp Zabel,
	Mark Brown, Tomasz Figa

On 10.06.2014 23:27, Greg Kroah-Hartman wrote:
> On Tue, Jun 10, 2014 at 11:27:45PM +0200, Rafael J. Wysocki wrote:
>> On Tuesday, June 10, 2014 02:53:26 PM Ulf Hansson wrote:
>>> On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
>>>> On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>>>> From: Tomasz Figa <t.figa@samsung.com>
>>>>>
>>>>> On a number of platforms, devices are part of controllable power
>>>>> domains, which need to be enabled before such devices can be accessed
>>>>> and may be powered down when the device is idle to save some power.
>>>>> This means that on systems that support power domain control using
>>>>> generic power domains subsystem, it is necessary to add device to its
>>>>> power domain before binding a driver to it and remove it from its power
>>>>> domain after its driver is unbound to make sure that an unused device
>>>>> does not affect power domain state.
>>>>>
>>>>> Since this is not limited to particular busses and specific
>>>>> archs/platforms,
>>>>
>>>> Actually, this isn't correrct.  It is limited to the platforms that
>>>> use Device Trees now.
>>>
>>> Correct, we should update the commit message/docs.
>>>
>>>>
>>>> Moreover, it is not consistent with the way we add devices to the ACPI PM
>>>> domain, which is the ACPI counterpart of this.
>>>
>>> I am not sure why you think consistency for ACPI is important here.
>>> ACPI PM will still be able to handle it's domain/device registering as
>>> before. There are even other pm_domains that don't use genpd which
>>> need to handle this themselves.
>>
>> My point is that doing things like that in different places for different
>> firmware interfaces is confusing and likely to lead to coding mistakes in
>> the future.
>>
>>> Or are you saying that you prefer bus notifiers in favour of making
>>> use of the driver core for this matter?
>>
>> Well, please grep for acpi_dev_pm_attach() and see where it is done.
>> Surely not in drivers/base/dd.c.  Also I'm not sure why you're talking
>> about bus notifiers in this context.
>>
>>> Shouldn't the driver core handle most of the common things for a device
>>> driver?
>>
>> Common, yes.  Platform-specific, no.
>>
>>> Let's compare how the pinctrls are being managed in the driver core, for
>>> example.
>>
>> pinctrl has Device Trees support only at the moment (as far as firmware
>> interfaces go) and quite frankly I'm not sure if/how we'll need to change
>> it to cover ACPI as well.
>>
>> But for power domains, please keep that stuff away from dd.c.  That is,
>> unless Greg specifically disagrees with me and decides to apply this
>> patch regardless. :-)
> 
> Nope, no disagreement from me toward you at all here, keep up the good
> work :)

OK, so proposed solution is to put this in:

- platform_drv_probe(),
- spi_drv_probe(),
- i2c_device_probe(),
- amba_probe(),

...

- and any other bus type, which can have devices instantiated from DT.

If this is what you mean, I still think putting this in dd is cleaner
and more scalable, but I'm not going to insist, as I believe you have
good reasons to prefer this approach over current one.

Best regards,
Tomasz

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

* [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
@ 2014-06-10 21:42             ` Tomasz Figa
  0 siblings, 0 replies; 92+ messages in thread
From: Tomasz Figa @ 2014-06-10 21:42 UTC (permalink / raw)
  To: linux-arm-kernel

On 10.06.2014 23:27, Greg Kroah-Hartman wrote:
> On Tue, Jun 10, 2014 at 11:27:45PM +0200, Rafael J. Wysocki wrote:
>> On Tuesday, June 10, 2014 02:53:26 PM Ulf Hansson wrote:
>>> On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
>>>> On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>>>> From: Tomasz Figa <t.figa@samsung.com>
>>>>>
>>>>> On a number of platforms, devices are part of controllable power
>>>>> domains, which need to be enabled before such devices can be accessed
>>>>> and may be powered down when the device is idle to save some power.
>>>>> This means that on systems that support power domain control using
>>>>> generic power domains subsystem, it is necessary to add device to its
>>>>> power domain before binding a driver to it and remove it from its power
>>>>> domain after its driver is unbound to make sure that an unused device
>>>>> does not affect power domain state.
>>>>>
>>>>> Since this is not limited to particular busses and specific
>>>>> archs/platforms,
>>>>
>>>> Actually, this isn't correrct.  It is limited to the platforms that
>>>> use Device Trees now.
>>>
>>> Correct, we should update the commit message/docs.
>>>
>>>>
>>>> Moreover, it is not consistent with the way we add devices to the ACPI PM
>>>> domain, which is the ACPI counterpart of this.
>>>
>>> I am not sure why you think consistency for ACPI is important here.
>>> ACPI PM will still be able to handle it's domain/device registering as
>>> before. There are even other pm_domains that don't use genpd which
>>> need to handle this themselves.
>>
>> My point is that doing things like that in different places for different
>> firmware interfaces is confusing and likely to lead to coding mistakes in
>> the future.
>>
>>> Or are you saying that you prefer bus notifiers in favour of making
>>> use of the driver core for this matter?
>>
>> Well, please grep for acpi_dev_pm_attach() and see where it is done.
>> Surely not in drivers/base/dd.c.  Also I'm not sure why you're talking
>> about bus notifiers in this context.
>>
>>> Shouldn't the driver core handle most of the common things for a device
>>> driver?
>>
>> Common, yes.  Platform-specific, no.
>>
>>> Let's compare how the pinctrls are being managed in the driver core, for
>>> example.
>>
>> pinctrl has Device Trees support only at the moment (as far as firmware
>> interfaces go) and quite frankly I'm not sure if/how we'll need to change
>> it to cover ACPI as well.
>>
>> But for power domains, please keep that stuff away from dd.c.  That is,
>> unless Greg specifically disagrees with me and decides to apply this
>> patch regardless. :-)
> 
> Nope, no disagreement from me toward you at all here, keep up the good
> work :)

OK, so proposed solution is to put this in:

- platform_drv_probe(),
- spi_drv_probe(),
- i2c_device_probe(),
- amba_probe(),

...

- and any other bus type, which can have devices instantiated from DT.

If this is what you mean, I still think putting this in dd is cleaner
and more scalable, but I'm not going to insist, as I believe you have
good reasons to prefer this approach over current one.

Best regards,
Tomasz

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

* Re: [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
  2014-06-10 21:42             ` Tomasz Figa
@ 2014-06-10 22:15               ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 22:15 UTC (permalink / raw)
  To: Tomasz Figa, Greg Kroah-Hartman, Rafael J. Wysocki
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm,
	linux-arm-kernel, Kevin Hilman, Alan Stern, Daniel Lezcano,
	devicetree, Linus Walleij, Simon Horman, Magnus Damm, Ben Dooks,
	Kukjin Kim, Stephen Boyd, Philipp Zabel, Mark Brown, Tomasz Figa

On 10 June 2014 23:42, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> On 10.06.2014 23:27, Greg Kroah-Hartman wrote:
>> On Tue, Jun 10, 2014 at 11:27:45PM +0200, Rafael J. Wysocki wrote:
>>> On Tuesday, June 10, 2014 02:53:26 PM Ulf Hansson wrote:
>>>> On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
>>>>> On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>>>>> From: Tomasz Figa <t.figa@samsung.com>
>>>>>>
>>>>>> On a number of platforms, devices are part of controllable power
>>>>>> domains, which need to be enabled before such devices can be accessed
>>>>>> and may be powered down when the device is idle to save some power.
>>>>>> This means that on systems that support power domain control using
>>>>>> generic power domains subsystem, it is necessary to add device to its
>>>>>> power domain before binding a driver to it and remove it from its power
>>>>>> domain after its driver is unbound to make sure that an unused device
>>>>>> does not affect power domain state.
>>>>>>
>>>>>> Since this is not limited to particular busses and specific
>>>>>> archs/platforms,
>>>>>
>>>>> Actually, this isn't correrct.  It is limited to the platforms that
>>>>> use Device Trees now.
>>>>
>>>> Correct, we should update the commit message/docs.
>>>>
>>>>>
>>>>> Moreover, it is not consistent with the way we add devices to the ACPI PM
>>>>> domain, which is the ACPI counterpart of this.
>>>>
>>>> I am not sure why you think consistency for ACPI is important here.
>>>> ACPI PM will still be able to handle it's domain/device registering as
>>>> before. There are even other pm_domains that don't use genpd which
>>>> need to handle this themselves.
>>>
>>> My point is that doing things like that in different places for different
>>> firmware interfaces is confusing and likely to lead to coding mistakes in
>>> the future.
>>>
>>>> Or are you saying that you prefer bus notifiers in favour of making
>>>> use of the driver core for this matter?
>>>
>>> Well, please grep for acpi_dev_pm_attach() and see where it is done.
>>> Surely not in drivers/base/dd.c.  Also I'm not sure why you're talking
>>> about bus notifiers in this context.
>>>
>>>> Shouldn't the driver core handle most of the common things for a device
>>>> driver?
>>>
>>> Common, yes.  Platform-specific, no.
>>>
>>>> Let's compare how the pinctrls are being managed in the driver core, for
>>>> example.
>>>
>>> pinctrl has Device Trees support only at the moment (as far as firmware
>>> interfaces go) and quite frankly I'm not sure if/how we'll need to change
>>> it to cover ACPI as well.
>>>
>>> But for power domains, please keep that stuff away from dd.c.  That is,
>>> unless Greg specifically disagrees with me and decides to apply this
>>> patch regardless. :-)
>>
>> Nope, no disagreement from me toward you at all here, keep up the good
>> work :)
>
> OK, so proposed solution is to put this in:
>
> - platform_drv_probe(),
> - spi_drv_probe(),
> - i2c_device_probe(),
> - amba_probe(),
>
> ...
>
> - and any other bus type, which can have devices instantiated from DT.
>
> If this is what you mean, I still think putting this in dd is cleaner
> and more scalable, but I'm not going to insist, as I believe you have
> good reasons to prefer this approach over current one.

I am not so sure we should ignore scalability.

Currently there are SoCs those that uses bus notifiers to handle the
device registration for it's pm_domain. When each of them converts to
use bus' ->probe() function instead, they will have their own version
of acpi_dev_pm_attach(), and the scalability becomes an issue.

An option could be to invent a common "pm_domain_attach_dev() API",
which will check what kind of power domain the device may reside in.
In principle invoke acpi_dev_pm_attach() and if no attachment happens,
try genpd_bind_domain().

Kind regards
Ulf Hansson

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

* [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
@ 2014-06-10 22:15               ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-10 22:15 UTC (permalink / raw)
  To: linux-arm-kernel

On 10 June 2014 23:42, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> On 10.06.2014 23:27, Greg Kroah-Hartman wrote:
>> On Tue, Jun 10, 2014 at 11:27:45PM +0200, Rafael J. Wysocki wrote:
>>> On Tuesday, June 10, 2014 02:53:26 PM Ulf Hansson wrote:
>>>> On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
>>>>> On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>>>>> From: Tomasz Figa <t.figa@samsung.com>
>>>>>>
>>>>>> On a number of platforms, devices are part of controllable power
>>>>>> domains, which need to be enabled before such devices can be accessed
>>>>>> and may be powered down when the device is idle to save some power.
>>>>>> This means that on systems that support power domain control using
>>>>>> generic power domains subsystem, it is necessary to add device to its
>>>>>> power domain before binding a driver to it and remove it from its power
>>>>>> domain after its driver is unbound to make sure that an unused device
>>>>>> does not affect power domain state.
>>>>>>
>>>>>> Since this is not limited to particular busses and specific
>>>>>> archs/platforms,
>>>>>
>>>>> Actually, this isn't correrct.  It is limited to the platforms that
>>>>> use Device Trees now.
>>>>
>>>> Correct, we should update the commit message/docs.
>>>>
>>>>>
>>>>> Moreover, it is not consistent with the way we add devices to the ACPI PM
>>>>> domain, which is the ACPI counterpart of this.
>>>>
>>>> I am not sure why you think consistency for ACPI is important here.
>>>> ACPI PM will still be able to handle it's domain/device registering as
>>>> before. There are even other pm_domains that don't use genpd which
>>>> need to handle this themselves.
>>>
>>> My point is that doing things like that in different places for different
>>> firmware interfaces is confusing and likely to lead to coding mistakes in
>>> the future.
>>>
>>>> Or are you saying that you prefer bus notifiers in favour of making
>>>> use of the driver core for this matter?
>>>
>>> Well, please grep for acpi_dev_pm_attach() and see where it is done.
>>> Surely not in drivers/base/dd.c.  Also I'm not sure why you're talking
>>> about bus notifiers in this context.
>>>
>>>> Shouldn't the driver core handle most of the common things for a device
>>>> driver?
>>>
>>> Common, yes.  Platform-specific, no.
>>>
>>>> Let's compare how the pinctrls are being managed in the driver core, for
>>>> example.
>>>
>>> pinctrl has Device Trees support only at the moment (as far as firmware
>>> interfaces go) and quite frankly I'm not sure if/how we'll need to change
>>> it to cover ACPI as well.
>>>
>>> But for power domains, please keep that stuff away from dd.c.  That is,
>>> unless Greg specifically disagrees with me and decides to apply this
>>> patch regardless. :-)
>>
>> Nope, no disagreement from me toward you at all here, keep up the good
>> work :)
>
> OK, so proposed solution is to put this in:
>
> - platform_drv_probe(),
> - spi_drv_probe(),
> - i2c_device_probe(),
> - amba_probe(),
>
> ...
>
> - and any other bus type, which can have devices instantiated from DT.
>
> If this is what you mean, I still think putting this in dd is cleaner
> and more scalable, but I'm not going to insist, as I believe you have
> good reasons to prefer this approach over current one.

I am not so sure we should ignore scalability.

Currently there are SoCs those that uses bus notifiers to handle the
device registration for it's pm_domain. When each of them converts to
use bus' ->probe() function instead, they will have their own version
of acpi_dev_pm_attach(), and the scalability becomes an issue.

An option could be to invent a common "pm_domain_attach_dev() API",
which will check what kind of power domain the device may reside in.
In principle invoke acpi_dev_pm_attach() and if no attachment happens,
try genpd_bind_domain().

Kind regards
Ulf Hansson

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

* Re: [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
  2014-06-10 21:42             ` Tomasz Figa
@ 2014-06-11  0:18               ` Rafael J. Wysocki
  -1 siblings, 0 replies; 92+ messages in thread
From: Rafael J. Wysocki @ 2014-06-11  0:18 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: Greg Kroah-Hartman, Ulf Hansson, Rafael J. Wysocki, Len Brown,
	Pavel Machek, linux-pm, linux-arm-kernel, Kevin Hilman,
	Alan Stern, Daniel Lezcano, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Tomasz Figa

On Tuesday, June 10, 2014 11:42:25 PM Tomasz Figa wrote:
> On 10.06.2014 23:27, Greg Kroah-Hartman wrote:
> > On Tue, Jun 10, 2014 at 11:27:45PM +0200, Rafael J. Wysocki wrote:
> >> On Tuesday, June 10, 2014 02:53:26 PM Ulf Hansson wrote:
> >>> On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
> >>>> On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> >>>>> From: Tomasz Figa <t.figa@samsung.com>
> >>>>>
> >>>>> On a number of platforms, devices are part of controllable power
> >>>>> domains, which need to be enabled before such devices can be accessed
> >>>>> and may be powered down when the device is idle to save some power.
> >>>>> This means that on systems that support power domain control using
> >>>>> generic power domains subsystem, it is necessary to add device to its
> >>>>> power domain before binding a driver to it and remove it from its power
> >>>>> domain after its driver is unbound to make sure that an unused device
> >>>>> does not affect power domain state.
> >>>>>
> >>>>> Since this is not limited to particular busses and specific
> >>>>> archs/platforms,
> >>>>
> >>>> Actually, this isn't correrct.  It is limited to the platforms that
> >>>> use Device Trees now.
> >>>
> >>> Correct, we should update the commit message/docs.
> >>>
> >>>>
> >>>> Moreover, it is not consistent with the way we add devices to the ACPI PM
> >>>> domain, which is the ACPI counterpart of this.
> >>>
> >>> I am not sure why you think consistency for ACPI is important here.
> >>> ACPI PM will still be able to handle it's domain/device registering as
> >>> before. There are even other pm_domains that don't use genpd which
> >>> need to handle this themselves.
> >>
> >> My point is that doing things like that in different places for different
> >> firmware interfaces is confusing and likely to lead to coding mistakes in
> >> the future.
> >>
> >>> Or are you saying that you prefer bus notifiers in favour of making
> >>> use of the driver core for this matter?
> >>
> >> Well, please grep for acpi_dev_pm_attach() and see where it is done.
> >> Surely not in drivers/base/dd.c.  Also I'm not sure why you're talking
> >> about bus notifiers in this context.
> >>
> >>> Shouldn't the driver core handle most of the common things for a device
> >>> driver?
> >>
> >> Common, yes.  Platform-specific, no.
> >>
> >>> Let's compare how the pinctrls are being managed in the driver core, for
> >>> example.
> >>
> >> pinctrl has Device Trees support only at the moment (as far as firmware
> >> interfaces go) and quite frankly I'm not sure if/how we'll need to change
> >> it to cover ACPI as well.
> >>
> >> But for power domains, please keep that stuff away from dd.c.  That is,
> >> unless Greg specifically disagrees with me and decides to apply this
> >> patch regardless. :-)
> > 
> > Nope, no disagreement from me toward you at all here, keep up the good
> > work :)
> 
> OK, so proposed solution is to put this in:
> 
> - platform_drv_probe(),
> - spi_drv_probe(),
> - i2c_device_probe(),
> - amba_probe(),

Yes.  Specifically, those are bus types that don't do their own power
management.

> ...
> 
> - and any other bus type, which can have devices instantiated from DT.

And doesn't do its own power management, in which case it will need to
incorporate PM domains handling into its code in a more sophisticated way,
most likely.

> If this is what you mean, I still think putting this in dd is cleaner
> and more scalable, but I'm not going to insist, as I believe you have
> good reasons to prefer this approach over current one.

It may look cleaner, but need not be correct.

Rafael


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

* [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
@ 2014-06-11  0:18               ` Rafael J. Wysocki
  0 siblings, 0 replies; 92+ messages in thread
From: Rafael J. Wysocki @ 2014-06-11  0:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday, June 10, 2014 11:42:25 PM Tomasz Figa wrote:
> On 10.06.2014 23:27, Greg Kroah-Hartman wrote:
> > On Tue, Jun 10, 2014 at 11:27:45PM +0200, Rafael J. Wysocki wrote:
> >> On Tuesday, June 10, 2014 02:53:26 PM Ulf Hansson wrote:
> >>> On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
> >>>> On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> >>>>> From: Tomasz Figa <t.figa@samsung.com>
> >>>>>
> >>>>> On a number of platforms, devices are part of controllable power
> >>>>> domains, which need to be enabled before such devices can be accessed
> >>>>> and may be powered down when the device is idle to save some power.
> >>>>> This means that on systems that support power domain control using
> >>>>> generic power domains subsystem, it is necessary to add device to its
> >>>>> power domain before binding a driver to it and remove it from its power
> >>>>> domain after its driver is unbound to make sure that an unused device
> >>>>> does not affect power domain state.
> >>>>>
> >>>>> Since this is not limited to particular busses and specific
> >>>>> archs/platforms,
> >>>>
> >>>> Actually, this isn't correrct.  It is limited to the platforms that
> >>>> use Device Trees now.
> >>>
> >>> Correct, we should update the commit message/docs.
> >>>
> >>>>
> >>>> Moreover, it is not consistent with the way we add devices to the ACPI PM
> >>>> domain, which is the ACPI counterpart of this.
> >>>
> >>> I am not sure why you think consistency for ACPI is important here.
> >>> ACPI PM will still be able to handle it's domain/device registering as
> >>> before. There are even other pm_domains that don't use genpd which
> >>> need to handle this themselves.
> >>
> >> My point is that doing things like that in different places for different
> >> firmware interfaces is confusing and likely to lead to coding mistakes in
> >> the future.
> >>
> >>> Or are you saying that you prefer bus notifiers in favour of making
> >>> use of the driver core for this matter?
> >>
> >> Well, please grep for acpi_dev_pm_attach() and see where it is done.
> >> Surely not in drivers/base/dd.c.  Also I'm not sure why you're talking
> >> about bus notifiers in this context.
> >>
> >>> Shouldn't the driver core handle most of the common things for a device
> >>> driver?
> >>
> >> Common, yes.  Platform-specific, no.
> >>
> >>> Let's compare how the pinctrls are being managed in the driver core, for
> >>> example.
> >>
> >> pinctrl has Device Trees support only at the moment (as far as firmware
> >> interfaces go) and quite frankly I'm not sure if/how we'll need to change
> >> it to cover ACPI as well.
> >>
> >> But for power domains, please keep that stuff away from dd.c.  That is,
> >> unless Greg specifically disagrees with me and decides to apply this
> >> patch regardless. :-)
> > 
> > Nope, no disagreement from me toward you at all here, keep up the good
> > work :)
> 
> OK, so proposed solution is to put this in:
> 
> - platform_drv_probe(),
> - spi_drv_probe(),
> - i2c_device_probe(),
> - amba_probe(),

Yes.  Specifically, those are bus types that don't do their own power
management.

> ...
> 
> - and any other bus type, which can have devices instantiated from DT.

And doesn't do its own power management, in which case it will need to
incorporate PM domains handling into its code in a more sophisticated way,
most likely.

> If this is what you mean, I still think putting this in dd is cleaner
> and more scalable, but I'm not going to insist, as I believe you have
> good reasons to prefer this approach over current one.

It may look cleaner, but need not be correct.

Rafael

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

* Re: [PATCH 07/24] ARM: shmobile: Drop dev_irq_safe from r8a7779 genpd config
  2014-06-10 10:51   ` Ulf Hansson
@ 2014-06-11 18:13     ` Kevin Hilman
  -1 siblings, 0 replies; 92+ messages in thread
From: Kevin Hilman @ 2014-06-11 18:13 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm,
	linux-arm-kernel, Alan Stern, Greg Kroah-Hartman, Daniel Lezcano,
	Tomasz Figa, devicetree, Linus Walleij, Simon Horman,
	Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd, Philipp Zabel,
	Mark Brown

Ulf Hansson <ulf.hansson@linaro.org> writes:

> The dev_irq_safe configuration is redundant, genpd don't have any
> special treatmeant for handling it.  Let's remove it.

Why?

The genpd core needs to handle irq_safe properly eventully (right now it
just doesn't call power_off/power_on callbacks, but that needs to be
implmenented.  c.f commit 0aa2a22169)

If we remove these flags from platforms, we're taking away information
that the platform maintainers have specified tha will be useful when
full support is avialble.

Kevin


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

* [PATCH 07/24] ARM: shmobile: Drop dev_irq_safe from r8a7779 genpd config
@ 2014-06-11 18:13     ` Kevin Hilman
  0 siblings, 0 replies; 92+ messages in thread
From: Kevin Hilman @ 2014-06-11 18:13 UTC (permalink / raw)
  To: linux-arm-kernel

Ulf Hansson <ulf.hansson@linaro.org> writes:

> The dev_irq_safe configuration is redundant, genpd don't have any
> special treatmeant for handling it.  Let's remove it.

Why?

The genpd core needs to handle irq_safe properly eventully (right now it
just doesn't call power_off/power_on callbacks, but that needs to be
implmenented.  c.f commit 0aa2a22169)

If we remove these flags from platforms, we're taking away information
that the platform maintainers have specified tha will be useful when
full support is avialble.

Kevin

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

* Re: [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
  2014-06-10 21:42             ` Tomasz Figa
@ 2014-06-11 18:16               ` Kevin Hilman
  -1 siblings, 0 replies; 92+ messages in thread
From: Kevin Hilman @ 2014-06-11 18:16 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Ulf Hansson,
	Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm,
	linux-arm-kernel, Alan Stern, Daniel Lezcano, devicetree,
	Linus Walleij, Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim,
	Stephen Boyd, Philipp Zabel, Mark Brown, Tomasz Figa

Tomasz Figa <tomasz.figa@gmail.com> writes:

> On 10.06.2014 23:27, Greg Kroah-Hartman wrote:
>> On Tue, Jun 10, 2014 at 11:27:45PM +0200, Rafael J. Wysocki wrote:
>>> On Tuesday, June 10, 2014 02:53:26 PM Ulf Hansson wrote:
>>>> On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
>>>>> On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>>>>> From: Tomasz Figa <t.figa@samsung.com>
>>>>>>
>>>>>> On a number of platforms, devices are part of controllable power
>>>>>> domains, which need to be enabled before such devices can be accessed
>>>>>> and may be powered down when the device is idle to save some power.
>>>>>> This means that on systems that support power domain control using
>>>>>> generic power domains subsystem, it is necessary to add device to its
>>>>>> power domain before binding a driver to it and remove it from its power
>>>>>> domain after its driver is unbound to make sure that an unused device
>>>>>> does not affect power domain state.
>>>>>>
>>>>>> Since this is not limited to particular busses and specific
>>>>>> archs/platforms,
>>>>>
>>>>> Actually, this isn't correrct.  It is limited to the platforms that
>>>>> use Device Trees now.
>>>>
>>>> Correct, we should update the commit message/docs.
>>>>
>>>>>
>>>>> Moreover, it is not consistent with the way we add devices to the ACPI PM
>>>>> domain, which is the ACPI counterpart of this.
>>>>
>>>> I am not sure why you think consistency for ACPI is important here.
>>>> ACPI PM will still be able to handle it's domain/device registering as
>>>> before. There are even other pm_domains that don't use genpd which
>>>> need to handle this themselves.
>>>
>>> My point is that doing things like that in different places for different
>>> firmware interfaces is confusing and likely to lead to coding mistakes in
>>> the future.
>>>
>>>> Or are you saying that you prefer bus notifiers in favour of making
>>>> use of the driver core for this matter?
>>>
>>> Well, please grep for acpi_dev_pm_attach() and see where it is done.
>>> Surely not in drivers/base/dd.c.  Also I'm not sure why you're talking
>>> about bus notifiers in this context.
>>>
>>>> Shouldn't the driver core handle most of the common things for a device
>>>> driver?
>>>
>>> Common, yes.  Platform-specific, no.
>>>
>>>> Let's compare how the pinctrls are being managed in the driver core, for
>>>> example.
>>>
>>> pinctrl has Device Trees support only at the moment (as far as firmware
>>> interfaces go) and quite frankly I'm not sure if/how we'll need to change
>>> it to cover ACPI as well.
>>>
>>> But for power domains, please keep that stuff away from dd.c.  That is,
>>> unless Greg specifically disagrees with me and decides to apply this
>>> patch regardless. :-)
>> 
>> Nope, no disagreement from me toward you at all here, keep up the good
>> work :)
>
> OK, so proposed solution is to put this in:
>
> - platform_drv_probe(),
> - spi_drv_probe(),
> - i2c_device_probe(),
> - amba_probe(),
>
> ...
>
> - and any other bus type, which can have devices instantiated from DT.

Since this is a DT feature, what about calling
__pm_genpd_of_add_device()  when the power-domain nodes are discovered?

Kevin

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

* [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
@ 2014-06-11 18:16               ` Kevin Hilman
  0 siblings, 0 replies; 92+ messages in thread
From: Kevin Hilman @ 2014-06-11 18:16 UTC (permalink / raw)
  To: linux-arm-kernel

Tomasz Figa <tomasz.figa@gmail.com> writes:

> On 10.06.2014 23:27, Greg Kroah-Hartman wrote:
>> On Tue, Jun 10, 2014 at 11:27:45PM +0200, Rafael J. Wysocki wrote:
>>> On Tuesday, June 10, 2014 02:53:26 PM Ulf Hansson wrote:
>>>> On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
>>>>> On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>>>>> From: Tomasz Figa <t.figa@samsung.com>
>>>>>>
>>>>>> On a number of platforms, devices are part of controllable power
>>>>>> domains, which need to be enabled before such devices can be accessed
>>>>>> and may be powered down when the device is idle to save some power.
>>>>>> This means that on systems that support power domain control using
>>>>>> generic power domains subsystem, it is necessary to add device to its
>>>>>> power domain before binding a driver to it and remove it from its power
>>>>>> domain after its driver is unbound to make sure that an unused device
>>>>>> does not affect power domain state.
>>>>>>
>>>>>> Since this is not limited to particular busses and specific
>>>>>> archs/platforms,
>>>>>
>>>>> Actually, this isn't correrct.  It is limited to the platforms that
>>>>> use Device Trees now.
>>>>
>>>> Correct, we should update the commit message/docs.
>>>>
>>>>>
>>>>> Moreover, it is not consistent with the way we add devices to the ACPI PM
>>>>> domain, which is the ACPI counterpart of this.
>>>>
>>>> I am not sure why you think consistency for ACPI is important here.
>>>> ACPI PM will still be able to handle it's domain/device registering as
>>>> before. There are even other pm_domains that don't use genpd which
>>>> need to handle this themselves.
>>>
>>> My point is that doing things like that in different places for different
>>> firmware interfaces is confusing and likely to lead to coding mistakes in
>>> the future.
>>>
>>>> Or are you saying that you prefer bus notifiers in favour of making
>>>> use of the driver core for this matter?
>>>
>>> Well, please grep for acpi_dev_pm_attach() and see where it is done.
>>> Surely not in drivers/base/dd.c.  Also I'm not sure why you're talking
>>> about bus notifiers in this context.
>>>
>>>> Shouldn't the driver core handle most of the common things for a device
>>>> driver?
>>>
>>> Common, yes.  Platform-specific, no.
>>>
>>>> Let's compare how the pinctrls are being managed in the driver core, for
>>>> example.
>>>
>>> pinctrl has Device Trees support only at the moment (as far as firmware
>>> interfaces go) and quite frankly I'm not sure if/how we'll need to change
>>> it to cover ACPI as well.
>>>
>>> But for power domains, please keep that stuff away from dd.c.  That is,
>>> unless Greg specifically disagrees with me and decides to apply this
>>> patch regardless. :-)
>> 
>> Nope, no disagreement from me toward you at all here, keep up the good
>> work :)
>
> OK, so proposed solution is to put this in:
>
> - platform_drv_probe(),
> - spi_drv_probe(),
> - i2c_device_probe(),
> - amba_probe(),
>
> ...
>
> - and any other bus type, which can have devices instantiated from DT.

Since this is a DT feature, what about calling
__pm_genpd_of_add_device()  when the power-domain nodes are discovered?

Kevin

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

* Re: [PATCH 20/24] dt: bindings: ux500: Add header for power domains specifiers
  2014-06-10 10:51   ` Ulf Hansson
@ 2014-06-11 18:19     ` Kevin Hilman
  -1 siblings, 0 replies; 92+ messages in thread
From: Kevin Hilman @ 2014-06-11 18:19 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm,
	linux-arm-kernel, Alan Stern, Greg Kroah-Hartman, Daniel Lezcano,
	Tomasz Figa, devicetree, Linus Walleij, Simon Horman,
	Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd, Philipp Zabel,
	Mark Brown

Ulf Hansson <ulf.hansson@linaro.org> writes:

-EMISSING_CHANGELOG

> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Tomasz Figa <tomasz.figa@gmail.com>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

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

* [PATCH 20/24] dt: bindings: ux500: Add header for power domains specifiers
@ 2014-06-11 18:19     ` Kevin Hilman
  0 siblings, 0 replies; 92+ messages in thread
From: Kevin Hilman @ 2014-06-11 18:19 UTC (permalink / raw)
  To: linux-arm-kernel

Ulf Hansson <ulf.hansson@linaro.org> writes:

-EMISSING_CHANGELOG

> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Tomasz Figa <tomasz.figa@gmail.com>
> Cc: devicetree at vger.kernel.org
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

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

* Re: [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
  2014-06-11 18:16               ` Kevin Hilman
@ 2014-06-11 18:19                 ` Tomasz Figa
  -1 siblings, 0 replies; 92+ messages in thread
From: Tomasz Figa @ 2014-06-11 18:19 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Ulf Hansson,
	Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm,
	linux-arm-kernel, Alan Stern, Daniel Lezcano, devicetree,
	Linus Walleij, Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim,
	Stephen Boyd, Philipp Zabel, Mark Brown, Tomasz Figa



On 11.06.2014 20:16, Kevin Hilman wrote:
> Tomasz Figa <tomasz.figa@gmail.com> writes:
> 
>> On 10.06.2014 23:27, Greg Kroah-Hartman wrote:
>>> On Tue, Jun 10, 2014 at 11:27:45PM +0200, Rafael J. Wysocki wrote:
>>>> On Tuesday, June 10, 2014 02:53:26 PM Ulf Hansson wrote:
>>>>> On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
>>>>>> On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>>>>>> From: Tomasz Figa <t.figa@samsung.com>
>>>>>>>
>>>>>>> On a number of platforms, devices are part of controllable power
>>>>>>> domains, which need to be enabled before such devices can be accessed
>>>>>>> and may be powered down when the device is idle to save some power.
>>>>>>> This means that on systems that support power domain control using
>>>>>>> generic power domains subsystem, it is necessary to add device to its
>>>>>>> power domain before binding a driver to it and remove it from its power
>>>>>>> domain after its driver is unbound to make sure that an unused device
>>>>>>> does not affect power domain state.
>>>>>>>
>>>>>>> Since this is not limited to particular busses and specific
>>>>>>> archs/platforms,
>>>>>>
>>>>>> Actually, this isn't correrct.  It is limited to the platforms that
>>>>>> use Device Trees now.
>>>>>
>>>>> Correct, we should update the commit message/docs.
>>>>>
>>>>>>
>>>>>> Moreover, it is not consistent with the way we add devices to the ACPI PM
>>>>>> domain, which is the ACPI counterpart of this.
>>>>>
>>>>> I am not sure why you think consistency for ACPI is important here.
>>>>> ACPI PM will still be able to handle it's domain/device registering as
>>>>> before. There are even other pm_domains that don't use genpd which
>>>>> need to handle this themselves.
>>>>
>>>> My point is that doing things like that in different places for different
>>>> firmware interfaces is confusing and likely to lead to coding mistakes in
>>>> the future.
>>>>
>>>>> Or are you saying that you prefer bus notifiers in favour of making
>>>>> use of the driver core for this matter?
>>>>
>>>> Well, please grep for acpi_dev_pm_attach() and see where it is done.
>>>> Surely not in drivers/base/dd.c.  Also I'm not sure why you're talking
>>>> about bus notifiers in this context.
>>>>
>>>>> Shouldn't the driver core handle most of the common things for a device
>>>>> driver?
>>>>
>>>> Common, yes.  Platform-specific, no.
>>>>
>>>>> Let's compare how the pinctrls are being managed in the driver core, for
>>>>> example.
>>>>
>>>> pinctrl has Device Trees support only at the moment (as far as firmware
>>>> interfaces go) and quite frankly I'm not sure if/how we'll need to change
>>>> it to cover ACPI as well.
>>>>
>>>> But for power domains, please keep that stuff away from dd.c.  That is,
>>>> unless Greg specifically disagrees with me and decides to apply this
>>>> patch regardless. :-)
>>>
>>> Nope, no disagreement from me toward you at all here, keep up the good
>>> work :)
>>
>> OK, so proposed solution is to put this in:
>>
>> - platform_drv_probe(),
>> - spi_drv_probe(),
>> - i2c_device_probe(),
>> - amba_probe(),
>>
>> ...
>>
>> - and any other bus type, which can have devices instantiated from DT.
> 
> Since this is a DT feature, what about calling
> __pm_genpd_of_add_device()  when the power-domain nodes are discovered?

I'm not sure how this would work. Could you elaborate on this?

Best regards,
Tomasz

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

* [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
@ 2014-06-11 18:19                 ` Tomasz Figa
  0 siblings, 0 replies; 92+ messages in thread
From: Tomasz Figa @ 2014-06-11 18:19 UTC (permalink / raw)
  To: linux-arm-kernel



On 11.06.2014 20:16, Kevin Hilman wrote:
> Tomasz Figa <tomasz.figa@gmail.com> writes:
> 
>> On 10.06.2014 23:27, Greg Kroah-Hartman wrote:
>>> On Tue, Jun 10, 2014 at 11:27:45PM +0200, Rafael J. Wysocki wrote:
>>>> On Tuesday, June 10, 2014 02:53:26 PM Ulf Hansson wrote:
>>>>> On 10 June 2014 14:11, Rafael J. Wysocki <rafael@kernel.org> wrote:
>>>>>> On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>>>>>> From: Tomasz Figa <t.figa@samsung.com>
>>>>>>>
>>>>>>> On a number of platforms, devices are part of controllable power
>>>>>>> domains, which need to be enabled before such devices can be accessed
>>>>>>> and may be powered down when the device is idle to save some power.
>>>>>>> This means that on systems that support power domain control using
>>>>>>> generic power domains subsystem, it is necessary to add device to its
>>>>>>> power domain before binding a driver to it and remove it from its power
>>>>>>> domain after its driver is unbound to make sure that an unused device
>>>>>>> does not affect power domain state.
>>>>>>>
>>>>>>> Since this is not limited to particular busses and specific
>>>>>>> archs/platforms,
>>>>>>
>>>>>> Actually, this isn't correrct.  It is limited to the platforms that
>>>>>> use Device Trees now.
>>>>>
>>>>> Correct, we should update the commit message/docs.
>>>>>
>>>>>>
>>>>>> Moreover, it is not consistent with the way we add devices to the ACPI PM
>>>>>> domain, which is the ACPI counterpart of this.
>>>>>
>>>>> I am not sure why you think consistency for ACPI is important here.
>>>>> ACPI PM will still be able to handle it's domain/device registering as
>>>>> before. There are even other pm_domains that don't use genpd which
>>>>> need to handle this themselves.
>>>>
>>>> My point is that doing things like that in different places for different
>>>> firmware interfaces is confusing and likely to lead to coding mistakes in
>>>> the future.
>>>>
>>>>> Or are you saying that you prefer bus notifiers in favour of making
>>>>> use of the driver core for this matter?
>>>>
>>>> Well, please grep for acpi_dev_pm_attach() and see where it is done.
>>>> Surely not in drivers/base/dd.c.  Also I'm not sure why you're talking
>>>> about bus notifiers in this context.
>>>>
>>>>> Shouldn't the driver core handle most of the common things for a device
>>>>> driver?
>>>>
>>>> Common, yes.  Platform-specific, no.
>>>>
>>>>> Let's compare how the pinctrls are being managed in the driver core, for
>>>>> example.
>>>>
>>>> pinctrl has Device Trees support only at the moment (as far as firmware
>>>> interfaces go) and quite frankly I'm not sure if/how we'll need to change
>>>> it to cover ACPI as well.
>>>>
>>>> But for power domains, please keep that stuff away from dd.c.  That is,
>>>> unless Greg specifically disagrees with me and decides to apply this
>>>> patch regardless. :-)
>>>
>>> Nope, no disagreement from me toward you at all here, keep up the good
>>> work :)
>>
>> OK, so proposed solution is to put this in:
>>
>> - platform_drv_probe(),
>> - spi_drv_probe(),
>> - i2c_device_probe(),
>> - amba_probe(),
>>
>> ...
>>
>> - and any other bus type, which can have devices instantiated from DT.
> 
> Since this is a DT feature, what about calling
> __pm_genpd_of_add_device()  when the power-domain nodes are discovered?

I'm not sure how this would work. Could you elaborate on this?

Best regards,
Tomasz

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

* Re: [PATCH 19/24] dt: bindings: ux500: Add documentation for power domains
  2014-06-10 10:51   ` Ulf Hansson
@ 2014-06-11 18:20     ` Kevin Hilman
  -1 siblings, 0 replies; 92+ messages in thread
From: Kevin Hilman @ 2014-06-11 18:20 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm,
	linux-arm-kernel, Alan Stern, Greg Kroah-Hartman, Daniel Lezcano,
	Tomasz Figa, devicetree, Linus Walleij, Simon Horman,
	Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd, Philipp Zabel,
	Mark Brown

Ulf Hansson <ulf.hansson@linaro.org> writes:

-EMISSING_CHANGELOG

> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Tomasz Figa <tomasz.figa@gmail.com>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

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

* [PATCH 19/24] dt: bindings: ux500: Add documentation for power domains
@ 2014-06-11 18:20     ` Kevin Hilman
  0 siblings, 0 replies; 92+ messages in thread
From: Kevin Hilman @ 2014-06-11 18:20 UTC (permalink / raw)
  To: linux-arm-kernel

Ulf Hansson <ulf.hansson@linaro.org> writes:

-EMISSING_CHANGELOG

> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Tomasz Figa <tomasz.figa@gmail.com>
> Cc: devicetree at vger.kernel.org
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

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

* Re: [PATCH 00/24] PM / Domains: Generic OF-based support and cleanups
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-06-11 18:23   ` Kevin Hilman
  -1 siblings, 0 replies; 92+ messages in thread
From: Kevin Hilman @ 2014-06-11 18:23 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm,
	linux-arm-kernel, Alan Stern, Greg Kroah-Hartman, Daniel Lezcano,
	Tomasz Figa, devicetree, Linus Walleij, Simon Horman,
	Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd, Philipp Zabel,
	Mark Brown

Ulf Hansson <ulf.hansson@linaro.org> writes:

> Parts of this patchset has been posted earlier. To be able to smoothly continue
> my work in re-factoring genpd I have collected patches into this patchset.
>
> The complete patchset is available at the linux-pm_linux-next_genpd branch at:
> git.linaro.org/people/ulf.hansson/linux-2.6.git
> This branch is based upon Rafael's linux-pm tree's linux-next branch.
>
> And important note. There are dependencies througout this patchset, which means
> the all need to go together. I suggest we use Rafael's tree, thus I seek for
> acks from the affected ARM SoC maintainers.

At least on the surface, there are at least 3 separate series going on
here

1) DT support for genpd
2) various genpd cleanups
3) ux500 support

Clearly they are related, but it would be easier to review if a large
series like this is broken up into smaller series where the cover
letters describe the dependencies between them

Kevin

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

* [PATCH 00/24] PM / Domains: Generic OF-based support and cleanups
@ 2014-06-11 18:23   ` Kevin Hilman
  0 siblings, 0 replies; 92+ messages in thread
From: Kevin Hilman @ 2014-06-11 18:23 UTC (permalink / raw)
  To: linux-arm-kernel

Ulf Hansson <ulf.hansson@linaro.org> writes:

> Parts of this patchset has been posted earlier. To be able to smoothly continue
> my work in re-factoring genpd I have collected patches into this patchset.
>
> The complete patchset is available at the linux-pm_linux-next_genpd branch at:
> git.linaro.org/people/ulf.hansson/linux-2.6.git
> This branch is based upon Rafael's linux-pm tree's linux-next branch.
>
> And important note. There are dependencies througout this patchset, which means
> the all need to go together. I suggest we use Rafael's tree, thus I seek for
> acks from the affected ARM SoC maintainers.

At least on the surface, there are at least 3 separate series going on
here

1) DT support for genpd
2) various genpd cleanups
3) ux500 support

Clearly they are related, but it would be easier to review if a large
series like this is broken up into smaller series where the cover
letters describe the dependencies between them

Kevin

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

* Re: [PATCH 00/24] PM / Domains: Generic OF-based support and cleanups
  2014-06-11 18:23   ` Kevin Hilman
@ 2014-06-11 18:32     ` Rafael J. Wysocki
  -1 siblings, 0 replies; 92+ messages in thread
From: Rafael J. Wysocki @ 2014-06-11 18:32 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Ulf Hansson, Rafael J. Wysocki, Len Brown, Pavel Machek,
	linux-pm, linux-arm-kernel, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Tomasz Figa

On Wed, Jun 11, 2014 at 8:23 PM, Kevin Hilman <khilman@linaro.org> wrote:
> Ulf Hansson <ulf.hansson@linaro.org> writes:
>
>> Parts of this patchset has been posted earlier. To be able to smoothly continue
>> my work in re-factoring genpd I have collected patches into this patchset.
>>
>> The complete patchset is available at the linux-pm_linux-next_genpd branch at:
>> git.linaro.org/people/ulf.hansson/linux-2.6.git
>> This branch is based upon Rafael's linux-pm tree's linux-next branch.
>>
>> And important note. There are dependencies througout this patchset, which means
>> the all need to go together. I suggest we use Rafael's tree, thus I seek for
>> acks from the affected ARM SoC maintainers.
>
> At least on the surface, there are at least 3 separate series going on
> here
>
> 1) DT support for genpd
> 2) various genpd cleanups
> 3) ux500 support
>
> Clearly they are related, but it would be easier to review if a large
> series like this is broken up into smaller series where the cover
> letters describe the dependencies between them

Agreed.

And if they are sent in such an order that the bits the rest depends on
go first and are settled before the next series is even submitted.

Rafael

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

* [PATCH 00/24] PM / Domains: Generic OF-based support and cleanups
@ 2014-06-11 18:32     ` Rafael J. Wysocki
  0 siblings, 0 replies; 92+ messages in thread
From: Rafael J. Wysocki @ 2014-06-11 18:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 11, 2014 at 8:23 PM, Kevin Hilman <khilman@linaro.org> wrote:
> Ulf Hansson <ulf.hansson@linaro.org> writes:
>
>> Parts of this patchset has been posted earlier. To be able to smoothly continue
>> my work in re-factoring genpd I have collected patches into this patchset.
>>
>> The complete patchset is available at the linux-pm_linux-next_genpd branch at:
>> git.linaro.org/people/ulf.hansson/linux-2.6.git
>> This branch is based upon Rafael's linux-pm tree's linux-next branch.
>>
>> And important note. There are dependencies througout this patchset, which means
>> the all need to go together. I suggest we use Rafael's tree, thus I seek for
>> acks from the affected ARM SoC maintainers.
>
> At least on the surface, there are at least 3 separate series going on
> here
>
> 1) DT support for genpd
> 2) various genpd cleanups
> 3) ux500 support
>
> Clearly they are related, but it would be easier to review if a large
> series like this is broken up into smaller series where the cover
> letters describe the dependencies between them

Agreed.

And if they are sent in such an order that the bits the rest depends on
go first and are settled before the next series is even submitted.

Rafael

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

* Re: [PATCH 00/24] PM / Domains: Generic OF-based support and cleanups
  2014-06-11 18:32     ` Rafael J. Wysocki
@ 2014-06-11 20:21       ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-11 20:21 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Kevin Hilman, Rafael J. Wysocki, Len Brown, Pavel Machek,
	linux-pm, linux-arm-kernel, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown, Tomasz Figa

On 11 June 2014 20:32, Rafael J. Wysocki <rafael@kernel.org> wrote:
> On Wed, Jun 11, 2014 at 8:23 PM, Kevin Hilman <khilman@linaro.org> wrote:
>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>>
>>> Parts of this patchset has been posted earlier. To be able to smoothly continue
>>> my work in re-factoring genpd I have collected patches into this patchset.
>>>
>>> The complete patchset is available at the linux-pm_linux-next_genpd branch at:
>>> git.linaro.org/people/ulf.hansson/linux-2.6.git
>>> This branch is based upon Rafael's linux-pm tree's linux-next branch.
>>>
>>> And important note. There are dependencies througout this patchset, which means
>>> the all need to go together. I suggest we use Rafael's tree, thus I seek for
>>> acks from the affected ARM SoC maintainers.
>>
>> At least on the surface, there are at least 3 separate series going on
>> here
>>
>> 1) DT support for genpd
>> 2) various genpd cleanups
>> 3) ux500 support
>>
>> Clearly they are related, but it would be easier to review if a large
>> series like this is broken up into smaller series where the cover
>> letters describe the dependencies between them
>
> Agreed.
>
> And if they are sent in such an order that the bits the rest depends on
> go first and are settled before the next series is even submitted.

Right. Let me split it up and resend.

Also, note - the reason for adding the ux500 genpd support in this
patchset, was to provide an example of how the new DT bindings would
be used.

Kind regards
Ulf Hansson

>
> Rafael

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

* [PATCH 00/24] PM / Domains: Generic OF-based support and cleanups
@ 2014-06-11 20:21       ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-11 20:21 UTC (permalink / raw)
  To: linux-arm-kernel

On 11 June 2014 20:32, Rafael J. Wysocki <rafael@kernel.org> wrote:
> On Wed, Jun 11, 2014 at 8:23 PM, Kevin Hilman <khilman@linaro.org> wrote:
>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>>
>>> Parts of this patchset has been posted earlier. To be able to smoothly continue
>>> my work in re-factoring genpd I have collected patches into this patchset.
>>>
>>> The complete patchset is available at the linux-pm_linux-next_genpd branch at:
>>> git.linaro.org/people/ulf.hansson/linux-2.6.git
>>> This branch is based upon Rafael's linux-pm tree's linux-next branch.
>>>
>>> And important note. There are dependencies througout this patchset, which means
>>> the all need to go together. I suggest we use Rafael's tree, thus I seek for
>>> acks from the affected ARM SoC maintainers.
>>
>> At least on the surface, there are at least 3 separate series going on
>> here
>>
>> 1) DT support for genpd
>> 2) various genpd cleanups
>> 3) ux500 support
>>
>> Clearly they are related, but it would be easier to review if a large
>> series like this is broken up into smaller series where the cover
>> letters describe the dependencies between them
>
> Agreed.
>
> And if they are sent in such an order that the bits the rest depends on
> go first and are settled before the next series is even submitted.

Right. Let me split it up and resend.

Also, note - the reason for adding the ux500 genpd support in this
patchset, was to provide an example of how the new DT bindings would
be used.

Kind regards
Ulf Hansson

>
> Rafael

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

* Re: [PATCH 07/24] ARM: shmobile: Drop dev_irq_safe from r8a7779 genpd config
  2014-06-11 18:13     ` Kevin Hilman
@ 2014-06-11 20:34       ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-11 20:34 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm,
	linux-arm-kernel, Alan Stern, Greg Kroah-Hartman, Daniel Lezcano,
	Tomasz Figa, devicetree, Linus Walleij, Simon Horman,
	Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd, Philipp Zabel,
	Mark Brown

On 11 June 2014 20:13, Kevin Hilman <khilman@linaro.org> wrote:
> Ulf Hansson <ulf.hansson@linaro.org> writes:
>
>> The dev_irq_safe configuration is redundant, genpd don't have any
>> special treatmeant for handling it.  Let's remove it.
>
> Why?
>
> The genpd core needs to handle irq_safe properly eventully (right now it
> just doesn't call power_off/power_on callbacks, but that needs to be
> implmenented.  c.f commit 0aa2a22169)
>
> If we remove these flags from platforms, we're taking away information
> that the platform maintainers have specified tha will be useful when
> full support is avialble.

For sure this is needed in _some_ form. But before we even figured out
how to support irq_safe genpd's, why even bother to support a
configuration for it?

Currently I think it good enough to use the per device irq_safe
option, and then let's see how handling of these devices evolves.

Kind regards
Uffe

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

* [PATCH 07/24] ARM: shmobile: Drop dev_irq_safe from r8a7779 genpd config
@ 2014-06-11 20:34       ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-06-11 20:34 UTC (permalink / raw)
  To: linux-arm-kernel

On 11 June 2014 20:13, Kevin Hilman <khilman@linaro.org> wrote:
> Ulf Hansson <ulf.hansson@linaro.org> writes:
>
>> The dev_irq_safe configuration is redundant, genpd don't have any
>> special treatmeant for handling it.  Let's remove it.
>
> Why?
>
> The genpd core needs to handle irq_safe properly eventully (right now it
> just doesn't call power_off/power_on callbacks, but that needs to be
> implmenented.  c.f commit 0aa2a22169)
>
> If we remove these flags from platforms, we're taking away information
> that the platform maintainers have specified tha will be useful when
> full support is avialble.

For sure this is needed in _some_ form. But before we even figured out
how to support irq_safe genpd's, why even bother to support a
configuration for it?

Currently I think it good enough to use the per device irq_safe
option, and then let's see how handling of these devices evolves.

Kind regards
Uffe

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

* Re: [PATCH 19/24] dt: bindings: ux500: Add documentation for power domains
  2014-06-11 18:20     ` Kevin Hilman
@ 2014-06-12 10:26       ` Pavel Machek
  -1 siblings, 0 replies; 92+ messages in thread
From: Pavel Machek @ 2014-06-12 10:26 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Ulf Hansson, Rafael J. Wysocki, Len Brown, linux-pm,
	linux-arm-kernel, Alan Stern, Greg Kroah-Hartman, Daniel Lezcano,
	Tomasz Figa, devicetree, Linus Walleij, Simon Horman,
	Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd, Philipp Zabel,
	Mark Brown

On Wed 2014-06-11 11:20:03, Kevin Hilman wrote:
> Ulf Hansson <ulf.hansson@linaro.org> writes:
> 
> -EMISSING_CHANGELOG

-EBAD_REVIEW

Subject says it all, it adds documentation, what more would you like
to see in the changelog?

Lets not make patch submission harder than it needs to be...

									Pavel

> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Tomasz Figa <tomasz.figa@gmail.com>
> > Cc: devicetree@vger.kernel.org
> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

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

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

* [PATCH 19/24] dt: bindings: ux500: Add documentation for power domains
@ 2014-06-12 10:26       ` Pavel Machek
  0 siblings, 0 replies; 92+ messages in thread
From: Pavel Machek @ 2014-06-12 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed 2014-06-11 11:20:03, Kevin Hilman wrote:
> Ulf Hansson <ulf.hansson@linaro.org> writes:
> 
> -EMISSING_CHANGELOG

-EBAD_REVIEW

Subject says it all, it adds documentation, what more would you like
to see in the changelog?

Lets not make patch submission harder than it needs to be...

									Pavel

> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Tomasz Figa <tomasz.figa@gmail.com>
> > Cc: devicetree at vger.kernel.org
> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

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

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

* Re: [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
  2014-06-11  0:18               ` Rafael J. Wysocki
@ 2014-06-12 16:39                 ` Mark Brown
  -1 siblings, 0 replies; 92+ messages in thread
From: Mark Brown @ 2014-06-12 16:39 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Tomasz Figa, Greg Kroah-Hartman, Ulf Hansson, Rafael J. Wysocki,
	Len Brown, Pavel Machek, linux-pm, linux-arm-kernel,
	Kevin Hilman, Alan Stern, Daniel Lezcano, devicetree,
	Linus Walleij, Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim,
	Stephen Boyd, Philipp Zabel, Tomasz Figa

[-- Attachment #1: Type: text/plain, Size: 629 bytes --]

On Wed, Jun 11, 2014 at 02:18:44AM +0200, Rafael J. Wysocki wrote:
> On Tuesday, June 10, 2014 11:42:25 PM Tomasz Figa wrote:

> > OK, so proposed solution is to put this in:

> > - platform_drv_probe(),
> > - spi_drv_probe(),
> > - i2c_device_probe(),
> > - amba_probe(),

> Yes.  Specifically, those are bus types that don't do their own power
> management.

This sounds tedious.  Can we not instead introduce some generic helpers
which all such buses call/use and then implement the hooks in there
(along with anything else that they should all do)?  There must be other
things that all these buses are having to cut'n'paste.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
@ 2014-06-12 16:39                 ` Mark Brown
  0 siblings, 0 replies; 92+ messages in thread
From: Mark Brown @ 2014-06-12 16:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 11, 2014 at 02:18:44AM +0200, Rafael J. Wysocki wrote:
> On Tuesday, June 10, 2014 11:42:25 PM Tomasz Figa wrote:

> > OK, so proposed solution is to put this in:

> > - platform_drv_probe(),
> > - spi_drv_probe(),
> > - i2c_device_probe(),
> > - amba_probe(),

> Yes.  Specifically, those are bus types that don't do their own power
> management.

This sounds tedious.  Can we not instead introduce some generic helpers
which all such buses call/use and then implement the hooks in there
(along with anything else that they should all do)?  There must be other
things that all these buses are having to cut'n'paste.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140612/60325df9/attachment-0001.sig>

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

* Re: [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
  2014-06-12 16:39                 ` Mark Brown
@ 2014-06-12 19:33                   ` Rafael Wysocki
  -1 siblings, 0 replies; 92+ messages in thread
From: Rafael Wysocki @ 2014-06-12 19:33 UTC (permalink / raw)
  To: Mark Brown
  Cc: Rafael J. Wysocki, Tomasz Figa, Greg Kroah-Hartman, Ulf Hansson,
	Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm,
	linux-arm-kernel, Kevin Hilman, Alan Stern, Daniel Lezcano,
	devicetree, Linus Walleij, Simon Horman, Magnus Damm, Ben Dooks,
	Kukjin Kim, Stephen Boyd, Philipp Zabel, Tomasz Figa

On Thu, Jun 12, 2014 at 6:39 PM, Mark Brown <broonie@kernel.org> wrote:
> On Wed, Jun 11, 2014 at 02:18:44AM +0200, Rafael J. Wysocki wrote:
>> On Tuesday, June 10, 2014 11:42:25 PM Tomasz Figa wrote:
>
>> > OK, so proposed solution is to put this in:
>
>> > - platform_drv_probe(),
>> > - spi_drv_probe(),
>> > - i2c_device_probe(),
>> > - amba_probe(),
>
>> Yes.  Specifically, those are bus types that don't do their own power
>> management.
>
> This sounds tedious.  Can we not instead introduce some generic helpers
> which all such buses call/use and then implement the hooks in there
> (along with anything else that they should all do)?

Well, good idea.

> There must be other things that all these buses are having to cut'n'paste.

Quite likely.

Rafael

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

* [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove
@ 2014-06-12 19:33                   ` Rafael Wysocki
  0 siblings, 0 replies; 92+ messages in thread
From: Rafael Wysocki @ 2014-06-12 19:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 12, 2014 at 6:39 PM, Mark Brown <broonie@kernel.org> wrote:
> On Wed, Jun 11, 2014 at 02:18:44AM +0200, Rafael J. Wysocki wrote:
>> On Tuesday, June 10, 2014 11:42:25 PM Tomasz Figa wrote:
>
>> > OK, so proposed solution is to put this in:
>
>> > - platform_drv_probe(),
>> > - spi_drv_probe(),
>> > - i2c_device_probe(),
>> > - amba_probe(),
>
>> Yes.  Specifically, those are bus types that don't do their own power
>> management.
>
> This sounds tedious.  Can we not instead introduce some generic helpers
> which all such buses call/use and then implement the hooks in there
> (along with anything else that they should all do)?

Well, good idea.

> There must be other things that all these buses are having to cut'n'paste.

Quite likely.

Rafael

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

* Re: [PATCH 00/24] PM / Domains: Generic OF-based support and cleanups
  2014-06-10 10:51 ` Ulf Hansson
@ 2014-08-22 12:15   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 92+ messages in thread
From: Geert Uytterhoeven @ 2014-08-22 12:15 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Linux PM list,
	linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown

Hi Ulf, Tomasz,

On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> Parts of this patchset has been posted earlier. To be able to smoothly continue
> my work in re-factoring genpd I have collected patches into this patchset.
>
> The complete patchset is available at the linux-pm_linux-next_genpd branch at:
> git.linaro.org/people/ulf.hansson/linux-2.6.git
> This branch is based upon Rafael's linux-pm tree's linux-next branch.
>
> And important note. There are dependencies througout this patchset, which means
> the all need to go together. I suggest we use Rafael's tree, thus I seek for
> acks from the affected ARM SoC maintainers.
>
> Tomasz Figa (3):
>   base: power: Add generic OF-based power domain look-up
>   drivercore: Bind/unbind power domain on probe/remove
>   ARM: exynos: Move to generic power domain bindings
>
> Ulf Hansson (21):
>   PM / Domains: Ignore callbacks for subsys generic_pm_domain_data
>   PM / Domains: Remove the pm_genpd_add|remove_callbacks APIs
>   PM / Domains: Remove system PM callbacks from gpd_dev_ops
>   ARM: shmobile: Drop dev_irq_safe from r8a7779 genpd config
>   ARM: shmobile: Drop dev_irq_safe from R-mobile genpd config
>   PM / Domains: Remove dev_irq_safe from genpd config
>   PM / Domains: Remove redundant check for CONFIG_PM
>   PM / Domains: Remove legacy API for adding devices through DT
>   PM / Domains: Remove pm_genpd_syscore_switch() API
>   PM / Domains: Remove genpd_queue_power_off_work() API
>   PM / Domains: Add late_initcall to disable unused domains
>   ARM: exynos: Leave disabling of unused pm domains to genpd
>   ARM: s3c64xx: Leave disabling of unused pm domains to genpd
>   drivers: sh: Leave disabling of unused pm domains to genpd
>   PM / Domains: Remove default_stop_ok() API
>   dt: bindings: ux500: Add documentation for power domains
>   dt: bindings: ux500: Add header for power domains specifiers
>   ARM: ux500: Initial support for power domains
>   ARM: ux500: Enable Kconfig for the generic power domain
>   ARM: ux500: Add DT node for ux500 power domains
>   ARM: ux500: Add sdi[n] devices to VAPE power domain

What are your plans with this patch series?

Thanks!

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

* [PATCH 00/24] PM / Domains: Generic OF-based support and cleanups
@ 2014-08-22 12:15   ` Geert Uytterhoeven
  0 siblings, 0 replies; 92+ messages in thread
From: Geert Uytterhoeven @ 2014-08-22 12:15 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Ulf, Tomasz,

On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> Parts of this patchset has been posted earlier. To be able to smoothly continue
> my work in re-factoring genpd I have collected patches into this patchset.
>
> The complete patchset is available at the linux-pm_linux-next_genpd branch at:
> git.linaro.org/people/ulf.hansson/linux-2.6.git
> This branch is based upon Rafael's linux-pm tree's linux-next branch.
>
> And important note. There are dependencies througout this patchset, which means
> the all need to go together. I suggest we use Rafael's tree, thus I seek for
> acks from the affected ARM SoC maintainers.
>
> Tomasz Figa (3):
>   base: power: Add generic OF-based power domain look-up
>   drivercore: Bind/unbind power domain on probe/remove
>   ARM: exynos: Move to generic power domain bindings
>
> Ulf Hansson (21):
>   PM / Domains: Ignore callbacks for subsys generic_pm_domain_data
>   PM / Domains: Remove the pm_genpd_add|remove_callbacks APIs
>   PM / Domains: Remove system PM callbacks from gpd_dev_ops
>   ARM: shmobile: Drop dev_irq_safe from r8a7779 genpd config
>   ARM: shmobile: Drop dev_irq_safe from R-mobile genpd config
>   PM / Domains: Remove dev_irq_safe from genpd config
>   PM / Domains: Remove redundant check for CONFIG_PM
>   PM / Domains: Remove legacy API for adding devices through DT
>   PM / Domains: Remove pm_genpd_syscore_switch() API
>   PM / Domains: Remove genpd_queue_power_off_work() API
>   PM / Domains: Add late_initcall to disable unused domains
>   ARM: exynos: Leave disabling of unused pm domains to genpd
>   ARM: s3c64xx: Leave disabling of unused pm domains to genpd
>   drivers: sh: Leave disabling of unused pm domains to genpd
>   PM / Domains: Remove default_stop_ok() API
>   dt: bindings: ux500: Add documentation for power domains
>   dt: bindings: ux500: Add header for power domains specifiers
>   ARM: ux500: Initial support for power domains
>   ARM: ux500: Enable Kconfig for the generic power domain
>   ARM: ux500: Add DT node for ux500 power domains
>   ARM: ux500: Add sdi[n] devices to VAPE power domain

What are your plans with this patch series?

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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] 92+ messages in thread

* Re: [PATCH 00/24] PM / Domains: Generic OF-based support and cleanups
  2014-08-22 12:15   ` Geert Uytterhoeven
@ 2014-08-22 15:56     ` Ulf Hansson
  -1 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-08-22 15:56 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Linux PM list,
	linux-arm-kernel, Kevin Hilman, Alan Stern, Greg Kroah-Hartman,
	Daniel Lezcano, Tomasz Figa, devicetree, Linus Walleij,
	Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd,
	Philipp Zabel, Mark Brown

On 22 August 2014 14:15, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Hi Ulf, Tomasz,
>
> On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> Parts of this patchset has been posted earlier. To be able to smoothly continue
>> my work in re-factoring genpd I have collected patches into this patchset.
>>
>> The complete patchset is available at the linux-pm_linux-next_genpd branch at:
>> git.linaro.org/people/ulf.hansson/linux-2.6.git
>> This branch is based upon Rafael's linux-pm tree's linux-next branch.
>>
>> And important note. There are dependencies througout this patchset, which means
>> the all need to go together. I suggest we use Rafael's tree, thus I seek for
>> acks from the affected ARM SoC maintainers.
>>
>> Tomasz Figa (3):
>>   base: power: Add generic OF-based power domain look-up
>>   drivercore: Bind/unbind power domain on probe/remove
>>   ARM: exynos: Move to generic power domain bindings
>>
>> Ulf Hansson (21):
>>   PM / Domains: Ignore callbacks for subsys generic_pm_domain_data
>>   PM / Domains: Remove the pm_genpd_add|remove_callbacks APIs
>>   PM / Domains: Remove system PM callbacks from gpd_dev_ops
>>   ARM: shmobile: Drop dev_irq_safe from r8a7779 genpd config
>>   ARM: shmobile: Drop dev_irq_safe from R-mobile genpd config
>>   PM / Domains: Remove dev_irq_safe from genpd config
>>   PM / Domains: Remove redundant check for CONFIG_PM
>>   PM / Domains: Remove legacy API for adding devices through DT
>>   PM / Domains: Remove pm_genpd_syscore_switch() API
>>   PM / Domains: Remove genpd_queue_power_off_work() API
>>   PM / Domains: Add late_initcall to disable unused domains
>>   ARM: exynos: Leave disabling of unused pm domains to genpd
>>   ARM: s3c64xx: Leave disabling of unused pm domains to genpd
>>   drivers: sh: Leave disabling of unused pm domains to genpd
>>   PM / Domains: Remove default_stop_ok() API
>>   dt: bindings: ux500: Add documentation for power domains
>>   dt: bindings: ux500: Add header for power domains specifiers
>>   ARM: ux500: Initial support for power domains
>>   ARM: ux500: Enable Kconfig for the generic power domain
>>   ARM: ux500: Add DT node for ux500 power domains
>>   ARM: ux500: Add sdi[n] devices to VAPE power domain
>
> What are your plans with this patch series?
>
> Thanks!

I have been working on the generic power domain DT parts. It needs
some more tests, but will for sure post and new patchset early next
week.

Then there are two more separate series:
1.. "The genpd cleanup/small-fixes" - I will also post this soon,
re-based and separate from the other series.
2. "Genpd support for ux500" - I will keep this one on hold, until the
generic power domain DT patchset has been accepted.

Kind regards
Uffe

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

* [PATCH 00/24] PM / Domains: Generic OF-based support and cleanups
@ 2014-08-22 15:56     ` Ulf Hansson
  0 siblings, 0 replies; 92+ messages in thread
From: Ulf Hansson @ 2014-08-22 15:56 UTC (permalink / raw)
  To: linux-arm-kernel

On 22 August 2014 14:15, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Hi Ulf, Tomasz,
>
> On Tue, Jun 10, 2014 at 12:51 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> Parts of this patchset has been posted earlier. To be able to smoothly continue
>> my work in re-factoring genpd I have collected patches into this patchset.
>>
>> The complete patchset is available at the linux-pm_linux-next_genpd branch at:
>> git.linaro.org/people/ulf.hansson/linux-2.6.git
>> This branch is based upon Rafael's linux-pm tree's linux-next branch.
>>
>> And important note. There are dependencies througout this patchset, which means
>> the all need to go together. I suggest we use Rafael's tree, thus I seek for
>> acks from the affected ARM SoC maintainers.
>>
>> Tomasz Figa (3):
>>   base: power: Add generic OF-based power domain look-up
>>   drivercore: Bind/unbind power domain on probe/remove
>>   ARM: exynos: Move to generic power domain bindings
>>
>> Ulf Hansson (21):
>>   PM / Domains: Ignore callbacks for subsys generic_pm_domain_data
>>   PM / Domains: Remove the pm_genpd_add|remove_callbacks APIs
>>   PM / Domains: Remove system PM callbacks from gpd_dev_ops
>>   ARM: shmobile: Drop dev_irq_safe from r8a7779 genpd config
>>   ARM: shmobile: Drop dev_irq_safe from R-mobile genpd config
>>   PM / Domains: Remove dev_irq_safe from genpd config
>>   PM / Domains: Remove redundant check for CONFIG_PM
>>   PM / Domains: Remove legacy API for adding devices through DT
>>   PM / Domains: Remove pm_genpd_syscore_switch() API
>>   PM / Domains: Remove genpd_queue_power_off_work() API
>>   PM / Domains: Add late_initcall to disable unused domains
>>   ARM: exynos: Leave disabling of unused pm domains to genpd
>>   ARM: s3c64xx: Leave disabling of unused pm domains to genpd
>>   drivers: sh: Leave disabling of unused pm domains to genpd
>>   PM / Domains: Remove default_stop_ok() API
>>   dt: bindings: ux500: Add documentation for power domains
>>   dt: bindings: ux500: Add header for power domains specifiers
>>   ARM: ux500: Initial support for power domains
>>   ARM: ux500: Enable Kconfig for the generic power domain
>>   ARM: ux500: Add DT node for ux500 power domains
>>   ARM: ux500: Add sdi[n] devices to VAPE power domain
>
> What are your plans with this patch series?
>
> Thanks!

I have been working on the generic power domain DT parts. It needs
some more tests, but will for sure post and new patchset early next
week.

Then there are two more separate series:
1.. "The genpd cleanup/small-fixes" - I will also post this soon,
re-based and separate from the other series.
2. "Genpd support for ux500" - I will keep this one on hold, until the
generic power domain DT patchset has been accepted.

Kind regards
Uffe

>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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] 92+ messages in thread

end of thread, other threads:[~2014-08-22 15:56 UTC | newest]

Thread overview: 92+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-10 10:51 [PATCH 00/24] PM / Domains: Generic OF-based support and cleanups Ulf Hansson
2014-06-10 10:51 ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 01/24] base: power: Add generic OF-based power domain look-up Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 02/24] drivercore: Bind/unbind power domain on probe/remove Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 12:11   ` Rafael J. Wysocki
2014-06-10 12:11     ` Rafael J. Wysocki
2014-06-10 12:53     ` Ulf Hansson
2014-06-10 12:53       ` Ulf Hansson
2014-06-10 21:27       ` Rafael J. Wysocki
2014-06-10 21:27         ` Rafael J. Wysocki
2014-06-10 21:27         ` Greg Kroah-Hartman
2014-06-10 21:27           ` Greg Kroah-Hartman
2014-06-10 21:42           ` Tomasz Figa
2014-06-10 21:42             ` Tomasz Figa
2014-06-10 22:15             ` Ulf Hansson
2014-06-10 22:15               ` Ulf Hansson
2014-06-11  0:18             ` Rafael J. Wysocki
2014-06-11  0:18               ` Rafael J. Wysocki
2014-06-12 16:39               ` Mark Brown
2014-06-12 16:39                 ` Mark Brown
2014-06-12 19:33                 ` Rafael Wysocki
2014-06-12 19:33                   ` Rafael Wysocki
2014-06-11 18:16             ` Kevin Hilman
2014-06-11 18:16               ` Kevin Hilman
2014-06-11 18:19               ` Tomasz Figa
2014-06-11 18:19                 ` Tomasz Figa
2014-06-10 10:51 ` [PATCH 03/24] ARM: exynos: Move to generic power domain bindings Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 04/24] PM / Domains: Ignore callbacks for subsys generic_pm_domain_data Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 05/24] PM / Domains: Remove the pm_genpd_add|remove_callbacks APIs Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 06/24] PM / Domains: Remove system PM callbacks from gpd_dev_ops Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 07/24] ARM: shmobile: Drop dev_irq_safe from r8a7779 genpd config Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-11 18:13   ` Kevin Hilman
2014-06-11 18:13     ` Kevin Hilman
2014-06-11 20:34     ` Ulf Hansson
2014-06-11 20:34       ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 08/24] ARM: shmobile: Drop dev_irq_safe from R-mobile " Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 09/24] PM / Domains: Remove dev_irq_safe from " Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 10/24] PM / Domains: Remove redundant check for CONFIG_PM Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 11/24] PM / Domains: Remove legacy API for adding devices through DT Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 12/24] PM / Domains: Remove pm_genpd_syscore_switch() API Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 13/24] PM / Domains: Remove genpd_queue_power_off_work() API Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 14/24] PM / Domains: Add late_initcall to disable unused domains Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 15/24] ARM: exynos: Leave disabling of unused pm domains to genpd Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 16/24] ARM: s3c64xx: " Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 18/24] PM / Domains: Remove default_stop_ok() API Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 19/24] dt: bindings: ux500: Add documentation for power domains Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-11 18:20   ` Kevin Hilman
2014-06-11 18:20     ` Kevin Hilman
2014-06-12 10:26     ` Pavel Machek
2014-06-12 10:26       ` Pavel Machek
2014-06-10 10:51 ` [PATCH 20/24] dt: bindings: ux500: Add header for power domains specifiers Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-11 18:19   ` Kevin Hilman
2014-06-11 18:19     ` Kevin Hilman
     [not found] ` <1402397497-26737-1-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-06-10 10:51   ` [PATCH 17/24] drivers: sh: Leave disabling of unused pm domains to genpd Ulf Hansson
2014-06-10 10:51     ` Ulf Hansson
2014-06-10 10:51   ` [PATCH 21/24] ARM: ux500: Initial support for power domains Ulf Hansson
2014-06-10 10:51     ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 22/24] ARM: ux500: Enable Kconfig for the generic power domain Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 23/24] ARM: ux500: Add DT node for ux500 power domains Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-10 10:51 ` [PATCH 24/24] ARM: ux500: Add sdi[n] devices to VAPE power domain Ulf Hansson
2014-06-10 10:51   ` Ulf Hansson
2014-06-11 18:23 ` [PATCH 00/24] PM / Domains: Generic OF-based support and cleanups Kevin Hilman
2014-06-11 18:23   ` Kevin Hilman
2014-06-11 18:32   ` Rafael J. Wysocki
2014-06-11 18:32     ` Rafael J. Wysocki
2014-06-11 20:21     ` Ulf Hansson
2014-06-11 20:21       ` Ulf Hansson
2014-08-22 12:15 ` Geert Uytterhoeven
2014-08-22 12:15   ` Geert Uytterhoeven
2014-08-22 15:56   ` Ulf Hansson
2014-08-22 15:56     ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.