From patchwork Tue Aug 5 01:04:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Rowand X-Patchwork-Id: 4674091 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 36701C0338 for ; Tue, 5 Aug 2014 01:04:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 584302013D for ; Tue, 5 Aug 2014 01:04:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A05E2013A for ; Tue, 5 Aug 2014 01:04:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753299AbaHEBEm (ORCPT ); Mon, 4 Aug 2014 21:04:42 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:59801 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752354AbaHEBEl (ORCPT ); Mon, 4 Aug 2014 21:04:41 -0400 Received: by mail-pd0-f173.google.com with SMTP id w10so297772pde.32 for ; Mon, 04 Aug 2014 18:04:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=oFGsdqp1rP4iqHD+hYwL3GGzbWhGaHrRGwTfMjAtoCs=; b=MahY7TlcHtr0vJg0qp9rpUts69bhI4LtqdmdcL5qmS7Bxf0sFYfT96U+BUJDjug+Hu TexWtRBQV93BCYJzkVMex6YbxcmV18iSdTWMTJi0WAhsbMzGy7M6qvBqwTVoHAmO5K4g GwsHGpEXOa4jlALcdDhhQPHnCMEO8vvAyovuG5mNOQfcfKSdwjPG8WJaBbyFCAUDhUhA g4128TwgkEckwxE+lK2vjf3t2ba60+M7HNpUoN3x79cKlOPu3ZDq6BPwqsH9dW744QGp v42Z9/mzKU16fxj+oDlj1WpUq8ijHRxuRxZ7pnks7CvyJKDh5K07kxKVE2iisscMKRlC xVKw== X-Received: by 10.70.40.131 with SMTP id x3mr496942pdk.22.1407200681173; Mon, 04 Aug 2014 18:04:41 -0700 (PDT) Received: from [172.26.79.116] ([64.211.224.253]) by mx.google.com with ESMTPSA id ec10sm433011pad.33.2014.08.04.18.04.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Aug 2014 18:04:40 -0700 (PDT) Message-ID: <53E02DA6.1020609@gmail.com> Date: Mon, 04 Aug 2014 18:04:38 -0700 From: Frank Rowand Reply-To: frowand.list@gmail.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: frowand.list@gmail.com CC: Stephen Boyd , David Brown , Daniel Walker , Bryan Huntsman , Greg Kroah-Hartman , Jiri Slaby , "linux-arm-msm@vger.kernel.org" , linux-serial@vger.kernel.org, Linux Kernel list , Jason Wessel , kgdb-bugreport@lists.sourceforge.net Subject: [test patch 2/4] add poll_post_exception framework References: <53E02C7C.4090206@gmail.com> In-Reply-To: <53E02C7C.4090206@gmail.com> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Frank Rowand 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 --- 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(+) -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 };