Received: by 10.213.65.68 with SMTP id h4csp3486779imn; Tue, 3 Apr 2018 05:56:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx48OB+5v1hWk+XrdAxSfnCaMW0gW9bao9ZgCz09XMtydIMWckqQ7NlKvCG4+OZsIEBJAygaN X-Received: by 2002:a17:902:ab88:: with SMTP id f8-v6mr13999551plr.34.1522760205923; Tue, 03 Apr 2018 05:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522760205; cv=none; d=google.com; s=arc-20160816; b=VJGCSrSuyT4/JrM2SDAFYtYozBdgW9EQN9SH4CWEukYtbdCFmWdvZ6RGlNSOmyjb/Q PpdYTN64hqJpOoZHmLUrj/YdU6Fw/artkRvxanCzaCcWew/Z3zIR4GC1R5OXV7KJBCd9 2HThfjajXA/2yptTfne+RdIyGpcAlNnsIh8hqT+rGTtozRSqIvGo7kng0FK61o0RkWeC vhwMEjDjQZ9A6UoyWvNt3eoeSWLx8ia/NLqJ7ZjkZiaPXZ6Z0CJtnNQVcoOB+MuAsVc5 r5tatxlvRQ2O4KYF1RXGHDCJP/iYs/FifHTQt9a1YRxEPd1szjW84tmtyp+x0AjcTpbK 3rtA== 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=zLAHVAAOS23ZVz8ry+TPj506Bt30Hc/h7buIOpTfzn4TXn/OkxSc7cBcIm9xeGJL4d CV68sGbelzartrQTUvIXQyzluJ8aaGgwBbkKP8vXK/Ygm/SsS/xm23/KqdNnYSuQpka8 Rdt9QBVdCrmbdtHGnX71N0nYewXfUOC6A4v7+6IpoBC8qvcNZK61pb26jgxfHuV6FvqE kaCWq3Z/Wc4AegZiTWZj3f1A1OjZhD8vtC/UXDsoiBetib0fUhVXlrT22DClizR/qmDE zcPHSyxvliprVX0iLY9AwEiz5n6StnQIPXNlPExLx9dtQmhyR8PKzFoNwiBwCazVGiON MqvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=b7ZW3g/w; dkim=pass header.i=@codeaurora.org header.s=default header.b=b7ZW3g/w; 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 e13-v6si484882pln.361.2018.04.03.05.56.31; Tue, 03 Apr 2018 05:56:45 -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=b7ZW3g/w; dkim=pass header.i=@codeaurora.org header.s=default header.b=b7ZW3g/w; 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 S932189AbeDCMzS (ORCPT + 99 others); Tue, 3 Apr 2018 08:55:18 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:33162 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932087AbeDCMzQ (ORCPT ); Tue, 3 Apr 2018 08:55:16 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id AF6B660850; Tue, 3 Apr 2018 12:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522760115; bh=gt/baHg+YOtYxbcPB+ga2CKKrno8z+c2HwxNKeRapjE=; h=From:To:Cc:Subject:Date:From; b=b7ZW3g/wGByB4VDiDqkVE1WPQCCCGdBrWhDVh/IS+AJN53eHPc6Z9f5djFl3lqosT KX1XWbhpWexb5uMwFJxywVeZlxUWn+qQYd0xs72vf8FDylEABPfhtaYqWsxNdvmQx2 TqqwKGTXgWc+bqVCwpTGdd5beqweIYhFDJdjDhdw= 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 EA1B1605FF; Tue, 3 Apr 2018 12:55:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522760115; bh=gt/baHg+YOtYxbcPB+ga2CKKrno8z+c2HwxNKeRapjE=; h=From:To:Cc:Subject:Date:From; b=b7ZW3g/wGByB4VDiDqkVE1WPQCCCGdBrWhDVh/IS+AJN53eHPc6Z9f5djFl3lqosT KX1XWbhpWexb5uMwFJxywVeZlxUWn+qQYd0xs72vf8FDylEABPfhtaYqWsxNdvmQx2 TqqwKGTXgWc+bqVCwpTGdd5beqweIYhFDJdjDhdw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org EA1B1605FF 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 v3 1/2] MIPS: io: prevent compiler reordering on the default writeX() implementation Date: Tue, 3 Apr 2018 08:55:03 -0400 Message-Id: <1522760109-16497-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