From patchwork Mon May 5 00:05:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Song <21cnbao@gmail.com> X-Patchwork-Id: 4111201 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A45719F23C for ; Mon, 5 May 2014 00:11:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A183920411 for ; Mon, 5 May 2014 00:11:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 46BA620251 for ; Mon, 5 May 2014 00:11:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wh6Qb-0000Qv-Qj; Mon, 05 May 2014 00:06:41 +0000 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wh6QY-0000N0-6u for linux-arm-kernel@lists.infradead.org; Mon, 05 May 2014 00:06:38 +0000 Received: by mail-pa0-f49.google.com with SMTP id lj1so3034146pab.22 for ; Sun, 04 May 2014 17:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=OKGIfLi3DGNNI/Ab4ANen500AbabHcIrtIiSdzxPha4=; b=tn4kJqXHIYqpCXpwlF28vq4hZFyorXoqkoxi34Tq9OftqGBfTdKDEqodSZTatLijvG X9DFuWl1ZEW7BEs4+q7RK/892LKFX2Q47HROS5i5N9oXL3Q+6oZm91vIdhD8KdCkdth1 Q4NYnRfxwE1TMFcXZbnNTYbjLM8N3tkD25AjRkyJz+Ry2ZpRnNTUtfwe5/DluraiG26u 8MJXOoxSAczYh4XcBNmLjskWnI1NFkYmlYps0mlOMIQX9eQWc8GhwAW3Z9hmWgK7VMua 78/ZdFGVz+SviK9SwwkpvSRPlhgeO472JtEZmjkD1A+aahaQ6WPMPlSWUnXnvlADJGuV AGAA== X-Received: by 10.66.251.233 with SMTP id zn9mr65398321pac.67.1399248376367; Sun, 04 May 2014 17:06:16 -0700 (PDT) Received: from localhost.localdomain ([101.44.180.213]) by mx.google.com with ESMTPSA id tu3sm56237398pab.1.2014.05.04.17.06.12 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 04 May 2014 17:06:15 -0700 (PDT) From: Barry Song <21cnbao@gmail.com> To: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org Subject: [PATCH] serial: sirf: move to writel for TXFIFO instead of writeb Date: Mon, 5 May 2014 08:05:51 +0800 Message-Id: <1399248352-7329-1-git-send-email-21cnbao@gmail.com> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140504_170638_291164_C2CD18BD X-CRM114-Status: GOOD ( 10.73 ) X-Spam-Score: -0.1 (/) Cc: workgroup.linux@csr.com, linux-arm-kernel@lists.infradead.org, Barry Song X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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: Barry Song All SiRFSoC UART registers are in 32-bits. If we use writeb for TXFIFO, actually all of 32-bits are still written, for TXTIFO, only low 8-bits are valid, so in prima2&atlas6, this causes no problem. But in the new atlas7, using writeb to write UART registers will cause an imprecise data abort as HW does check the "wrong" writeb. So move to writel and this also makes the code consistent with sirfsoc_uart_pio_tx_chars() in which we use writel. Signed-off-by: Barry Song --- drivers/tty/serial/sirfsoc_uart.c | 2 +- drivers/tty/serial/sirfsoc_uart.h | 2 -- 2 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/sirfsoc_uart.c b/drivers/tty/serial/sirfsoc_uart.c index 68b0fd4..845548c 100644 --- a/drivers/tty/serial/sirfsoc_uart.c +++ b/drivers/tty/serial/sirfsoc_uart.c @@ -1228,7 +1228,7 @@ static void sirfsoc_uart_console_putchar(struct uart_port *port, int ch) while (rd_regl(port, ureg->sirfsoc_tx_fifo_status) & ufifo_st->ff_full(port->line)) cpu_relax(); - wr_regb(port, ureg->sirfsoc_tx_fifo_data, ch); + wr_regl(port, ureg->sirfsoc_tx_fifo_data, ch); } static void sirfsoc_uart_console_write(struct console *co, const char *s, diff --git a/drivers/tty/serial/sirfsoc_uart.h b/drivers/tty/serial/sirfsoc_uart.h index 8a6edda..4280819 100644 --- a/drivers/tty/serial/sirfsoc_uart.h +++ b/drivers/tty/serial/sirfsoc_uart.h @@ -441,9 +441,7 @@ struct sirfsoc_uart_port { /* Register Access Control */ #define portaddr(port, reg) ((port)->membase + (reg)) -#define rd_regb(port, reg) (__raw_readb(portaddr(port, reg))) #define rd_regl(port, reg) (__raw_readl(portaddr(port, reg))) -#define wr_regb(port, reg, val) __raw_writeb(val, portaddr(port, reg)) #define wr_regl(port, reg, val) __raw_writel(val, portaddr(port, reg)) /* UART Port Mask */