Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3068776imm; Sun, 1 Jul 2018 11:30:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIFu1ujNQEHlUdZsBvPCBw4UtdzmxrnY4VXK4gpNPhl7jBWsaItSjvkGMcMspjtHbzPHFFp X-Received: by 2002:a65:611a:: with SMTP id z26-v6mr19134389pgu.61.1530469859310; Sun, 01 Jul 2018 11:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530469859; cv=none; d=google.com; s=arc-20160816; b=sUtZCWss1qNmwka1G367Mfo63WF5eEH5WohvciwbfAGKfl7wa+Hewt0bZJjPG3O5OI f6Bfac+HpuSxMnQf0uyOLWc/3IW2lY83xV0hL5/bBjY0cdOm15GetnYuenQCSnLsMoVV kINDEcXHFlT1YRZJ0jksH8g8dFqr1HkHUy6O2kCTGhqRMfusvz3NJWVcf+An8pzCr4H4 cJXYE2M1L5yAq5iwvRCVYEqb31kZ+RYbVv+YstPG69Rz3vuZ4sPJH8OHb+f3Qdb2edKd vpKWLr7b+WPLCVUei6/B58u0UQuLTtJAERit7h/uKrt7oG/IkoW1ojtw0qgsud+UbThf dmlw== 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=BEHDhTKvwO/n6KgRuEBfBpNm1+rRP56TA8edHninAmA=; b=F8VxpaOEs4Gi/uIEDaosCNPVR80vJnsPKjkKw5PSEdYUusXfC4VPlMnhUCjlij5ujn fFJTiBI4fiN89DlUDwqES5HqddM7Z0y36VowQsIa7M8SPjb6y6BLTA8SSvB3AkvHPbXx Xpf4QL8RnzA3ja3HdH5HIWfUpFEd0FtdAd+q9AI6BNF09bol/vEQFhhSIyFBCxyq9jno Z4S5Hn8X3ngiN8E7cJQQxN5HOh2Vfvcu/Rxp1wD2P0EByvxExaduY0L+fKFB75D+8zTa uWgXQ6OibSNql25KR/1DgBw8j03g5A4w++XrtmiLK62MiSkT+RukmXpn2M6M/asp6gXJ 2HRQ== 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 s2-v6si14173854plq.372.2018.07.01.11.30.44; Sun, 01 Jul 2018 11:30: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 S964820AbeGAQRi (ORCPT + 99 others); Sun, 1 Jul 2018 12:17:38 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:32826 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932954AbeGAQRe (ORCPT ); Sun, 1 Jul 2018 12:17:34 -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 8121593C; Sun, 1 Jul 2018 16:17:33 +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 4.4 059/105] MIPS: io: Add barrier after register read in inX() Date: Sun, 1 Jul 2018 18:02:09 +0200 Message-Id: <20180701153153.787462042@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701153149.382300170@linuxfoundation.org> References: <20180701153149.382300170@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.4-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 @@ -411,6 +411,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); \ }