Received: by 10.192.165.156 with SMTP id m28csp1395998imm; Mon, 16 Apr 2018 21:10:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx49u72szvr1ShG1DZP/SJ0S0COODkmCSe+53r6HIUW36vWOrEvfu13DUkfKzUI/guOt+dvoP X-Received: by 10.98.68.86 with SMTP id r83mr507543pfa.145.1523938259587; Mon, 16 Apr 2018 21:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523938259; cv=none; d=google.com; s=arc-20160816; b=s7+rEnkukpCIVTQ0XfW2ky7a1oV2FzdfChHSssmyDNu8VTgFqzSls8yNkupUOlEwnn iRUgFbWIsWWtG7yQoMCzXmuSz4DXNJDMfH/5/ZX7aE6yTXBxTs0z1Iz5nnrW57C0QAAE RdSpohUQEynbQJ7dQk+8Dmfkr7pVQ+T82Wi3PWVYFRtn+jsRKA37pznSNI0Zi34Fy9l9 ni06RQsMeT4wNFi/bm6o3xThurZv/Fcggxu2ctuT51X8CEWPwbYixSmkSZWMlajaZnr5 2j6agkcIaScC2pGOBpL+39ia+/FyX/MtU2qTqQNsO8u8uehXNm/70Ok09kpwpL5uV9z6 FwKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dmarc-filter:dkim-signature :dkim-signature:arc-authentication-results; bh=SzlreaRSHA0aX10IZFhQiYj2mFF6rlRAlvA1FtABoyM=; b=Mx3woYFl+P9GbNjjKkKo74SDGFlyfrDFb9FCYasyunOfSqpj8j9oQC3U7im1z3BQQT CXJVj9Wg11Y8Ak4/b8BdODqM3j+Ai4veiItKEPvlpdvlqarTDfaKP7wPbtKUi9OASLfL DCnQtuubzZWjDeNPf1WKtlMX8sW5O1dDgeujWS2qUIofjPzS8hQ2U1R5eRSW7hK13XFw ckv3PX907l2auOiJpAI2FNdirzAeV1286hgBThfOfj8MS9yWKrdcBhc0rq2XdbgZW+54 b4lznmKg82s5297eV1jfWemlJw/1eu90WJXM7OxjA6G5PWLGlUGBv7ZpA2kWjHsOAHjf 902g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=PWKPpMyp; dkim=pass header.i=@codeaurora.org header.s=default header.b=ZPM4Yw+Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i64si2432869pgc.323.2018.04.16.21.10.45; Mon, 16 Apr 2018 21:10:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=PWKPpMyp; dkim=pass header.i=@codeaurora.org header.s=default header.b=ZPM4Yw+Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752510AbeDQEJG (ORCPT + 99 others); Tue, 17 Apr 2018 00:09:06 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:47704 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752261AbeDQEJD (ORCPT ); Tue, 17 Apr 2018 00:09:03 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3A55B602B8; Tue, 17 Apr 2018 04:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523938143; bh=sCQGuLK4L3UgFxvytfuLMoihb5z5GU54TY5P9NCpoXo=; h=From:To:Cc:Subject:Date:From; b=PWKPpMypUKv0ilodm7WgKlvjYiFry5eBMDlK8pR8jJCuwUx/abL3QTMNB/EcjjK7y j0KpRfXMlB7ABmnEuc6yzcPfvRmTB0z0kWpIqndPkiVbTSdR3hwkddtRwcXXMDlgEz /OeCcHL8kFzqOuZ2GJrgh3/r9fWVhRKHCtulNySU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 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 E50EA602B8; Tue, 17 Apr 2018 04:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523938142; bh=sCQGuLK4L3UgFxvytfuLMoihb5z5GU54TY5P9NCpoXo=; h=From:To:Cc:Subject:Date:From; b=ZPM4Yw+YDxIdh4viz3R0qBUOYxCzSUL44xQGYioBtbJ7JCUjUvmP9UwGOZxs4+lbb R0jtqqPppyduo5MfPgF6nA0CpAflJ2pTCS/mwtBHQsvUF6KKtH+Nf0yc37pabwRbY+ c5tvR3vM9ZqA/GnCwewNh5/ZHX0g8kw0jB3LA3iQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E50EA602B8 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 Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , "James E.J. Bottomley" , Helge Deller , Thomas Gleixner , Greg Kroah-Hartman , Philippe Ombredanne , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] parisc: define stronger ordering for the default writeX() Date: Tue, 17 Apr 2018 00:08:50 -0400 Message-Id: <1523938133-3224-1-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org parisc architecture seems to be mapping writeX() and writeX_relaxed() APIs to __raw_writeX() API. __raw_writeX() API doesn't provide any kind of ordering guarantees. commit 755bd04aaf4b ("io: define stronger ordering for the default writeX() implementation") changed asm-generic implementation to use a more conservative approach towards the writeX() API. Place a barrier() before the register write so that compiler doesn't optimize across the regiter operation. Signed-off-by: Sinan Kaya --- arch/parisc/include/asm/io.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/parisc/include/asm/io.h b/arch/parisc/include/asm/io.h index afe493b..2ec6405 100644 --- a/arch/parisc/include/asm/io.h +++ b/arch/parisc/include/asm/io.h @@ -196,18 +196,22 @@ static inline unsigned long long readq(const volatile void __iomem *addr) static inline void writeb(unsigned char b, volatile void __iomem *addr) { + barrier(); __raw_writeb(b, addr); } static inline void writew(unsigned short w, volatile void __iomem *addr) { + barrier(); __raw_writew((__u16 __force) cpu_to_le16(w), addr); } static inline void writel(unsigned int l, volatile void __iomem *addr) { + barrier(); __raw_writel((__u32 __force) cpu_to_le32(l), addr); } static inline void writeq(unsigned long long q, volatile void __iomem *addr) { + barrier(); __raw_writeq((__u64 __force) cpu_to_le64(q), addr); } -- 2.7.4