Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3081427imm; Sun, 1 Jul 2018 11:50:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfT4PqiNpSa17trgdA6k95dcUNwuH6XdWz6BlcTLkA4oPElugimq6P75deAe36s40x/6w6d X-Received: by 2002:a65:5245:: with SMTP id q5-v6mr8427462pgp.67.1530471046969; Sun, 01 Jul 2018 11:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530471046; cv=none; d=google.com; s=arc-20160816; b=QR32LofXJz5NxNQO+eWN/Q3kUKCwnL8ABnwfXbKgOvn50ei+U5XzlngY+KNLfY6jF2 GXuokROseGav04JIl6btMeUixWkSkrMgNW4t5YU8WZycXlv+07/UQrbXhcFL3e63N5U0 w/9ywLzbvrHO/P4ODqhmSE38+sZoV1RdVmkU9U4wYiuJWKfv6nsZ1JJtShFoRzRBxzMn kDP8S8RSyaVy6EHLOEDH2a2rZgVSUcAh+RL2MaVnPWT+oX4lXNdtpY7jy8/HHFXuOD45 PzMdldWfBXab/TQEB69Rc24gyqORi4fq4TFasD2+0au1s96Lwq5Kvk+ry252WrE5ARF3 DYjg== 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=2v7H14gMSIK3DmYKZjtNLNfONU60CwQQoe1roMNxD4Y=; b=M/K3bfks6P+pxx/X/s8UP9Q9Ck2KdIu61Zsl5XYcF1fZjd4HSkKz18ceLk6v8/FWQ3 zR2DsjdddMRMcQtkssF3I4ehYzd54MlYQagR9RNbGKkqlc3j0Gw3Ay7OmDdgk82RxIXv iA+AHty9biMOa+rfYTnFAIzXbYgj1UWUwYDsQGfmbBH6XkrWqJ/eCaNKq7atGRlTYq5e J6rBssa8/tRF3edFABmWmzgWqbsC2npSr8H12rvku8gYf70DoxHLw4UMJqFuMtTTsELg KJH86YqA+EIaCZssSwwU+DC1chNGVuuY0XbFuHYYicmpa+7L035ZrQi2y+UfA3HP8MbF 5UQg== 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 h1-v6si15136306pfb.70.2018.07.01.11.50.32; Sun, 01 Jul 2018 11:50:46 -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 S1752879AbeGAStM (ORCPT + 99 others); Sun, 1 Jul 2018 14:49:12 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59710 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752612AbeGAQL2 (ORCPT ); Sun, 1 Jul 2018 12:11:28 -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 18A09AEF; Sun, 1 Jul 2018 16:11:25 +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 3.18 05/85] MIPS: io: Add barrier after register read in readX() Date: Sun, 1 Jul 2018 18:01:23 +0200 Message-Id: <20180701153122.580288823@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: Sinan Kaya [ Upstream commit a1cc7034e33d12dc17d13fbcd7d597d552889097 ] While a barrier is present in the writeX() functions before the register write, a similar barrier is missing in the readX() functions after the register read. This could allow memory accesses following readX() to observe stale data. Signed-off-by: Sinan Kaya Reported-by: Arnd Bergmann Cc: Ralf Baechle Cc: Paul Burton Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/19069/ [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, 2 insertions(+) --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -375,6 +375,8 @@ static inline type pfx##read##bwlq(const BUG(); \ } \ \ + /* prevent prefetching of coherent DMA data prematurely */ \ + rmb(); \ return pfx##ioswab##bwlq(__mem, __val); \ }