LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [RFC PATCH 0/1] PM / domains: Add support for virtual power domains
@ 2015-01-29 18:12 Karol Wrona
2015-01-29 18:12 ` [RFC PATCH 1/1] " Karol Wrona
0 siblings, 1 reply; 5+ messages in thread
From: Karol Wrona @ 2015-01-29 18:12 UTC (permalink / raw)
To: linux-pm, linux-kernel, devicetree
Cc: Rafael J. Wysocki, Amit Daniel Kachhap, Ulf Hansson,
Bartlomiej Zolnierkiewicz, Kyungmin Park, Karol Wrona,
Karol Wrona
Hello,
This patch adds virtual power domain handling. Some comments are needed if
such approach has any sense. The goal is to know the state of devices
residing in domain which is never gated or are gated only during sleep.
I.e. in Exynos3250 SoC there is one domain which is only put into retention
in LPD state and to enter it some devices (i.e. mmc host controller) have
to be inactive. Using domains and runtime PM it would be able to give
an information to PM core that the SoC is ready for deeper power state.
TODO: binding doc, add child-parent hierarchy
Thanks,
Karol
Karol Wrona (1):
PM / domains: Add support for virtual power domains
drivers/base/power/Makefile | 3 +-
drivers/base/power/pm_domains_virt.c | 54 ++++++++++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 1 deletion(-)
create mode 100644 drivers/base/power/pm_domains_virt.c
--
1.7.9.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFC PATCH 1/1] PM / domains: Add support for virtual power domains
2015-01-29 18:12 [RFC PATCH 0/1] PM / domains: Add support for virtual power domains Karol Wrona
@ 2015-01-29 18:12 ` Karol Wrona
2015-01-30 8:43 ` amit daniel kachhap
0 siblings, 1 reply; 5+ messages in thread
From: Karol Wrona @ 2015-01-29 18:12 UTC (permalink / raw)
To: linux-pm, linux-kernel, devicetree
Cc: Rafael J. Wysocki, Amit Daniel Kachhap, Ulf Hansson,
Bartlomiej Zolnierkiewicz, Kyungmin Park, Karol Wrona,
Karol Wrona
There are the power domains which are turned off or put to retention only during
suspend or special processor states. In such case there is a need to register
some devices which belong to such domain that PM core could know the state of
such devices and decide which power mode should be chosen i.e. the domain can
not be put to retention if some devices are active. Virtual power domain has
empty power_on/off callbacks as there is no need to gate anything.
Signed-off-by: Karol Wrona <k.wrona@samsung.com>
---
drivers/base/power/Makefile | 3 +-
drivers/base/power/pm_domains_virt.c | 54 ++++++++++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 1 deletion(-)
create mode 100644 drivers/base/power/pm_domains_virt.c
diff --git a/drivers/base/power/Makefile b/drivers/base/power/Makefile
index 1cb8544..360a0e2 100644
--- a/drivers/base/power/Makefile
+++ b/drivers/base/power/Makefile
@@ -2,7 +2,8 @@ obj-$(CONFIG_PM) += sysfs.o generic_ops.o common.o qos.o runtime.o
obj-$(CONFIG_PM_SLEEP) += main.o wakeup.o
obj-$(CONFIG_PM_TRACE_RTC) += trace.o
obj-$(CONFIG_PM_OPP) += opp.o
-obj-$(CONFIG_PM_GENERIC_DOMAINS) += domain.o domain_governor.o
+obj-$(CONFIG_PM_GENERIC_DOMAINS) += domain.o domain_governor.o \
+ pm_domains_virt.o
obj-$(CONFIG_HAVE_CLK) += clock_ops.o
ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG
diff --git a/drivers/base/power/pm_domains_virt.c b/drivers/base/power/pm_domains_virt.c
new file mode 100644
index 0000000..bd4d6b6
--- /dev/null
+++ b/drivers/base/power/pm_domains_virt.c
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2015, Samsung Electronics Co. Ltd. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/pm_domain.h>
+#include <linux/slab.h>
+
+static int pd_power_off(struct generic_pm_domain *domain)
+{
+ return 0;
+}
+
+static int pd_power_on(struct generic_pm_domain *domain)
+{
+ return 0;
+}
+
+int __init virt_pm_domains_init(void)
+{
+ struct device_node *np;
+
+ for_each_compatible_node(np, NULL, "linux,virtual-pm-domains") {
+ struct generic_pm_domain *pd;
+
+ pd = kzalloc(sizeof(*pd), GFP_KERNEL);
+ if (!pd)
+ return -ENOMEM;
+
+ pd->power_off = pd_power_off;
+ pd->power_on = pd_power_on;
+ pd->name = kstrdup(np->name, GFP_KERNEL);
+ if (!pd->name)
+ return -ENOMEM;
+
+ pm_genpd_init(pd, NULL, false);
+ of_genpd_add_provider_simple(np, pd);
+ }
+
+ return 0;
+}
+arch_initcall(virt_pm_domains_init);
--
1.7.9.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH 1/1] PM / domains: Add support for virtual power domains
2015-01-29 18:12 ` [RFC PATCH 1/1] " Karol Wrona
@ 2015-01-30 8:43 ` amit daniel kachhap
2015-01-30 11:57 ` Lorenzo Pieralisi
0 siblings, 1 reply; 5+ messages in thread
From: amit daniel kachhap @ 2015-01-30 8:43 UTC (permalink / raw)
To: Karol Wrona
Cc: linux-pm, linux-kernel, devicetree, Rafael J. Wysocki,
Ulf Hansson, Bartlomiej Zolnierkiewicz, Kyungmin Park,
Karol Wrona
Hi Karol,
I guess this patch series is not complete and use case implementation
will be more helpful for clarity. Also I can think of another way in
which this complete implementation can be done with pd name as
something "pd-virt". This pd can be handled differently inside the
platform specific exynos power off/on function.
Regards,
Amit D
On Thu, Jan 29, 2015 at 11:42 PM, Karol Wrona <k.wrona@samsung.com> wrote:
> There are the power domains which are turned off or put to retention only during
> suspend or special processor states. In such case there is a need to register
> some devices which belong to such domain that PM core could know the state of
> such devices and decide which power mode should be chosen i.e. the domain can
> not be put to retention if some devices are active. Virtual power domain has
> empty power_on/off callbacks as there is no need to gate anything.
>
> Signed-off-by: Karol Wrona <k.wrona@samsung.com>
> ---
> drivers/base/power/Makefile | 3 +-
> drivers/base/power/pm_domains_virt.c | 54 ++++++++++++++++++++++++++++++++++
> 2 files changed, 56 insertions(+), 1 deletion(-)
> create mode 100644 drivers/base/power/pm_domains_virt.c
>
> diff --git a/drivers/base/power/Makefile b/drivers/base/power/Makefile
> index 1cb8544..360a0e2 100644
> --- a/drivers/base/power/Makefile
> +++ b/drivers/base/power/Makefile
> @@ -2,7 +2,8 @@ obj-$(CONFIG_PM) += sysfs.o generic_ops.o common.o qos.o runtime.o
> obj-$(CONFIG_PM_SLEEP) += main.o wakeup.o
> obj-$(CONFIG_PM_TRACE_RTC) += trace.o
> obj-$(CONFIG_PM_OPP) += opp.o
> -obj-$(CONFIG_PM_GENERIC_DOMAINS) += domain.o domain_governor.o
> +obj-$(CONFIG_PM_GENERIC_DOMAINS) += domain.o domain_governor.o \
> + pm_domains_virt.o
> obj-$(CONFIG_HAVE_CLK) += clock_ops.o
>
> ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG
> diff --git a/drivers/base/power/pm_domains_virt.c b/drivers/base/power/pm_domains_virt.c
> new file mode 100644
> index 0000000..bd4d6b6
> --- /dev/null
> +++ b/drivers/base/power/pm_domains_virt.c
> @@ -0,0 +1,54 @@
> +/*
> + * Copyright (C) 2015, Samsung Electronics Co. Ltd. All Rights Reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + */
> +
> +#include <linux/err.h>
> +#include <linux/of.h>
> +#include <linux/pm_domain.h>
> +#include <linux/slab.h>
> +
> +static int pd_power_off(struct generic_pm_domain *domain)
> +{
> + return 0;
> +}
> +
> +static int pd_power_on(struct generic_pm_domain *domain)
> +{
> + return 0;
> +}
> +
> +int __init virt_pm_domains_init(void)
> +{
> + struct device_node *np;
> +
> + for_each_compatible_node(np, NULL, "linux,virtual-pm-domains") {
> + struct generic_pm_domain *pd;
> +
> + pd = kzalloc(sizeof(*pd), GFP_KERNEL);
> + if (!pd)
> + return -ENOMEM;
> +
> + pd->power_off = pd_power_off;
> + pd->power_on = pd_power_on;
> + pd->name = kstrdup(np->name, GFP_KERNEL);
> + if (!pd->name)
> + return -ENOMEM;
> +
> + pm_genpd_init(pd, NULL, false);
> + of_genpd_add_provider_simple(np, pd);
> + }
> +
> + return 0;
> +}
> +arch_initcall(virt_pm_domains_init);
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH 1/1] PM / domains: Add support for virtual power domains
2015-01-30 8:43 ` amit daniel kachhap
@ 2015-01-30 11:57 ` Lorenzo Pieralisi
2015-02-02 12:14 ` Karol Wrona
0 siblings, 1 reply; 5+ messages in thread
From: Lorenzo Pieralisi @ 2015-01-30 11:57 UTC (permalink / raw)
To: amit daniel kachhap
Cc: Karol Wrona, linux-pm, linux-kernel, devicetree,
Rafael J. Wysocki, Ulf Hansson, Bartlomiej Zolnierkiewicz,
Kyungmin Park, Karol Wrona
On Fri, Jan 30, 2015 at 08:43:22AM +0000, amit daniel kachhap wrote:
> Hi Karol,
>
> I guess this patch series is not complete and use case implementation
> will be more helpful for clarity. Also I can think of another way in
> which this complete implementation can be done with pd name as
> something "pd-virt". This pd can be handled differently inside the
> platform specific exynos power off/on function.
Yes, it would be nice to provide an example to understand what this
patchset has to achieve. Is this supposed to be a power domain
used as a container to check for devices runtime state ie dependencies ?
Thanks,
Lorenzo
> Regards,
> Amit D
>
> On Thu, Jan 29, 2015 at 11:42 PM, Karol Wrona <k.wrona@samsung.com> wrote:
> > There are the power domains which are turned off or put to retention only during
> > suspend or special processor states. In such case there is a need to register
> > some devices which belong to such domain that PM core could know the state of
> > such devices and decide which power mode should be chosen i.e. the domain can
> > not be put to retention if some devices are active. Virtual power domain has
> > empty power_on/off callbacks as there is no need to gate anything.
> >
> > Signed-off-by: Karol Wrona <k.wrona@samsung.com>
> > ---
> > drivers/base/power/Makefile | 3 +-
> > drivers/base/power/pm_domains_virt.c | 54 ++++++++++++++++++++++++++++++++++
> > 2 files changed, 56 insertions(+), 1 deletion(-)
> > create mode 100644 drivers/base/power/pm_domains_virt.c
> >
> > diff --git a/drivers/base/power/Makefile b/drivers/base/power/Makefile
> > index 1cb8544..360a0e2 100644
> > --- a/drivers/base/power/Makefile
> > +++ b/drivers/base/power/Makefile
> > @@ -2,7 +2,8 @@ obj-$(CONFIG_PM) += sysfs.o generic_ops.o common.o qos.o runtime.o
> > obj-$(CONFIG_PM_SLEEP) += main.o wakeup.o
> > obj-$(CONFIG_PM_TRACE_RTC) += trace.o
> > obj-$(CONFIG_PM_OPP) += opp.o
> > -obj-$(CONFIG_PM_GENERIC_DOMAINS) += domain.o domain_governor.o
> > +obj-$(CONFIG_PM_GENERIC_DOMAINS) += domain.o domain_governor.o \
> > + pm_domains_virt.o
> > obj-$(CONFIG_HAVE_CLK) += clock_ops.o
> >
> > ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG
> > diff --git a/drivers/base/power/pm_domains_virt.c b/drivers/base/power/pm_domains_virt.c
> > new file mode 100644
> > index 0000000..bd4d6b6
> > --- /dev/null
> > +++ b/drivers/base/power/pm_domains_virt.c
> > @@ -0,0 +1,54 @@
> > +/*
> > + * Copyright (C) 2015, Samsung Electronics Co. Ltd. All Rights Reserved.
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > + * GNU General Public License for more details.
> > + *
> > + */
> > +
> > +#include <linux/err.h>
> > +#include <linux/of.h>
> > +#include <linux/pm_domain.h>
> > +#include <linux/slab.h>
> > +
> > +static int pd_power_off(struct generic_pm_domain *domain)
> > +{
> > + return 0;
> > +}
> > +
> > +static int pd_power_on(struct generic_pm_domain *domain)
> > +{
> > + return 0;
> > +}
> > +
> > +int __init virt_pm_domains_init(void)
> > +{
> > + struct device_node *np;
> > +
> > + for_each_compatible_node(np, NULL, "linux,virtual-pm-domains") {
> > + struct generic_pm_domain *pd;
> > +
> > + pd = kzalloc(sizeof(*pd), GFP_KERNEL);
> > + if (!pd)
> > + return -ENOMEM;
> > +
> > + pd->power_off = pd_power_off;
> > + pd->power_on = pd_power_on;
> > + pd->name = kstrdup(np->name, GFP_KERNEL);
> > + if (!pd->name)
> > + return -ENOMEM;
> > +
> > + pm_genpd_init(pd, NULL, false);
> > + of_genpd_add_provider_simple(np, pd);
> > + }
> > +
> > + return 0;
> > +}
> > +arch_initcall(virt_pm_domains_init);
> > --
> > 1.7.9.5
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH 1/1] PM / domains: Add support for virtual power domains
2015-01-30 11:57 ` Lorenzo Pieralisi
@ 2015-02-02 12:14 ` Karol Wrona
0 siblings, 0 replies; 5+ messages in thread
From: Karol Wrona @ 2015-02-02 12:14 UTC (permalink / raw)
To: Lorenzo Pieralisi, amit daniel kachhap
Cc: linux-pm, linux-kernel, devicetree, Rafael J. Wysocki,
Ulf Hansson, Bartlomiej Zolnierkiewicz, Kyungmin Park,
Karol Wrona
On 01/30/2015 12:57 PM, Lorenzo Pieralisi wrote:
> On Fri, Jan 30, 2015 at 08:43:22AM +0000, amit daniel kachhap wrote:
>> Hi Karol,
>>
>> I guess this patch series is not complete and use case implementation
>> will be more helpful for clarity. Also I can think of another way in
>> which this complete implementation can be done with pd name as
>> something "pd-virt". This pd can be handled differently inside the
>> platform specific exynos power off/on function.
>
> Yes, it would be nice to provide an example to understand what this
> patchset has to achieve. Is this supposed to be a power domain
> used as a container to check for devices runtime state ie dependencies ?
>
Yes, something like that.
In our case exynos do not enter LPD state with mmc host working and its is in
"top" pd which is not managed in conventional way. If we know runtime status of
the host we can decide what to do. Soon I will send full patchset.
I thought about it as exynos specific but I wonder if that would be needed not
only in exynos.
BR,
Karol
[...]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-02-02 12:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-29 18:12 [RFC PATCH 0/1] PM / domains: Add support for virtual power domains Karol Wrona
2015-01-29 18:12 ` [RFC PATCH 1/1] " Karol Wrona
2015-01-30 8:43 ` amit daniel kachhap
2015-01-30 11:57 ` Lorenzo Pieralisi
2015-02-02 12:14 ` Karol Wrona
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).