Received: by 10.192.165.156 with SMTP id m28csp200826imm; Thu, 12 Apr 2018 20:02:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx48oqNBQj502JWD3VU0bJ9GBwzSwD1qbNX/JNc/mFYr2rjo+lZ+JCXois0w6KWUt7P0P7+RB X-Received: by 10.98.156.152 with SMTP id u24mr9903754pfk.74.1523588566493; Thu, 12 Apr 2018 20:02:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523588566; cv=none; d=google.com; s=arc-20160816; b=ECmPrRTwV3gdlgJCqCXTxUrJgGOx2un4zEkb4nnxQOK+5O11+eo2NHr9mE2sARzrki KeVg55YlCGf5KSl5kZLmnERlsg10LxsuPUu49tJtCl5F0gZd8CIGfxbXrFUoZ9cskmV4 qVbvQFzszlBYe1RNp846iWqNoeBgqSgG5QSI4Lx+bCeDb+vvmYfV3r4oB2q18qV2gWh8 Nm/GEGLDS5GHqbELe/qRCiPEWrtJgOEyLdLeHUMUoyU1kVU1o7+aTyc+1UPxX2IT6u+R x6vm3UeeDa0IfOvFB25kjwtL4tS7ZFYvyguUpZPHf46BwwNp4UhwZcDR2bhdYd9gg9IW VIMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=IvrnmmZSX+YRWWKxmB7jq4ZpkVIKP+roDZFHkYegwmg=; b=ZKF9J/jAR+QyWM2cgz6xZTN8h2fma87AFQHjgTtU5fljtBS7lm0Ym8C/ivIfCUFFHK GB1BZzIqKe6w7LmsNbWsXcXOsWfnKT3O4RZHOcnYSGYvfYrciq96rjCTQ84wVDbU4QcC QM+o/SobVpf7v5lURFp9Bdx3zNcq828m7MiTI/u8Q2RBojdSGM5z7t0DWQ1eQeMlbbSb 4MyeroSTyNS7IleGE+ZaixtX25Ml5rpsBk0Ubbv/SZJiLKSJyYtGpx4Ps+BUDEOtV7+K 1Rq2Nnevt8y8MApTcsgrj60oSI9bOthvnQ/u9aGGFLWaNUqAnmk6b4dUv9duxs2sMyvm WJEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=HaIIPYXa; dkim=pass header.i=@codeaurora.org header.s=default header.b=Z0ivTOXr; 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 k3-v6si4665514pld.36.2018.04.12.20.02.32; Thu, 12 Apr 2018 20:02: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; dkim=pass header.i=@codeaurora.org header.s=default header.b=HaIIPYXa; dkim=pass header.i=@codeaurora.org header.s=default header.b=Z0ivTOXr; 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 S1753331AbeDMCa6 (ORCPT + 99 others); Thu, 12 Apr 2018 22:30:58 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:49048 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752584AbeDMCa4 (ORCPT ); Thu, 12 Apr 2018 22:30:56 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D4D9460F6C; Fri, 13 Apr 2018 02:30:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523586655; bh=t7N6LdVpv1RaLrRpUUOgrcCQX5nXKSJeeziLYcKPskA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HaIIPYXaUmQbCROBXj6GV9OJUC17KIZCZeYUoGYv5eflHmjB3gSW8vZIf4/y+GPLp Ubs9ZsgkMFcoEpLnwmeRq0ewVBkI2E2h4GElp5kWu0u0FWz4/gYgECdlZiFwNSDcOm ZQWKuFWdTzy6tB9aFF8ChFk+rhfxfm8N99I5mBU8= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id BDDE160F8D; Fri, 13 Apr 2018 02:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523586654; bh=t7N6LdVpv1RaLrRpUUOgrcCQX5nXKSJeeziLYcKPskA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z0ivTOXr1gP3C1UIzzFAKFW1aHUnN3XdlwMVXUoGDbfe4yi9vWtPXTcBhalVD3COc gRkFlwH8VES5F7fpJRORFUFQjBxIinx85Myq8U06uphOwIAL/0LvK4z64OMAmwk7lw ceG0jnXUa67617jV2eG75elshrQSlINdytHyxcLc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BDDE160F8D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-mips@linux-mips.org, arnd@arndb.de, timur@codeaurora.org, sulrich@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , Ralf Baechle , James Hogan , Paul Burton , linux-kernel@vger.kernel.org Subject: [PATCH v4 2/2] MIPS: io: add a barrier after register read in readX() Date: Thu, 12 Apr 2018 22:30:44 -0400 Message-Id: <1523586646-19630-2-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523586646-19630-1-git-send-email-okaya@codeaurora.org> References: <1523586646-19630-1-git-send-email-okaya@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While a barrier is present in writeX() function before the register write, a similar barrier is missing in the readX() function after the register read. This could allow memory accesses following readX() to observe stale data. Signed-off-by: Sinan Kaya Reported-by: Arnd Bergmann --- arch/mips/include/asm/io.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index fd00ddaf..d96af41 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -377,6 +377,8 @@ static inline type pfx##read##bwlq(const volatile void __iomem *mem) \ BUG(); \ } \ \ + /* prevent prefetching of coherent DMA dma prematurely */ \ + rmb(); \ return pfx##ioswab##bwlq(__mem, __val); \ } -- 2.7.4