Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3076638imm; Sun, 1 Jul 2018 11:42:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKLC8je9LxA9jvMi+DkRxveQTHATAkeChuPPcDBX0l6VAQoLmAH33CwLRqsvBcZqMhogN3q X-Received: by 2002:a17:902:7d89:: with SMTP id a9-v6mr22900889plm.238.1530470579730; Sun, 01 Jul 2018 11:42:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530470579; cv=none; d=google.com; s=arc-20160816; b=YbSwpM7dXpQ6WbSSj9pNlsN/+OYkIUjqLtINXuFImb3VbvGGDoqlbNUOYroguaafk5 zO96B5xQh+mURu57vfvmoVCi8h1AXMsKyCL60qivOIcZGQruXs664ogMljXwwt/UK0Mr uCO8dsIlSiID6xD6xO/1A2CRtb7C53tlgU8uu+WJiv4/unPnEm/syrHitkYsFYmtr+HU 4j7dOKfLn2AMemzosfsEbIGKE39ZqpZNdHMmqJ7SfUQiM/N28MMfeTj51IpxTB0szoWe Ii4ONHnBXF7QlevO5lGbgCodRaDqd+2fqzLXuDqDIdoQ8r672oyDrAScFWNqofke1mNr iG3w== 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=SJwfx/RUn0XRntbkhXlh1ncVJnaKTUMRdpq02kmpjao=; b=S0k1ujNkTd1laCYqNIN1eicg6+Io7JJPKP4pBMaeM/3wUnzXiCc7uawbSe88eKIvo+ HqEdFG6X4ccP+YEKoWICjeRUcdbyIkbvrobGsGI60YGbJIxhGK9SNminCfhRd7gVVxrM 32rRtnjraqCCdVcG1nnRHh4Kolthmy6xBiKnugw7Z7Cs2zNO9RtzOo21opoE2/i6D1wb uugPa1Ci00fa/iBbTrQ+co1SIOcFK47ldKR3+D+QNNDNkoZozY6QUt02NGNv55HSpqTo VTXG85KrbGkkwCj6qn1B+ELsAu7NvPpQ8BRMKr/U+Ne9PdKJcTvfLNMEvUcPoQC9pG+5 LgPg== 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 j5-v6si13783844pfh.3.2018.07.01.11.42.45; Sun, 01 Jul 2018 11:42: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; 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 S1753061AbeGAQOD (ORCPT + 99 others); Sun, 1 Jul 2018 12:14:03 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60254 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932722AbeGAQN5 (ORCPT ); Sun, 1 Jul 2018 12:13:57 -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 3766F86A; Sun, 1 Jul 2018 16:13:57 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Huacai Chen , Paul Burton , James Hogan , linux-mips@linux-mips.org, Fuxin Zhang , Zhangjin Wu , Huacai Chen Subject: [PATCH 3.18 70/85] MIPS: io: Add barrier after register read in inX() Date: Sun, 1 Jul 2018 18:02:28 +0200 Message-Id: <20180701153125.162697389@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701153122.365061142@linuxfoundation.org> References: <20180701153122.365061142@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 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Huacai Chen commit 18f3e95b90b28318ef35910d21c39908de672331 upstream. While a barrier is present in the outX() functions before the register write, a similar barrier is missing in the inX() functions after the register read. This could allow memory accesses following inX() to observe stale data. This patch is very similar to commit a1cc7034e33d12dc1 ("MIPS: io: Add barrier after register read in readX()"). Because war_io_reorder_wmb() is both used by writeX() and outX(), if readX() need a barrier then so does inX(). Cc: stable@vger.kernel.org Signed-off-by: Huacai Chen Patchwork: https://patchwork.linux-mips.org/patch/19516/ Signed-off-by: Paul Burton Cc: James Hogan Cc: linux-mips@linux-mips.org Cc: Fuxin Zhang Cc: Zhangjin Wu Cc: Huacai Chen Signed-off-by: Greg Kroah-Hartman --- arch/mips/include/asm/io.h | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -412,6 +412,8 @@ static inline type pfx##in##bwlq##p(unsi __val = *__addr; \ slow; \ \ + /* prevent prefetching of coherent DMA data prematurely */ \ + rmb(); \ return pfx##ioswab##bwlq(__addr, __val); \ }