Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3336577imu; Sun, 11 Nov 2018 12:39:45 -0800 (PST) X-Google-Smtp-Source: AJdET5dqcowfzyMBi3z0TlMv4GUAG0b1ebpU6TiA9wBalxOabZI6pyjCanpFGoFntR2k9BP3jWe/ X-Received: by 2002:a63:ba48:: with SMTP id l8mr14804403pgu.72.1541968785348; Sun, 11 Nov 2018 12:39:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968785; cv=none; d=google.com; s=arc-20160816; b=fq9rdYdzJlnktKfbi+FhtqQ2euSmqDdf19dz9h0aI/GXRSuEd0qZrH03gAKFuU3D5h 3Trv06nx34S3RsLIsR+Y+P+1S/B/oRJ71AW63qd5kIz7qZ6CtTX9No4kBHSLsaPWQIc5 zorbdZGCSencgiSdxmIDCh0a6YcvI4Rn9BJwCc47APrt69LfrxucfGX/1CnwtHTfwyTh NoNoICRGGtVP7jyHCXEc7X7NwV7BlIPzWnhtQ3HKX5zAT2UcdCODaAs8k2uMgbHAlTra zIcymj6zjfcS5B4sgI5CoHWGOPzpcX+fwvLDoG9ZUpRVVWvhnmkanx8m/hOMkZ7qc8xz b1Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=7tPy9Jj+E2AThydk95UXCaP2l90FOZoe5EYmQ/aafvs=; b=07HxWyFruYsYTdvblMaLv9QIuudR4DY8A6Yu5IucRLUaMUk1uDadwsYGN5hjMCBFMw oiyA8CshqGueE5A13vYXRHpzM+FxSmaU4htq5/3t+HUdaAdhp2oOOyaDV0IYP/aA1hDW w9FFZi8teiszusVEAkP15RIjK8Rd+nnHcK8Hc5QEUMqDaw0YodwsC6qjihab0m14KCZv IhowrOSLc0qydVTDNzi3SomJFMJ+8a61gayXFwcUMoBfrxFi4QsT+AiNjpz50HEmZGb6 WGKpKXcByvQknrBLZYUSAG6rsAV+1ZIRtP0ebWsjH6ydpZx2MLk2W5LpkI7qcoC2SaCC y12A== 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 q13si14490178pgj.86.2018.11.11.12.39.30; Sun, 11 Nov 2018 12:39:45 -0800 (PST) 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 S1730156AbeKLG2o (ORCPT + 99 others); Mon, 12 Nov 2018 01:28:44 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:49564 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729995AbeKLFsI (ORCPT ); Mon, 12 Nov 2018 00:48:08 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsT-0000oM-Bg; Sun, 11 Nov 2018 19:58:37 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsS-0001ZZ-RV; Sun, 11 Nov 2018 19:58:36 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "James Hogan" , "Fuxin Zhang" , "Huacai Chen" , "Huacai Chen" , linux-mips@linux-mips.org, "Paul Burton" , "Zhangjin Wu" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 156/366] MIPS: io: Add barrier after register read in inX() In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 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(). 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: Ben Hutchings --- 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 @@ -410,6 +410,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); \ }