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-next>] [day] [month] [year] [list]
Message-id: <1429191554-24972-2-git-send-email-r.baldyga@samsung.com>
Date:	Thu, 16 Apr 2015 15:39:12 +0200
From:	Robert Baldyga <r.baldyga@...sung.com>
To:	linux@....linux.org.uk, dan.j.williams@...el.com,
	vinod.koul@...el.com
Cc:	lars@...afoo.de, dmaengine@...r.kernel.org,
	linux-kernel@...r.kernel.org, m.szyprowski@...sung.com,
	Robert Baldyga <r.baldyga@...sung.com>
Subject: [PATCH 1/3] amba: add no_pm_pclk_management flag to amba_driver

This patch introduces no_pm_pclk_management flag in struct amba_driver.
It causes that pclk is not touched in pm_runtime callbacks. This allows
to manage clock in device driver independently of power domain management.

Signed-off-by: Robert Baldyga <r.baldyga@...sung.com>
---
 drivers/amba/bus.c       | 6 ++++--
 include/linux/amba/bus.h | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index f009936..75035f0 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -140,9 +140,10 @@ static struct device_attribute amba_dev_attrs[] = {
 static int amba_pm_runtime_suspend(struct device *dev)
 {
 	struct amba_device *pcdev = to_amba_device(dev);
+	struct amba_driver *pcdrv = to_amba_driver(dev->driver);
 	int ret = pm_generic_runtime_suspend(dev);
 
-	if (ret == 0 && dev->driver) {
+	if (ret == 0 && dev->driver && !pcdrv->no_pm_pclk_management) {
 		if (pm_runtime_is_irq_safe(dev))
 			clk_disable(pcdev->pclk);
 		else
@@ -155,9 +156,10 @@ static int amba_pm_runtime_suspend(struct device *dev)
 static int amba_pm_runtime_resume(struct device *dev)
 {
 	struct amba_device *pcdev = to_amba_device(dev);
+	struct amba_driver *pcdrv = to_amba_driver(dev->driver);
 	int ret;
 
-	if (dev->driver) {
+	if (dev->driver && !pcdrv->no_pm_pclk_management) {
 		if (pm_runtime_is_irq_safe(dev))
 			ret = clk_enable(pcdev->pclk);
 		else
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index 50fc668..a77378c 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -44,6 +44,7 @@ struct amba_driver {
 	int			(*suspend)(struct amba_device *, pm_message_t);
 	int			(*resume)(struct amba_device *);
 	const struct amba_id	*id_table;
+	unsigned int		no_pm_pclk_management:1;
 };
 
 /*
-- 
1.9.1

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