Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3741360imm; Mon, 18 Jun 2018 03:20:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJbQ1YGpP/at95h1aoKy0xFrYRm6MiXh/tw0ASkSTrlIGgH1mR59wlENhFW5fsu2eav7OY5 X-Received: by 2002:a63:755d:: with SMTP id f29-v6mr10434366pgn.278.1529317206606; Mon, 18 Jun 2018 03:20:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529317206; cv=none; d=google.com; s=arc-20160816; b=nE5vQ9W/rfIUXbNmL4xr1z3Lv8c4sLUF6KcCaiA90GMwgT1C+q6CE+qlWdyQqQUaxF gpD7Af7PHjSW3EXu6KcR+5MaXagJvx63mHMPNWFKNazp2MiFrj91CsQOtiliXlb++jCu wIWVERWnVnTQsLsPLXI6g8Ig9PshI6YWhO/DNzB2mlZHRqt5CIigMC1XG9hrMZZJnt70 GtEbnYgw55JaujVtb42rwqcj15qdknBM0Rkurr2D7ZxRLD7YitG/naWtQgJocfrFgMyD 3t0CLoPjpfCVHpDbdVB25TF39rQ/KZHeIwZzBSVfqyOlk2ogCIWn9gJlBsdURqdiS4SR +btw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=MKjbpvPVsDKcTgEWMRNrHkcg7IpD32bIR7ZroA2PH64=; b=o0b5OA24QqHGy3tqqkCVf/nHVs9Qgv1c7aiqikUdDewoSi5fwSF1bq8U8lwtAcyxHu u6H5v0vYSXtcixEfGzNpHBPkpA1mLQKRRGJjoxP1vMeaoy9d7FYA4aHbuGDg8vnxOws6 OEduAPwrsq5iiiyy5lINGYcl+vxrSGU5gB/AuTG9+FAuUEN9LCist7nqSiK58n4xATCi vPDAv8g7oBcTkTtysgeNs0lOVh10omL3HE6FSQJFAP2Tytkk8bujJHswdxCzdhyygvnH SxH5P88V2y6fqIZiaGxJkxyw4sw8zJRoMqHg5iYtrKp/F/TGEuDJnDXGD9vgNlIjJ2pu Thow== ARC-Authentication-Results: i=1; mx.google.com; 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 m3-v6si14847870plt.71.2018.06.18.03.19.52; Mon, 18 Jun 2018 03:20:06 -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; 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 S933974AbeFRIPm (ORCPT + 99 others); Mon, 18 Jun 2018 04:15:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52840 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933763AbeFRIPj (ORCPT ); Mon, 18 Jun 2018 04:15:39 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CBAE4C7A; Mon, 18 Jun 2018 08:15:38 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sinan Kaya , Arnd Bergmann , Ralf Baechle , Paul Burton , linux-mips@linux-mips.org, James Hogan , Sasha Levin Subject: [PATCH 4.16 006/279] MIPS: io: Prevent compiler reordering writeX() Date: Mon, 18 Jun 2018 10:09:51 +0200 Message-Id: <20180618080609.101669238@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618080608.851973560@linuxfoundation.org> References: <20180618080608.851973560@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sinan Kaya [ Upstream commit f6b7aeee8f167409195fbf1364d02988fecad1d0 ] writeX() has strong ordering semantics with respect to memory updates. In the absence of a write barrier or a compiler barrier, the compiler can reorder register and memory update instructions. This breaks the writeX() API. Signed-off-by: Sinan Kaya Cc: Arnd Bergmann Cc: Ralf Baechle Cc: Paul Burton Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/18997/ [jhogan@kernel.org: Tidy commit message] Signed-off-by: James Hogan Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/mips/include/asm/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -307,7 +307,7 @@ static inline void iounmap(const volatil #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) \