Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161937AbbKEHWZ (ORCPT ); Thu, 5 Nov 2015 02:22:25 -0500 Received: from mail-bn1on0076.outbound.protection.outlook.com ([157.56.110.76]:62981 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032416AbbKEHVi (ORCPT ); Thu, 5 Nov 2015 02:21:38 -0500 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; linuxfoundation.org; dkim=none (message not signed) header.d=none;linuxfoundation.org; dmarc=bestguesspass action=none header.from=xilinx.com; From: Soren Brinkmann To: Greg Kroah-Hartman , Jiri Slaby CC: Michal Simek , , , , Soren Brinkmann Subject: [PATCH v2 09/10] tty: xuartps: Only handle RX IRQs when RX is enabled Date: Wed, 4 Nov 2015 23:21:18 -0800 Message-ID: <1446708079-1105-10-git-send-email-soren.brinkmann@xilinx.com> X-Mailer: git-send-email 2.6.2.3.ga463a5b In-Reply-To: <1446708079-1105-1-git-send-email-soren.brinkmann@xilinx.com> References: <1446708079-1105-1-git-send-email-soren.brinkmann@xilinx.com> X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21920.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD051;1:85UiR3bmBLjLJj/YDKhju6jp3nYrZcdhTe5AkdB+FNP1PRxTBvYIr0h8IYFYqG/PzJxXDh4TJ0xY5Pu4kd29xF9B1UM+FVbg6p51bRxINfC3CUwND0mSOWv00pJ96FGzURomyAK7MJ7SnQaJj+35PDV4a4lxnREEUK6IfeQCzg6vB9jOaR9XXhPPbDZTacaI6qGK0TVx47N7kh7Tha+6MDvUk6TWl34WvojXg5Z8Tj9RyO1M2rSrbiwmdRpM/H9KanThmHLqTsy7xa8JAhw+BY3GUJg95v2LOH/piN0fmd1Iv82TkO7JsVMtPjtQmMezbKfSeoeTYhCpCWe2i0l4EwUDWKiY5eQjXVl9dBz3cEgjTxH7mU1f+u4uBDtEoQxF X-Forefront-Antispam-Report: CIP:149.199.60.100;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(48376002)(229853001)(107886002)(5001960100002)(50226001)(36756003)(106466001)(6806005)(5007970100001)(16796002)(11100500001)(87936001)(86362001)(5003940100001)(2950100001)(4001430100002)(77096005)(33646002)(50466002)(5008740100001)(189998001)(5001770100001)(50986999)(76176999)(81156007)(19580395003)(76506005)(19580405001)(5001920100001)(57986006)(63266004)(47776003)(92566002)(36386004)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN1AFFO11HUB040;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11HUB040;2:d7BwsxIAtwwIoHSvgpdHPYyXx9T2s7VE6C7wbkiRWocNeG2Qrf2/Qxjcz6PriG5fkHeW9JhWb1P7F+sm9grxGOOPgw0ljGVCwqsGYeP7ZwgaKE7TbxPK4ylPBzDuwcX36X9LlttWnPyKti4A09oLVCFdfJQaeQbg9BOtjxy6b5M=;3:KNPGXd8nlidY1jrT8McTR9uASJPOSd3ZU0PdsTkqwSvHoBwh5opmRKdGWiJNvjAOqR03VUvGxbI1ZecBFN5lNhuhQ/BZ634wWVQGjnlkmp1YttK0LADOyG8mHWCD8TEbLYBkhdEGheg3LSGQez8fu7ADBdkhASxwywKp1GGpwwuqUDxPIXx+F9AlpUw7mdcutsTGpv9jrC17pMutdaGFCDQNxm/+yDZ43YNjVKSg0peMJ3dz+IhZqr/YZItmzgBnME7jjk6sjB6O3Ga+W5aXsg==;25:Whpc0NqMiW+eZYVLXS06KYjgXtpsvivnlKGOzIi95AeOpqYajFT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kEjPCgyxhh743ycTdsYWR8pwECWFCfqOsVI+QLFrUcKtUfMOpirugv7esZcgBaIIFFez5iQKFy1pwiwuV2mvdeqFNApVHeKnYIHe2bJoAA61e+hJ/RNYUhslMVbjabge/PnBx+vzz46cMQKQKoL4lgtm6bo+2s1B8NqNn9R X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(520078)(3002001)(10201501046);SRVR:BN1AFFO11HUB040;BCL:0;PCL:0;RULEID:;SRVR:BN1AFFO11HUB040; X-Forefront-PRVS: 0751474A44 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN1AFFO11HUB040;23:lN6e8loCyW3gjoZLgvtuMvmfOtqyGJhz+To8rV4?= =?us-ascii?Q?KdfAht9XWDwnuPWcykX7Ow7dqjFj0g23cl1KYQsDj5Wto6z1FvY3GwSm21jo?= =?us-ascii?Q?j9hV3gXCwwx/ImGgTU9xd7+N7YXy6MPqKHXIk4MVpp/6TmLlcfQ2NiHQQ6Fx?= =?us-ascii?Q?vMjQDsv5hz8Vz7A3/tIw3RDohp3J1l8iEuvd2qHJuBpbWerl0FL/bEnpGm3R?= =?us-ascii?Q?wQb83nv3Yfq12yEW9k0jTWMpuBizqIX62V5Vk4y08/CM223t+gA0nnyUg6lp?= =?us-ascii?Q?svUSNAv2a5zTAxPakkPDVL4jAYDU38eUhCjatjhZIFgWDEfW9+cMYkz9wAvq?= =?us-ascii?Q?1mWK2k8m5gemWORpzXeTmYgFywLrXiBX0Jf2rL8ZbpBe8R55FBCiQbWRgSDC?= =?us-ascii?Q?hkTLvl1DFhnpM8v7Eql5x2hWNO7ee4k5781S8vM/jYwkRf78k3SI45YmP53x?= =?us-ascii?Q?Y9agQ7+uVJ0wxx2lpsvQSo8OxrHB/d/rjxtnTwK44PkGuHUk/+0Ic4olkSM4?= =?us-ascii?Q?fmYb6GvyNQ8ObeRh6d8bUFyQomju8bAq5ujrOeeTkCkDaL3CyGO8LAwp2QQS?= =?us-ascii?Q?Qoby7Bn1pB4TToFowiyxA91kCjfhhn+y3WnKAJGTIqM9vJK9rortB/kKFk4E?= =?us-ascii?Q?k3vffU3voizmbfLvZYzwAYWf6cmVvQb4PBXFJqAWM0OYXenw70WfpLZTtDBz?= =?us-ascii?Q?j3kncE7cOyLzXWesyg59bJN8S4Yu6B9VhZrCDbmOmzsFeFrG1aQzJm1fXDZv?= =?us-ascii?Q?6PAHr4LXmq7UtCaZQVXR3LRl2dSPhFvBkdjCZSpnX9O04G5jVoSoelJdMCLq?= =?us-ascii?Q?KOl3KqtPK3gAPrBPTThmuDwhJjFMrsPIbCgsERSQsC0k1lHYd/pFMdRUxSif?= =?us-ascii?Q?txmgahHY6K6laMCRhJg08kiNUnxhv/3G9aVgBQhmMc28XhJa3t02iBPyCpVb?= =?us-ascii?Q?EDYj5i1orswSo08dMGoz1ujLmWVX5NLodhVJmt5tO2RhjkJB2ERuFcQpL4mS?= =?us-ascii?Q?wg9q0YZsZQVXhmE4GodcOzIaSixW73IxTH6T+atuIxgtctAWnOhBwjDmooLl?= =?us-ascii?Q?j41z509llfF3EsESOKou802o+SlGZy2kEna9I9ZTP2djdeBtU53LcEMh5MhH?= =?us-ascii?Q?EhzPvgpfwganbHkZbt8TmApJ5OM7P8x5n?= X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11HUB040;5:KTXG+9hBZtyGDdO3Mq9euK36Sd9pxdZWYHyc7y96/+6S5iaqDpwAhclSj+gy+tint2hQ/+XKBb8x09hGRFJQOY3/x6+NJhEntrlB+LNytWKafAeOz3ZqC8PgIfUMw36JMI1LwcSWRmzG2tzbcp43jw==;24:DBG2RuXpZt/pW21Y9+hbaWpcUJyxdTVqT5ZwbD6GE0upF+Orhdiu8coOhrityyJm5GabskyfUm9ui28HSB6WAjNKYozQ3ksqYeeoK4crRJY= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2015 07:21:35.6943 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1AFFO11HUB040 X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11HUB024;2:h7dWafarm0B4tnkb3WO97x82N0bjkL7ZI83xuIlC8Jd8MXKwEaE1906/nQzzWuzA1lmpYhbhDV1Ak063piGlQWOMo2Nq1wQ1h0JaJfK7+i0eRd84rs7lz1aJtk6clITPw32Nd7FQxuC3+PRlL4pbj33f4ugm6NHLTewCt7GrvQE=;23:sonCwKtMug4NeYT2OG6ENl87bFCnpMoXYX+R0Rbngp1fNPUPvMGwSP08d1xWM4xDwj8As1kDEW/71PjnwxOp+jepWqJ6Fm3cWbghLSt/YhWxtuo6n9BJPtZv4PoCFqyAIxUrrhHOF5O9fnT8bdwEHxNkxzvrxA5Yi1mi2da668mMExGzpWtFIexqpUEP2otL X-OriginatorOrg: xilinx.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3495 Lines: 103 Ignore RX-related interrupts if RX is not enabled. Signed-off-by: Soren Brinkmann --- drivers/tty/serial/xilinx_uartps.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index aa1176e6661a..413229661f5d 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -161,6 +161,7 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255"); * @pclk: APB clock * @baud: Current baud rate * @clk_rate_change_nb: Notifier block for clock changes + * @flags: Driver flags */ struct cdns_uart { struct uart_port *port; @@ -168,7 +169,11 @@ struct cdns_uart { struct clk *pclk; unsigned int baud; struct notifier_block clk_rate_change_nb; + u32 flags; }; + +#define CDNS_FLAG_RX_ENABLED BIT(0) + #define to_cdns_uart(_nb) container_of(_nb, struct cdns_uart, \ clk_rate_change_nb); @@ -262,6 +267,7 @@ static void cdns_uart_handle_rx(struct uart_port *port, unsigned int isrstatus) static irqreturn_t cdns_uart_isr(int irq, void *dev_id) { struct uart_port *port = (struct uart_port *)dev_id; + struct cdns_uart *cdns_uart = port->private_data; unsigned long flags; unsigned int isrstatus, numbytes; @@ -272,7 +278,8 @@ static irqreturn_t cdns_uart_isr(int irq, void *dev_id) */ isrstatus = readl(port->membase + CDNS_UART_ISR_OFFSET); - cdns_uart_handle_rx(port, isrstatus); + if (cdns_uart->flags & CDNS_FLAG_RX_ENABLED) + cdns_uart_handle_rx(port, isrstatus); /* Dispatch an appropriate handler */ if ((isrstatus & CDNS_UART_IXR_TXEMPTY) == CDNS_UART_IXR_TXEMPTY) { @@ -576,11 +583,13 @@ static void cdns_uart_stop_tx(struct uart_port *port) static void cdns_uart_stop_rx(struct uart_port *port) { unsigned int regval; + struct cdns_uart *cdns_uart = port->private_data; regval = readl(port->membase + CDNS_UART_CR_OFFSET); regval |= CDNS_UART_CR_RX_DIS; /* Disable the receiver */ writel(regval, port->membase + CDNS_UART_CR_OFFSET); + cdns_uart->flags &= ~CDNS_FLAG_RX_ENABLED; } /** @@ -761,6 +770,7 @@ static int cdns_uart_startup(struct uart_port *port) { unsigned long flags; unsigned int retval = 0, status = 0; + struct cdns_uart *cdns_uart = port->private_data; retval = request_irq(port->irq, cdns_uart_isr, 0, CDNS_UART_NAME, (void *)port); @@ -787,6 +797,7 @@ static int cdns_uart_startup(struct uart_port *port) status &= CDNS_UART_CR_RX_DIS; status |= CDNS_UART_CR_RX_EN; writel(status, port->membase + CDNS_UART_CR_OFFSET); + cdns_uart->flags |= CDNS_FLAG_RX_ENABLED; /* Set the Mode Register with normal mode,8 data bits,1 stop bit, * no parity. @@ -830,6 +841,7 @@ static void cdns_uart_shutdown(struct uart_port *port) { int status; unsigned long flags; + struct cdns_uart *cdns_uart = port->private_data; spin_lock_irqsave(&port->lock, flags); @@ -841,6 +853,7 @@ static void cdns_uart_shutdown(struct uart_port *port) /* Disable the TX and RX */ writel(CDNS_UART_CR_TX_DIS | CDNS_UART_CR_RX_DIS, port->membase + CDNS_UART_CR_OFFSET); + cdns_uart->flags &= ~CDNS_FLAG_RX_ENABLED; spin_unlock_irqrestore(&port->lock, flags); -- 2.6.2.3.ga463a5b -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/