From patchwork Fri Jul 22 12:47:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Budig X-Patchwork-Id: 998992 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6MCm13D013184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 22 Jul 2011 12:48:22 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QkF8z-0003RO-Nf; Fri, 22 Jul 2011 12:47:54 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QkF8z-00047M-Bl; Fri, 22 Jul 2011 12:47:53 +0000 Received: from mail.kernelconcepts.de ([212.60.202.196]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QkF8v-000473-4r for linux-arm-kernel@lists.infradead.org; Fri, 22 Jul 2011 12:47:50 +0000 Received: from [192.168.2.112] by mail.kernelconcepts.de with esmtpa (Exim 4.72) (envelope-from ) id 1QkFIY-0005Z6-72 for linux-arm-kernel@lists.infradead.org; Fri, 22 Jul 2011 14:57:46 +0200 Message-ID: <4E29716F.2090003@kernelconcepts.de> Date: Fri, 22 Jul 2011 14:47:43 +0200 From: Simon Budig User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11 MIME-Version: 1.0 To: linux-arm-kernel@lists.infradead.org Subject: Patch: Fix for wrong logic in tx_empty for serial/amba-pl011.c X-Enigmail-Version: 1.1.2 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110722_084749_419297_8F2AE97F X-CRM114-Status: GOOD ( 16.56 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.2 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 22 Jul 2011 12:48:22 +0000 (UTC) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all. There is a problem with the logic of tx_empty in the amba-pl011 serial port driver. Instead of checking for an empty FIFO it checks for a not-full FIFO. Attached is a patch that fixes this. Bye, Simon Budig - -- Simon Budig kernel concepts GbR simon.budig@kernelconcepts.de Sieghuetter Hauptweg 48 +49-271-771091-17 D-57072 Siegen -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk4pcW8ACgkQO2O/RXesiHDwWACeO4HQ2BfdZj/8pEakHQ/njVjs XuUAoKuyQeBaSJeX3oWp+3OWE4A0+0V3 =nOMx -----END PGP SIGNATURE----- From 7749c38e22365dc6b12d4665d3a691f9777f74fe Mon Sep 17 00:00:00 2001 From: Simon Budig Date: Fri, 22 Jul 2011 13:07:42 +0200 Subject: [PATCH] Fix logic of tx_empty. test for TX-FIFO *not empty* instead of TX-FIFO full. Signed-off-by: Simon Budig --- drivers/tty/serial/amba-pl011.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 05eb292..a23b419 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -792,7 +792,7 @@ static unsigned int pl01x_tx_empty(struct uart_port *port) { struct uart_amba_port *uap = (struct uart_amba_port *)port; unsigned int status = readw(uap->port.membase + UART01x_FR); - return status & (UART01x_FR_BUSY|UART01x_FR_TXFF) ? 0 : TIOCSER_TEMT; + return (status & UART01x_FR_BUSY) || !(status & UART011_FR_TXFE) ? 0 : TIOCSER_TEMT; } static unsigned int pl01x_get_mctrl(struct uart_port *port)