Received: by 10.192.165.156 with SMTP id m28csp181906imm; Thu, 12 Apr 2018 19:33:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx48qxy6D4ULhfwg8xZzB4B2V76+vMP6IeadXDTHA5Q4bowY62fDRiM1nmr3nuOb4i15+vDH3 X-Received: by 10.98.13.23 with SMTP id v23mr9807090pfi.202.1523586789973; Thu, 12 Apr 2018 19:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523586789; cv=none; d=google.com; s=arc-20160816; b=A5p9xf5t7NVmtIowluL/fB70ewItY4y9PFl8kuG09x8EjuYbJ6tPHf4tIVwXC62Amf aOwv5pg4IzdsBY87aS0NSPlEdG+5AWzp/ifl2W7dIui6RnHVgxRRX4JgB/BqXj1v+H6W 4qLz0BT7vZda4JSN8xu1YLo2l+3nT6Q8220qcBF2rfmSAzdisXM9fpQI1a5BpnzZ4Tlx Fl6pclq1CxU4AMlt3WKR9vNWf7w0N8YcZQj8w5JCPY6/wMYwdkXh4vLVu/8uC+wVc3gb keL1fh1yVzIXr/7ph2Rla4wUnckjiFhXj1aCe/C1BAg2xg28iOuV7vfikvAfvkDb07Tz j+5Q== 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=j870mJjdSui4M/KQdAYzDKfDhSH/F3seP+z8VxpxxhA=; b=CS3mHjSr4MkPoLtrNbMpFQJcBSTyDh7ebscmBkd1hgTt2Yt1zAkxNUL5xyUNIWm3pW inTCCPNVz0RuLVx7hNYOtrlo+0HT1bs0b40gbAiiaRhtMob23WG//LYgFFlDfTKBUC8+ 7KEq5mDGB7hRNnocWXWfB4T8huEVP8BP2eAGdRrK+0ZNqxeQuV6no858AyAdnk7WRzvK IsPJcQTOcNlM0y026PKiu/dFwn+esm5Ik0pQKYWw3yOVnka2b0Tx4CGOb0/nW24s/lPD 8bFa2beyQVrdZBun8tBtviPgAA3U7E30V7NL0mG+qXg7JVqHrGHXzqo4xAVYOxSpyi9w lOAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=BflMDgOP; dkim=pass header.i=@codeaurora.org header.s=default header.b=BflMDgOP; 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 p16si3254999pgc.241.2018.04.12.19.32.56; Thu, 12 Apr 2018 19:33:09 -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=BflMDgOP; dkim=pass header.i=@codeaurora.org header.s=default header.b=BflMDgOP; 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 S1753244AbeDMCaz (ORCPT + 99 others); Thu, 12 Apr 2018 22:30:55 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:48936 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752584AbeDMCax (ORCPT ); Thu, 12 Apr 2018 22:30:53 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E930060274; Fri, 13 Apr 2018 02:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523586652; bh=gt/baHg+YOtYxbcPB+ga2CKKrno8z+c2HwxNKeRapjE=; h=From:To:Cc:Subject:Date:From; b=BflMDgOP1ZK+jkVnrrmjJQFyvfzLgXOMnZlIbxZSvDybIlsY3P6615beHx17+GBeW RqkN0+/5d7rQVJEFNjzMQDZmS5dVWXPgXmu3sa6Vobl7ms6YGB38DKnQXIG8/B8yAE OcR4+a0pc2Y84zAL+OBmqBi862NjN2djOBJaK8Yw= 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 10B7960F8D; Fri, 13 Apr 2018 02:30:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523586652; bh=gt/baHg+YOtYxbcPB+ga2CKKrno8z+c2HwxNKeRapjE=; h=From:To:Cc:Subject:Date:From; b=BflMDgOP1ZK+jkVnrrmjJQFyvfzLgXOMnZlIbxZSvDybIlsY3P6615beHx17+GBeW RqkN0+/5d7rQVJEFNjzMQDZmS5dVWXPgXmu3sa6Vobl7ms6YGB38DKnQXIG8/B8yAE OcR4+a0pc2Y84zAL+OBmqBi862NjN2djOBJaK8Yw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 10B7960F8D 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-mips@linux-mips.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 , Ralf Baechle , James Hogan , Paul Burton , linux-kernel@vger.kernel.org Subject: [PATCH v4 1/2] MIPS: io: prevent compiler reordering on the default writeX() implementation Date: Thu, 12 Apr 2018 22:30:43 -0400 Message-Id: <1523586646-19630-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 writeX() has a strong ordering semantics with respect to memory updates. In the abscence of a write barrier or a compiler barrier, commpiler can reorder register and memory update instructions. This breaks the writeX() API. Signed-off-by: Sinan Kaya --- arch/mips/include/asm/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 0cbf3af..fd00ddaf 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -307,7 +307,7 @@ static inline void iounmap(const volatile void __iomem *addr) #if defined(CONFIG_CPU_CAVIUM_OCTEON) || defined(CONFIG_LOONGSON3_ENHANCEMENT) #define war_io_reorder_wmb() wmb() #else -#define war_io_reorder_wmb() do { } while (0) +#define war_io_reorder_wmb() barrier() #endif #define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \ -- 2.7.4