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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 04 Aug 2014 18:04:38 -0700
From:	Frank Rowand <frowand.list@...il.com>
To:	frowand.list@...il.com
CC:	Stephen Boyd <sboyd@...eaurora.org>,
	David Brown <davidb@...eaurora.org>,
	Daniel Walker <dwalker@...o99.com>,
	Bryan Huntsman <bryanh@...eaurora.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jiri Slaby <jslaby@...e.cz>,
	"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
	linux-serial@...r.kernel.org,
	Linux Kernel list <linux-kernel@...r.kernel.org>,
	Jason Wessel <jason.wessel@...driver.com>,
	kgdb-bugreport@...ts.sourceforge.net
Subject: [test patch 2/4] add poll_post_exception framework

From: Frank Rowand <frank.rowand@...ymobile.com>

Add framework to allow serial driver to fixup state after operating in
polled mode, before returning to interrupt mode.

Not-signed-off-by-yet: Frank Rowand <frank.rowand@...ymobile.com>

---
 drivers/tty/serial/kgdboc.c      |    3 +++
 drivers/tty/serial/serial_core.c |   15 +++++++++++++++
 include/linux/serial_core.h      |    1 +
 include/linux/tty_driver.h       |    1 +
 4 files changed, 20 insertions(+)

Index: b/drivers/tty/serial/kgdboc.c
===================================================================
--- a/drivers/tty/serial/kgdboc.c
+++ b/drivers/tty/serial/kgdboc.c
@@ -302,6 +302,9 @@ static void kgdboc_post_exp_handler(void
 		con_debug_leave();
 	}
 	kgdboc_restore_input();
+
+	if (kgdb_tty_driver->ops->poll_post_exception)
+		kgdb_tty_driver->ops->poll_post_exception(kgdb_tty_driver, kgdb_tty_line);
 }
 
 static struct kgdb_io kgdboc_io_ops = {
Index: b/drivers/tty/serial/serial_core.c
===================================================================
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2237,6 +2237,20 @@ static void uart_poll_put_char(struct tt
 	port = state->uart_port;
 	port->ops->poll_put_char(port, ch);
 }
+
+static void uart_poll_post_exception(struct tty_driver *driver, int line)
+{
+	struct uart_driver *drv = driver->driver_state;
+	struct uart_state *state = drv->state + line;
+	struct uart_port *port;
+
+	if (!state || !state->uart_port)
+		return;
+
+	port = state->uart_port;
+	if (port->ops->poll_post_exception)
+		port->ops->poll_post_exception(port);
+}
 #endif
 
 static const struct tty_operations uart_ops = {
@@ -2269,6 +2283,7 @@ static const struct tty_operations uart_
 	.poll_init	= uart_poll_init,
 	.poll_get_char	= uart_poll_get_char,
 	.poll_put_char	= uart_poll_put_char,
+	.poll_post_exception = uart_poll_post_exception,
 #endif
 };
 
Index: b/include/linux/tty_driver.h
===================================================================
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -283,6 +283,7 @@ struct tty_operations {
 	int (*poll_init)(struct tty_driver *driver, int line, char *options);
 	int (*poll_get_char)(struct tty_driver *driver, int line);
 	void (*poll_put_char)(struct tty_driver *driver, int line, char ch);
+	void (*poll_post_exception)(struct tty_driver *driver, int line);
 #endif
 	const struct file_operations *proc_fops;
 };
Index: b/include/linux/serial_core.h
===================================================================
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -90,6 +90,7 @@ struct uart_ops {
 	int		(*poll_init)(struct uart_port *);
 	void		(*poll_put_char)(struct uart_port *, unsigned char);
 	int		(*poll_get_char)(struct uart_port *);
+	void		(*poll_post_exception)(struct uart_port *);
 #endif
 };
 
--
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