Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3906779pxb; Mon, 21 Feb 2022 08:05:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxoCEaDa2zCro5CFwaCKHvhH+koBb97eLJ8s+aUESyozrzCUPuK288hUXlAqbwuoE2CukhE X-Received: by 2002:a17:90b:197:b0:1bc:5037:7c52 with SMTP id t23-20020a17090b019700b001bc50377c52mr3191993pjs.174.1645459502430; Mon, 21 Feb 2022 08:05:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645459502; cv=none; d=google.com; s=arc-20160816; b=VUiBlDnomPcfUZ8/rlO7DSSx3DnE2oMEengGUE8pAiXqKD8CNMnlrD7I4dftAClpPO fzOssO5je/CPaupF9MU6Dix/jvNuaio6CIlVl4Kcl+FVig9QleZtiRWdyDjXiNNRTu6M yrjsZuRkzOobP7YjpUmEQpzr0+T2rgh46xwrUJHSYDMIpQb8BbBxQBHpNxa/8Rd15TNQ v9H1mxzwETSCMN/KQldzUsZ5KHtJxkyps8H3VdGISETu1D3evT3f3J3dyTWZYE5RPWm0 JeX2Rc4R8xb409LXCpF0vCccpITohL+R1Q2+yjGggcfs8FBupTRytMx9W3Yix1wogSnT N/3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=W33SNp0pR4K0oD6ddMKKEdiqs40zlfkBnS8Whij6EHQ=; b=iyYmB8Ma6LoSVtC+QgaDlhyndHiJA/+EEcxPzqsXXdEE/saChcUKBtGQoc/gMa0Id8 K+89iAf5V9StML+L55poNDjDQ66eKeE2Ikw1JBMp1OGTEESYrB1iKls0Ar2K8lG1ddAR AGShMkTLMtZ0b5yK3J6gmyvTOTo2uhXJuo0r7eJRvRLrvym9UtxdpppT8T6DUFvGPUR+ kq5GXn0Ey8W6prGfrMI8V4TdtCcvMj0S29VuGjBZbBf3jtyQ2OazsUz7i/XNhoGT16eI 7AOoSV+cKkK+gLAo3D2kALLa4s1yLr7Ve8MDCXEn5RYtgJo7VP2VvCfGYWlpX0ucLUtY NOvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b="STDBM/4r"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Nh573dM6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q20si20516352pgt.802.2022.02.21.08.04.46; Mon, 21 Feb 2022 08:05:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b="STDBM/4r"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Nh573dM6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378585AbiBUO41 (ORCPT + 99 others); Mon, 21 Feb 2022 09:56:27 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:47274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378564AbiBUO4R (ORCPT ); Mon, 21 Feb 2022 09:56:17 -0500 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25A8517AAD; Mon, 21 Feb 2022 06:55:54 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 6CA415C01D2; Mon, 21 Feb 2022 09:55:53 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 21 Feb 2022 09:55:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; bh=W33SNp0pR4K0oD6ddMKKEdiqs40zlf kBnS8Whij6EHQ=; b=STDBM/4rJQczYtG1aRaRKTVE1Y71ArnL/zaUAKliicNNPz Uaat6kUFekckbBN+po74oIfigvIBiqH2rNBNkg7qq2i4ogbUaII0Q56hrVYp5Soa Cx8e3fAIpGzlo8UKmYgoX3qVdgxHkaYguLS76d2mnInD9Vv/hwVrbFR+1IXFjWdz HZ7lGP5xBbThgXMXMQc4dZvX32D/UZcpeO3YPmN4hWSBjrPFwtnY1GxxDVdPSFEF C6MDVWeAhcK41jZ2NG6OohmaR39lqfB60cilicD+4GI1zlvFaMu2Ef73SNW4jqip jYJ9jamzw3B/crI3+W2beF3ndbJ6Qd2RizXQazCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=W33SNp 0pR4K0oD6ddMKKEdiqs40zlfkBnS8Whij6EHQ=; b=Nh573dM6Tpq4drfLuT0j7Y 1f1Pp1wR2vDj829htrMOSI0m3RB4WZF8ptKiKpDKY+Gt+vSkLDNOfsaAEdeSMjQI KGUuDoaBcqzUdP/N1rlajXlg+jrOGB+h86+NY8SpdhvNqMeJBhiw+iCbj/YKEv7b e9qzjAKCB+XKSZT2pppjFs+uvoLjKJSUWoZN4CbCTNuOLcnR/F0gA/O7DwpKR2MP FhlVRclO7iZoKfZFnn2Vun2J2Qa85X6zPnDwTpXutoRMIkKWxQP/v7OpBmWHwhBu NewrrPaQZ7wTnmFZu3QjFMpb6PSa3Ef9psCs5y+k8dadGxLzbfVTQihdtnmksuzA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkeeigdeilecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghnghes fhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepjeeihffgteelkeelffduke dtheevudejvdegkeekjeefhffhhfetudetgfdtffeunecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgoh grthdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 21 Feb 2022 09:55:52 -0500 (EST) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, chenhuacai@kernel.org, tsbogend@alpha.franken.de, macro@orcam.me.uk, Jiaxun Yang Subject: [RFC PATCH 3/3] MIPS: io.h: Remove barriers before MMIO accessors for CPU without WB Date: Mon, 21 Feb 2022 14:55:31 +0000 Message-Id: <20220221145531.10479-4-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221145531.10479-1-jiaxun.yang@flygoat.com> References: <20220221145531.10479-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 3d474da ("MIPS: Enforce strong ordering for MMIO accessors") intruduced this barrier to ensure the correctness of IO access ordering with following reasons: 1. DECstation systems with hardware write barrier can reorder IO writes. 2. Cavium and Loongson have errata which reorders MMIO. 3. MIPS Spec didn't enforce ordering of MMIO access. For reason 1, the concern is still valid, so the barrier is kept when CONFIG_CPU_HAS_WB. For reason 2, we had confirmed that Loongson doesn't have such errata, Cavium's issue is workarounded by war_io_reorder_wmb. For reason 3, I had got confirmation from CIP United that all cores by MTI (MIPS Techonologies) won't do this. Given that other platform had live without these barriers for a long peroid, removing this barrier is unlikely to bring any problem. SYNC based barrier is very heavy on Loongson and MTI cores as it will issue a SYNC command on their bus and invalidate all present instrutions in pipeline. We should generally avoid that. Signed-off-by: Jiaxun Yang --- arch/mips/include/asm/io.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 8a148277d9e6..faa38049412f 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -225,7 +225,11 @@ void iounmap(const volatile void __iomem *addr); #define war_io_reorder_wmb() barrier() #endif +#if defined(CONFIG_CPU_HAS_WB) #define __io_br() mb() +#else +#define __io_br() barrier() +#endif /* prevent prefetching of coherent DMA data ahead of a dma-complete */ #define __io_ar(v) rmb() -- 2.35.1