From patchwork Mon Sep 10 04:14:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 1429631 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id D0CFC40220 for ; Mon, 10 Sep 2012 04:20:59 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TAvRL-0002vE-8H; Mon, 10 Sep 2012 04:17:41 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TAvQL-0001qa-F1 for linux-arm-kernel@lists.infradead.org; Mon, 10 Sep 2012 04:16:38 +0000 Received: by mail-pb0-f49.google.com with SMTP id rq8so2004197pbb.36 for ; Sun, 09 Sep 2012 21:16:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :x-gm-message-state; bh=SmlKPfCFCrGSuUry8EgnR4iKzTqG8s82FiovlD4XoDI=; b=lwBxWR3C4umAaRcVizp9GFaxlszIQxJoPHygO59Be1HVy+vd/8D0xTVHqfqbHqi4Y/ QBvDfrlyG/oTnLjb6BFxH7rMew51ZkNZKTeAIEtQaSyXGeeFILoNmRFNXCjRrTzOyxdr WPOv10QDVhHfkMmIeKjgl6qog8Pbe2Ht98OoPsSuR0J4ajyb8a9G1Hy6/FexL575Fa2j wErnY4dbiNZoM+ls6NHS4LbXfkm+Tfj/ZM3lOC+aTbChu5XN+O+ATB2UPiKhdBQVUFtM IaqafDZ6E0+mhzsNGhwFHRny96nkQiYhiW75oDGUnThp3EU405sFXY0YZc/FgENglgoc uINg== Received: by 10.68.226.38 with SMTP id rp6mr3934215pbc.116.1347250597051; Sun, 09 Sep 2012 21:16:37 -0700 (PDT) Received: from localhost (ip-64-134-230-8.public.wayport.net. [64.134.230.8]) by mx.google.com with ESMTPS id gi2sm1260271pbc.59.2012.09.09.21.16.36 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Sep 2012 21:16:36 -0700 (PDT) Date: Sun, 9 Sep 2012 21:14:04 -0700 From: Anton Vorontsov To: Andrew Morton , Russell King , Jason Wessel , Greg Kroah-Hartman , Alan Cox Subject: [PATCH 09/14] tty/serial/amba-pl011: Implement clear_irqs callback Message-ID: <20120910041404.GI29537@lizard> References: <20120910040802.GA1261@lizard> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120910040802.GA1261@lizard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQkUT3AJiZv0T6WVmV4/rOIXYVVPqXm2KJQBftL/tgZDoht2RYdfPkmYRY1hW0su3GRlXuXP X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, Brian Swetland , linux-kernel@vger.kernel.org, Arve =?utf-8?B?SGrDuG5uZXbDpWc=?= , John Stultz , linux-serial@vger.kernel.org, Colin Cross , kgdb-bugreport@lists.sourceforge.net, kernel-team@android.com, linux-arm-kernel@lists.infradead.org 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: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org It's all pretty straightforward, except for TXIM interrupt. The interrupt has meaning "ready to transmit", so it's almost always raised, and the only way to silence it is to mask it. But that's OK, ops->start_tx will unmask it. Signed-off-by: Anton Vorontsov --- drivers/tty/serial/amba-pl011.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 88e2df2..7522d97 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -1308,6 +1308,18 @@ static void pl011_put_poll_char(struct uart_port *port, writew(ch, uap->port.membase + UART01x_DR); } +static void pl011_clear_irqs(struct uart_port *port) +{ + struct uart_amba_port *uap = (struct uart_amba_port *)port; + unsigned char __iomem *regs = uap->port.membase; + + writew(readw(regs + UART011_MIS), regs + UART011_ICR); + /* + * There is no way to clear TXIM, this is "ready to transmit IRQ", so + * we simply mask it. ops->start_tx will unmask it. + */ + writew(readw(regs + UART011_IMSC) & ~UART011_TXIM, regs + UART011_IMSC); +} #endif /* CONFIG_CONSOLE_POLL */ static int pl011_hwinit(struct uart_port *port) @@ -1713,6 +1725,7 @@ static struct uart_ops amba_pl011_pops = { .poll_init = pl011_hwinit, .poll_get_char = pl011_get_poll_char, .poll_put_char = pl011_put_poll_char, + .clear_irqs = pl011_clear_irqs, #endif };