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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Sun,  9 Aug 2015 11:19:07 -0700
From:	Eduardo Valentin <edubezval@...il.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jiri Slaby <jslaby@...e.com>, Fabio Stevam <festevam@...il.com>
Cc:	Linux PM <linux-pm@...r.kernel.org>,
	Eduardo Valentin <edubezval@...il.com>,
	linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 6/8] serial: imx: add a flag to indicate we are in the suspend path

This is a simple flag that gets set across prepare and complete
callbacks in the suspend path. We the flag we may avoid
runtime pm idling at the same time.

Cc: Fabio Stevam <festevam@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Jiri Slaby <jslaby@...e.com>
Cc: linux-serial@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Signed-off-by: Eduardo Valentin <edubezval@...il.com>
---
 drivers/tty/serial/imx.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 494b182..def52e0 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -219,6 +219,8 @@ struct imx_port {
 	wait_queue_head_t	dma_wait;
 	unsigned int		saved_reg[8];
 	bool			context_saved;
+
+	bool			is_suspending;
 };
 
 struct imx_port_ucrs {
@@ -1805,6 +1807,22 @@ static struct uart_driver imx_reg = {
 	.cons           = IMX_CONSOLE,
 };
 
+static int serial_imx_prepare(struct device *dev)
+{
+	struct imx_port *sport = dev_get_drvdata(dev);
+
+	sport->is_suspending = true;
+
+	return 0;
+}
+
+static void serial_imx_complete(struct device *dev)
+{
+	struct imx_port *sport = dev_get_drvdata(dev);
+
+	sport->is_suspending = false;
+}
+
 static void serial_imx_restore_context(struct imx_port *sport)
 {
 	if (!sport->context_saved)
@@ -2033,6 +2051,8 @@ static int serial_imx_remove(struct platform_device *pdev)
 
 static const struct dev_pm_ops serial_imx_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(serial_imx_suspend, serial_imx_resume)
+	.prepare        = serial_imx_prepare,
+	.complete       = serial_imx_complete,
 };
 
 static struct platform_driver serial_imx_driver = {
-- 
2.5.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