From patchwork Tue Apr 17 04:08:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10344313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 89F4360542 for ; Tue, 17 Apr 2018 04:09:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79AE028929 for ; Tue, 17 Apr 2018 04:09:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DDAD28987; Tue, 17 Apr 2018 04:09:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D647F28929 for ; Tue, 17 Apr 2018 04:09:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=L9PCyvHFMLbwkt+m4hcdqv0Hm+CKg/JN8E2EAqwqKBE=; b=S27XBHVjoxbeew VxDvknZOo/awN7mjP/5v0Z579SrsGh1U9t2zuE0TM8Lh3+5ngLM9NFy/WGqOGk79mlbkD9k3YystP tFLfL7MJfuWHbWf2yB+5tO0PYVtxpvJmfTvKttXsYgHHVzUF1GA9MhRElNt5WfPIxsA2TGwY+Z7EP UuRmki3/RiLDaqdhWGm4KEuEwcvMBXrQ35ZBj+lqIP2uheW5f3ZHeDfms9K8b9JPq/ywNF4+1B2tC dOWimPt+4spS4IhGonnOlsTQNMB/La5fOT5mbws7/kv0YjG3M1nrqMXCls+dAOe9BRkD2dFIPYl+P ALdjbWZll4WcPNuhcTTg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f8Hw0-0002fy-SM; Tue, 17 Apr 2018 04:09:36 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f8Hve-0002Q1-EM for linux-arm-kernel@lists.infradead.org; Tue, 17 Apr 2018 04:09:15 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2A78360F90; Tue, 17 Apr 2018 04:09:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523938146; bh=QsXWJ7n5QFEPPozYapfK25KnnzXqw/pvE1CeU+kYbZ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e5i9quRlrpThYjMhiLSdZlf6/6tPp5YyGmjKtAFwErgUide7gR+fxfiH6J817iToI LTDm+vWJtNgOOo0uCXfid8EzpMl/e7VZBOZoCB+eP7bOofI2l8OKplYy0LmoR5zSf2 ZTcksutu8N4b48e4KE7/mvwaRXTAxEHcgqlO/LwU= Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3F49660F6E; Tue, 17 Apr 2018 04:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523938145; bh=QsXWJ7n5QFEPPozYapfK25KnnzXqw/pvE1CeU+kYbZ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QMDxXVjnHPxh1JmgOK2am69dz6w9OEt/BBRjI3NnAqHkM/Kwz3FZLSkiAq58SDDwG 4ZgNPj9zX0ZS4Oolk3lecA0J6fJy/cx/EP7cDUPqBN9OjaqpUQgjk1KqrXjp1sGnIq P1JdcQsSu2FXhk9QPv6qgfTmbQpOiYGjt+lsmQSA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3F49660F6E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-parisc@vger.kernel.org, arnd@arndb.de, timur@codeaurora.org, sulrich@codeaurora.org Subject: [PATCH v2 2/2] parisc: define stronger ordering for the default readX() Date: Tue, 17 Apr 2018 00:08:51 -0400 Message-Id: <1523938133-3224-2-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523938133-3224-1-git-send-email-okaya@codeaurora.org> References: <1523938133-3224-1-git-send-email-okaya@codeaurora.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180416_210914_516789_AD7D9751 X-CRM114-Status: GOOD ( 11.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kate Stewart , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, Helge Deller , "James E.J. Bottomley" , linux-kernel@vger.kernel.org, Sinan Kaya , Philippe Ombredanne , Thomas Gleixner , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP parisc architecture seems to be mapping readX() and readX_relaxed() APIs to __raw_readX() API. __raw_readX() API doesn't provide any kind of ordering guarantees. commit 032d59e1cde9 ("io: define stronger ordering for the default readX() implementation") changed asm-generic implementation to use a more conservative approach towards the readX() API. Place a barrier() after the register read so that compiler doesn't optimize across the regiter operation. Signed-off-by: Sinan Kaya --- arch/parisc/include/asm/io.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/arch/parisc/include/asm/io.h b/arch/parisc/include/asm/io.h index 2ec6405..e04c4ef 100644 --- a/arch/parisc/include/asm/io.h +++ b/arch/parisc/include/asm/io.h @@ -179,19 +179,34 @@ static inline void __raw_writeq(unsigned long long b, volatile void __iomem *add static inline unsigned char readb(const volatile void __iomem *addr) { - return __raw_readb(addr); + unsigned char ret; + + ret = __raw_readb(addr); + barrier(); + return ret; } static inline unsigned short readw(const volatile void __iomem *addr) { - return le16_to_cpu((__le16 __force) __raw_readw(addr)); + unsigned short ret; + + ret = le16_to_cpu((__le16 __force) __raw_readw(addr)); + barrier(); + return ret; } static inline unsigned int readl(const volatile void __iomem *addr) { - return le32_to_cpu((__le32 __force) __raw_readl(addr)); + unsigned int ret; + ret = le32_to_cpu((__le32 __force) __raw_readl(addr)); + barrier(); + return ret; } static inline unsigned long long readq(const volatile void __iomem *addr) { - return le64_to_cpu((__le64 __force) __raw_readq(addr)); + unsigned long long ret; + + ret = le64_to_cpu((__le64 __force) __raw_readq(addr)); + barrier(); + return ret; } static inline void writeb(unsigned char b, volatile void __iomem *addr)