From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BAFD7C64EC4 for ; Wed, 22 Feb 2023 15:56:39 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4PMLPK5snhz3cFN for ; Thu, 23 Feb 2023 02:56:37 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=flygoat.com header.i=@flygoat.com header.a=rsa-sha256 header.s=fm2 header.b=Bw3Y7oWb; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=g3z+0c2o; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=flygoat.com (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=jiaxun.yang@flygoat.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=flygoat.com header.i=@flygoat.com header.a=rsa-sha256 header.s=fm2 header.b=Bw3Y7oWb; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=g3z+0c2o; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4PMLNC5GVcz3bf7 for ; Thu, 23 Feb 2023 02:55:38 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id BF0335C01A5; Wed, 22 Feb 2023 10:55:34 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 22 Feb 2023 10:55:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1677081334; x= 1677167734; bh=w67oEu2E19AZfAjVi0U6OotIuBhYGM6gAf2Nt5qYYBU=; b=B w3Y7oWb6zR5Hy1tIOLHDPZwtv+tzKifOSl2K7jIA6SWWH8GNw7a6SDHmwQLrdBuQ e/noD0F4HdYwQvk5Vk2pS/iJWAMAKVQa3omEz+Qo6kDa2hyWa/VfVyxWkDy+23zF 89Ytetx5+OInv03VdiNvB81vUum98r3Ig7KwaE7yfUieFQF5RMKaTvBgN+sq5idY v+32DQZMj4Z4EHdoyn5qmxTYIBlHwkCsUBE0ZKb6B1NA/YDktW4EKwsUp8hDspQI d0kszAiklI0yq+AfnnF322KyI4RXoH/r/PmB/MuuSVYRtaaGduYOHR/9vtQdVqf3 CKGtfIpym8qMcgEubu6yA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id: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=fm1; t=1677081334; x= 1677167734; bh=w67oEu2E19AZfAjVi0U6OotIuBhYGM6gAf2Nt5qYYBU=; b=g 3z+0c2oLRO9m2vG7FYwPiirPv2tmDR4JTPz/L696D7dTzEHPcamN9tcD0242eWRn VcEiGX9OXUdrHQ0tHNu0kep7ry54Km8oG2cEcoAKc6TzWldLPUH5Isg+vdLgU8OE RdM6FDAIPu/ix24rWP0XaVZRBJOIRtnYmfxoLOdrNwFNwQHm9Llc9L9UZ14gTQ5L KXE5n9YVunWkQgm0SDDcJ7Srz8D3EuXWYqtyCS4szzw+DC/Kdo56ne1AsHgZ1JAC FvrjFVurYPQSBFUwyW9Z+9SwscA1PX9ApgNZpaY47Gc6DqoE6NuZ+CeFd+1dI33c ZZpDuQXFMfP0CBsKY4k8g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudejledgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptggguffhjgffvefgkfhfvffosehtqhhmtdhhtdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepuddtjeffteetfeekjeeiheefueeigeeutdevieejveeihfff ledvgfduiefhvddtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Feb 2023 10:55:31 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: [PATCH 2/3] riscv: Set dma_default_coherent to true From: Jiaxun Yang In-Reply-To: Date: Wed, 22 Feb 2023 15:55:19 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <6BBA7BEA-8595-436D-B4BF-D7DB95069C53@flygoat.com> References: <20230222133712.8079-1-jiaxun.yang@flygoat.com> <20230222133712.8079-3-jiaxun.yang@flygoat.com> To: Conor Dooley X-Mailer: Apple Mail (2.3731.300.101.1.3) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Bogendoerfer , "linux-mips@vger.kernel.org" , linux-kernel@vger.kernel.org, Rob Herring , palmer@dabbelt.com, paul.walmsley@sifive.com, robin.murphy@arm.com, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Christoph Hellwig , m.szyprowski@samsung.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" > 2023=E5=B9=B42=E6=9C=8822=E6=97=A5 14:50=EF=BC=8CConor Dooley = =E5=86=99=E9=81=93=EF=BC=9A >=20 > On Wed, Feb 22, 2023 at 01:37:11PM +0000, Jiaxun Yang wrote: >> For riscv our assumption is unless a device states it is = non-coherent, >> we take it to be DMA coherent. >>=20 >> For devicetree probed devices that have been true since very begining >> with OF_DMA_DEFAULT_COHERENT selected. >>=20 >> Signed-off-by: Jiaxun Yang >> --- >> arch/riscv/kernel/setup.c | 3 +++ >> 1 file changed, 3 insertions(+) >>=20 >> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c >> index 376d2827e736..34b371180976 100644 >> --- a/arch/riscv/kernel/setup.c >> +++ b/arch/riscv/kernel/setup.c >> @@ -300,6 +300,9 @@ void __init setup_arch(char **cmdline_p) >> riscv_init_cbom_blocksize(); >> riscv_fill_hwcap(); >> apply_boot_alternatives(); >> +#ifdef CONFIG_RISCV_DMA_NONCOHERENT >> + dma_default_coherent =3D true; >> +#endif >=20 > Do we really need to add ifdeffery for this here? > It's always coherent by default, so why do we need to say set it in > setup_arch() when we know that, regardless of options, it is true? Because this symbol is only a variable when: defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \ defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) || \ defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL) Which is only true if CONFIG_RISCV_DMA_NONCOHERENT is selected. Otherwise this symbol is defined to true and we can=E2=80=99t make a = assignment to it. Thanks - Jiaxun >=20 > Cheers, > Conor. >=20 >> if (IS_ENABLED(CONFIG_RISCV_ISA_ZICBOM) && >> riscv_isa_extension_available(NULL, ZICBOM)) >> riscv_noncoherent_supported(); >> --=20 >> 2.37.1 (Apple Git-137.1)