lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1423479726-23140-3-git-send-email-amit.daniel@samsung.com>
Date:	Mon, 09 Feb 2015 16:32:05 +0530
From:	Amit Daniel Kachhap <amit.daniel@...sung.com>
To:	linux-pm@...r.kernel.org
Cc:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	linux-samsung-soc@...r.kernel.org, khilman@...aro.org,
	rjw@...ysocki.net, len.brown@...el.com, ulf.hansson@...aro.org,
	tomasz.figa@...il.com, kgene.kim@...sung.com,
	s.nawrocki@...sung.com, thomas.ab@...sung.com,
	pankaj.dubey@...sung.com, m.szyprowski@...sung.com,
	geert+renesas@...der.be,
	Amit Daniel Kachhap <amit.daniel@...sung.com>
Subject: [PATCH RFC v4 2/3] PM / Domains: Save restore slave pm runtime devices

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@...sung.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ