From patchwork Tue Aug 21 12:16:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1354821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 5452BDFB34 for ; Tue, 21 Aug 2012 12:27:12 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T3nUN-0005k0-FV; Tue, 21 Aug 2012 12:23:19 +0000 Received: from na3sys009aog126.obsmtp.com ([74.125.149.155]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1T3nRm-0004QP-N5 for linux-arm-kernel@lists.infradead.org; Tue, 21 Aug 2012 12:20:40 +0000 Received: from mail-lb0-f172.google.com ([209.85.217.172]) (using TLSv1) by na3sys009aob126.postini.com ([74.125.148.12]) with SMTP ID DSNKUDN9FERQwxwQ9hG+nL/dfnhvwaDhJzZH@postini.com; Tue, 21 Aug 2012 05:20:38 PDT Received: by lbbgg6 with SMTP id gg6so3483099lbb.3 for ; Tue, 21 Aug 2012 05:20:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=EkfIk/mnkZUs2ik2W6ZyqfKmFlvQCgDveQoSsuVQBec=; b=JPrbbe4nflFzV+oiJKwTiZETKZA47XUQPEv8RoWHQOKR+g144lOirBSTNFGqgmidu6 l0q6AXVryBM1Urtsb7CtrNiQxUjHfEnRFhMtoEZMjdpXVJs86ML3k4FkkBU9+v5XkBLU aCUwvnXlshXQDxLGIhZSixwc3Jzs8AXUAwbnbkUD9QnQe5aXjMLmgWgahxd1r+HcnV4L w4NZp5ah7jATDMegDJ5jpEp6uyLWh7T/O6KgdKdwHHKDEebpjkkGvELkuqmFx/N8zTN4 YBk+FQPi/dRidl0euKXCBXdaGc7dF0vBfjtBcvkqxKJxme5ngxka5ndcd9qYnXf8KrgV KyOQ== Received: by 10.152.132.133 with SMTP id ou5mr17242707lab.45.1345551631015; Tue, 21 Aug 2012 05:20:31 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id o5sm396072lbg.5.2012.08.21.05.20.29 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Aug 2012 05:20:30 -0700 (PDT) From: Felipe Balbi To: alan@linux.intel.com Subject: [PATCH v2 08/13] serial: omap: move THRE check to transmit_chars() Date: Tue, 21 Aug 2012 15:16:06 +0300 Message-Id: <1345551371-18862-9-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.12.rc3 In-Reply-To: <1345551371-18862-1-git-send-email-balbi@ti.com> References: <1345540555-24359-1-git-send-email-balbi@ti.com> <1345551371-18862-1-git-send-email-balbi@ti.com> X-Gm-Message-State: ALoCoQngAMz5LBcMNzfieAcFOUmKEHBBO81wDHi6nFbpLxWBEb6W/NOTkQDpW7164lmw3Ss+MIMN X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.155 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Kevin Hilman , Tony Lindgren , Linux Kernel Mailing List , Felipe Balbi , Santosh Shilimkar , linux-serial@vger.kernel.org, Linux OMAP Mailing List , Shubhrajyoti Datta , Linux ARM Kernel Mailing List X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org since all other IRQ types now do all necessary checks inside their handlers, transmit_chars() was the only one left expecting serial_omap_irq() to check THRE for it. We can move THRE check to transmit_chars() in order to make serial_omap_irq() more uniform. Acked-by: Santosh Shilimkar Signed-off-by: Felipe Balbi --- drivers/tty/serial/omap-serial.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index fe9852b..bb63dc9 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -195,11 +195,14 @@ static void serial_omap_stop_rx(struct uart_port *port) pm_runtime_put_autosuspend(up->dev); } -static void transmit_chars(struct uart_omap_port *up) +static void transmit_chars(struct uart_omap_port *up, unsigned int lsr) { struct circ_buf *xmit = &up->port.state->xmit; int count; + if (!(lsr & UART_LSR_THRE)) + return; + if (up->port.x_char) { serial_out(up, UART_TX, up->port.x_char); up->port.icount.tx++; @@ -370,8 +373,7 @@ static inline irqreturn_t serial_omap_irq(int irq, void *dev_id) check_modem_status(up); break; case UART_IIR_THRI: - if (lsr & UART_LSR_THRE) - transmit_chars(up); + transmit_chars(up, lsr); break; case UART_IIR_RX_TIMEOUT: /* FALLTHROUGH */