From patchwork Mon Nov 16 17:41:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 7629511 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5D22EBF90C for ; Mon, 16 Nov 2015 17:45:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A19220562 for ; Mon, 16 Nov 2015 17:45:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A578B2053C for ; Mon, 16 Nov 2015 17:45:40 +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 1ZyNod-0006fh-LL; Mon, 16 Nov 2015 17:43:43 +0000 Received: from pandora.arm.linux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyNmz-0004m6-4z for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2015 17:42:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora-2014; h=Date:Sender:Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References:In-Reply-To; bh=aG/T6bJpGdvopkn+GsaOl4J2GLu/UnbnBZ4NBjvVL2Q=; b=qfIP41+VwhRpTPEX1zWoS668aKjaWQnmndE7RMWWvqdQYcEtw0NGTK5E8tCKL3gsZqb9OZSVFsqB32/lIPG9BfylQkKXFfui5+HKAe7aCgbxOAKaRjsFgNxphJunmgmxucUcgJ3l8kbLmKD8Adw5UmoOVn3f9b26Gbdc2Ni/qrY=; Received: from e0022681537dd.dyn.arm.linux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:34965 helo=rmk-PC.arm.linux.org.uk) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1ZyNmB-0005mX-EF; Mon, 16 Nov 2015 17:41:11 +0000 Received: from rmk by rmk-PC.arm.linux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1ZyNm2-0003kQ-Oh; Mon, 16 Nov 2015 17:41:02 +0000 In-Reply-To: <20151116173935.GQ8644@n2100.arm.linux.org.uk> References: <20151116173935.GQ8644@n2100.arm.linux.org.uk> From: Russell King To: linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 12/12] tty: amba-pl011: switch to using relaxed IO accessors MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Mon, 16 Nov 2015 17:41:02 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151116_094202_149759_642CBA85 X-CRM114-Status: GOOD ( 11.54 ) X-Spam-Score: -5.1 (-----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Hurley , Andre Przywara , Linus Walleij , Andrew.Jackson@arm.com, Timur Tabi , Greg Kroah-Hartman , Jiri Slaby , Jun Nie Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 Using relaxed IO accessors allows GCC to better optimise this code as we eliminate the heavy memory barriers - for example, GCC can now cache the address of a register across a read-modify-write sequence, rather than reloading the base address, offset and access size flag. Signed-off-by: Russell King --- drivers/tty/serial/amba-pl011.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 54c6c88a71a3..a7d7ab05dc64 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -262,7 +262,7 @@ static unsigned int pl011_read(const struct uart_amba_port *uap, { void __iomem *addr = uap->port.membase + pl011_reg_to_offset(uap, reg); - return uap->access_32b ? readl(addr) : readw(addr); + return uap->access_32b ? readl_relaxed(addr) : readw_relaxed(addr); } static void pl011_write(unsigned int val, const struct uart_amba_port *uap, @@ -271,9 +271,9 @@ static void pl011_write(unsigned int val, const struct uart_amba_port *uap, void __iomem *addr = uap->port.membase + pl011_reg_to_offset(uap, reg); if (uap->access_32b) - writel(val, addr); + writel_relaxed(val, addr); else - writew(val, addr); + writew_relaxed(val, addr); } /*