mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Amit Daniel Kachhap <amit.daniel@samsung.com>
To: linux-pm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	khilman@linaro.org, rjw@rjwysocki.net, len.brown@intel.com,
	ulf.hansson@linaro.org, tomasz.figa@gmail.com,
	kgene.kim@samsung.com, s.nawrocki@samsung.com,
	thomas.ab@samsung.com, pankaj.dubey@samsung.com,
	m.szyprowski@samsung.com, geert+renesas@glider.be,
	Amit Daniel Kachhap <amit.daniel@samsung.com>
Subject: [PATCH RFC v4 2/3] PM / Domains: Save restore slave pm runtime devices
Date: Mon, 09 Feb 2015 16:32:05 +0530	[thread overview]
Message-ID: <1423479726-23140-3-git-send-email-amit.daniel@samsung.com> (raw)
In-Reply-To: <1423479726-23140-1-git-send-email-amit.daniel@samsung.com>

Based on the runtime request of the active device, the callbacks of
the passive pm runtime devices will be invoked.

Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
---
 drivers/base/power/domain.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index c5280f2..160e74a 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -49,6 +49,7 @@
 
 static LIST_HEAD(gpd_list);
 static DEFINE_MUTEX(gpd_list_lock);
+static void __pm_genpd_restore_devices(struct generic_pm_domain *genpd);
 
 static struct generic_pm_domain *pm_genpd_lookup_name(const char *domain_name)
 {
@@ -176,6 +177,8 @@ static int genpd_power_on(struct generic_pm_domain *genpd)
 	pr_warn("%s: Power-%s latency exceeded, new value %lld ns\n",
 		genpd->name, "on", elapsed_ns);
 
+	__pm_genpd_restore_devices(genpd);
+
 	return ret;
 }
 
@@ -397,6 +400,9 @@ static int __pm_genpd_save_device(struct pm_domain_data *pdd,
 	struct device *dev = pdd->dev;
 	int ret = 0;
 
+	if (dev->power.slave == true)
+		gpd_data->need_restore = 0;
+
 	if (gpd_data->need_restore > 0)
 		return 0;
 
@@ -453,6 +459,28 @@ static void __pm_genpd_restore_device(struct pm_domain_data *pdd,
 }
 
 /**
+ * __pm_genpd_restore_devices- Restore the pre-suspend state of all device
+ *				according to the restore flag.
+ * @genpd: PM domain the device belongs to.
+ */
+static void __pm_genpd_restore_devices(struct generic_pm_domain *genpd)
+{
+	struct pm_domain_data *pdd;
+	struct generic_pm_domain_data *gpd_data;
+	struct device *dev;
+
+	/* Force restore the devices according to the restore flag */
+	list_for_each_entry(pdd, &genpd->dev_list, list_node) {
+		dev = pdd->dev;
+		gpd_data = to_gpd_data(pdd);
+		if (dev->power.slave == true) {
+			gpd_data->need_restore = 1;
+			__pm_genpd_restore_device(pdd, genpd);
+		}
+	}
+}
+
+/**
  * genpd_abort_poweroff - Check if a PM domain power off should be aborted.
  * @genpd: PM domain to check.
  *
-- 
2.2.0


  parent reply	other threads:[~2015-02-09 10:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 11:02 [PATCH RFC v4 0/3] PM / Runtime: Feature to power manage slave devices Amit Daniel Kachhap
2015-02-09 11:02 ` [PATCH RFC v4 1/3] PM / Runtime: Add an API pm_runtime_set_slave Amit Daniel Kachhap
2015-02-09 15:58   ` Alan Stern
2015-02-12  9:42     ` amit daniel kachhap
2015-02-12 15:13       ` Alan Stern
2015-02-09 11:02 ` Amit Daniel Kachhap [this message]
2015-02-09 11:02 ` [PATCH RFC v4 3/3] clk: samsung: Add PM runtime support for clocks Amit Daniel Kachhap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1423479726-23140-3-git-send-email-amit.daniel@samsung.com \
    --to=amit.daniel@samsung.com \
    --cc=geert+renesas@glider.be \
    --cc=kgene.kim@samsung.com \
    --cc=khilman@linaro.org \
    --cc=len.brown@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=pankaj.dubey@samsung.com \
    --cc=rjw@rjwysocki.net \
    --cc=s.nawrocki@samsung.com \
    --cc=thomas.ab@samsung.com \
    --cc=tomasz.figa@gmail.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®