Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3060760imm; Sun, 1 Jul 2018 11:19:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKtNn/4zjZo6GhTozVTHeU99CMW735qTlEF4OBlnWxC6Cl55be06efI55v8KaN4VHbEn7lu X-Received: by 2002:a65:6031:: with SMTP id p17-v6mr19031505pgu.140.1530469146179; Sun, 01 Jul 2018 11:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530469146; cv=none; d=google.com; s=arc-20160816; b=YvPEuo+aT82fDZ5DMUIEUU3TNpt4uFHOGSjBSvhDF1pxKoGBw3PL8wmNTTrW8ZWEc8 U67pP2BWAqs0AR2sITljl8RqpX1a/iNLV/jP2a0MyJiHnM6zHqyO8q1N/NLayoQYrDtp CAAnQxvNNk8O9EtWMUKKVQ3tcb5y1BwEp2xfZGB4tHeVz+TxiFH1P5Ape1NKvmwYGEko AduYVtEPlnC3tOgyGui28zlvJyOXYtyBc4TiGiE+z9hA8BxZdHnaozs9i24QuYAxpNtQ CPsJp1ICVfwuuZ1NzvUPry78om24Q0F9rX7aYKy5a8aoBzxQ3CJTTBak95Cytud+aUb5 U8KQ== 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=O3MG9x4jxFwHwPABMRkJa6JKrzlM60Ln7/hzsJKq614=; b=oKcl2/AVGH3DzPBqknH9Ie9WOJsoo21f/81AfUu0Q1akn7aR9v8ZVmdLf97IbRmrXS 94nQZyg0YG6UcAoWqYOZQJOo7Q0oc1oZ+Tfy1LjkcV6/L8hFv3w0i6z8KUcY7D6vq3Ox hGsmOxVioiQ+0v1ds9YSnjS9PHoTaDDTzIXpAJiWpnAJb5J8ghL9L4g6PlbuI+YuYCET YlkGjkMcaURPZ+tqFNso6spkx3UlFHPy/qSQCwKpZxN+GxcZDTB1bxvT1h5HyrxqbCqx 5ZrSxAzOiZghB49UsBet56HDDc+n6f7jPMzj1jvemx+Cz+qjheUm1yXxU0aOdmPIHCg3 5bhw== 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 z18-v6si11661047pfl.209.2018.07.01.11.18.51; Sun, 01 Jul 2018 11:19: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 S965429AbeGASQ0 (ORCPT + 99 others); Sun, 1 Jul 2018 14:16:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33872 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964985AbeGAQ0Y (ORCPT ); Sun, 1 Jul 2018 12:26:24 -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 66CC0AEF; Sun, 1 Jul 2018 16:26:23 +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.9 050/101] MIPS: io: Add barrier after register read in inX() Date: Sun, 1 Jul 2018 18:21:36 +0200 Message-Id: <20180701160759.153292731@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160757.138608453@linuxfoundation.org> References: <20180701160757.138608453@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.9-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); \ }