All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Rowand <frowand.list@gmail.com>
To: frowand.list@gmail.com
Cc: Stephen Boyd <sboyd@codeaurora.org>,
	David Brown <davidb@codeaurora.org>,
	Daniel Walker <dwalker@fifo99.com>,
	Bryan Huntsman <bryanh@codeaurora.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.cz>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	linux-serial@vger.kernel.org,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	Jason Wessel <jason.wessel@windriver.com>,
	kgdb-bugreport@lists.sourceforge.net
Subject: [test patch 2/4] add poll_post_exception framework
Date: Mon, 04 Aug 2014 18:04:38 -0700	[thread overview]
Message-ID: <53E02DA6.1020609@gmail.com> (raw)
In-Reply-To: <53E02C7C.4090206@gmail.com>

From: Frank Rowand <frank.rowand@sonymobile.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@sonymobile.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
 };
 

  parent reply	other threads:[~2014-08-05  1:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05  0:59 [request for help] tty: serial: kgdb: fix msm_serial for kgdb Frank Rowand
2014-08-05  1:03 ` [test patch 1/4] " Frank Rowand
2014-08-05  1:04 ` Frank Rowand [this message]
2014-08-05  1:06 ` [test patch 3/4] use poll_post_exception in msm_serial Frank Rowand
2014-08-05  1:06   ` Frank Rowand
2014-08-05  1:08 ` [test patch 4/4] debug hackery to trace msm_serial receive interrupts Frank Rowand
2014-08-05  1:08   ` Frank Rowand
2014-08-05  1:33 ` [request for help] tty: serial: kgdb: fix msm_serial for kgdb Stephen Boyd
2014-08-05  2:09   ` Frank Rowand
2014-08-05 19:22     ` Stephen Boyd
2014-08-05 23:53       ` Stephen Boyd
2014-08-06  0:55         ` Frank Rowand
2014-08-06  1:19           ` Stephen Boyd

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=53E02DA6.1020609@gmail.com \
    --to=frowand.list@gmail.com \
    --cc=bryanh@codeaurora.org \
    --cc=davidb@codeaurora.org \
    --cc=dwalker@fifo99.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jason.wessel@windriver.com \
    --cc=jslaby@suse.cz \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sboyd@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.