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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 0587EC64EC4 for ; Wed, 22 Feb 2023 14:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WwhWAmzxTsC8ZME42yhnBsiR9JQLhA5cEv3LGyclBT4=; b=nM+YoJo7BB8D9Vo7oKewvup7OO FmBtcFI127zaX+33l6+N83m1OPLs7+Y486zJKWK+kyyPDU6vZdvJ0UjZR/ZzS4igxKdOkxwf/CnnS GmAXBEF7gOToGvGZrUu9BZevGQKz6AhXNLhbBeUC+VsNY6s4otJb/Ir2yzUa7ddVWBF3Hwz4Qfg3s ZsVZdQlm1+0xIx7JJYDpEiPsnanyWEUoKWnmyzIGPpgNb2pbdceqpU1y3Uwdot9i6JZXCZmnQWIug VclaBFfP1+/WMLBwU7VN61ddIgj+4JqMTx94Yl3tfdumV2I6UobiRQ8TkcTHj8T4GJCoBbcJH8YWT 8Ch2c9wQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUqSF-00CkJP-8c; Wed, 22 Feb 2023 14:50:47 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUqSC-00CkIL-7A for linux-riscv@lists.infradead.org; Wed, 22 Feb 2023 14:50:45 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D5F696147A; Wed, 22 Feb 2023 14:50:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC4EDC433EF; Wed, 22 Feb 2023 14:50:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677077441; bh=jECYUd++ya4ZsTEPgf+A4rG4QEZxORJ8FxqhcduO8rI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=F9FnSipHjdSvaLOQeeDh5U9J3OpPg9y5rhPajM5/U+Cp3uL7ggJ33uDUPrBW8wXtY dxwQS5jPa6FBJztre9QhvYkYot55Fi8CX2LTPH6nKb+QaHFgtOU9M94nC8CFjUXJJk Yrk5Al9cxSObZat0W7cNiwTRi09vzMWVed3iGUEwaBlZsQp3G8A4wy0pZA0r8P+zZQ nf/G9mJBt+b+VjZs23yAMChRURMV6ZV9x9c29+LU/iN+ivvlqI0bsnepYkWdruSqUk UBrwNLpVtvZi/yBsTrEcL97dRHQq2n108wme856Mnn7rCYBhc/3AiIvpn2rvGr83Ea x8V/LWk7+cOPg== Date: Wed, 22 Feb 2023 14:50:36 +0000 From: Conor Dooley To: Jiaxun Yang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, tsbogend@alpha.franken.de, mpe@ellerman.id.au, paul.walmsley@sifive.com, palmer@dabbelt.com, robh+dt@kernel.org, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, linux-riscv@lists.infradead.org Subject: Re: [PATCH 2/3] riscv: Set dma_default_coherent to true Message-ID: References: <20230222133712.8079-1-jiaxun.yang@flygoat.com> <20230222133712.8079-3-jiaxun.yang@flygoat.com> MIME-Version: 1.0 In-Reply-To: <20230222133712.8079-3-jiaxun.yang@flygoat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230222_065044_334294_A3A705EA X-CRM114-Status: GOOD ( 18.10 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1612961023499132602==" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org --===============1612961023499132602== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mMMYT62i9d1eIRHl" Content-Disposition: inline --mMMYT62i9d1eIRHl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 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? Cheers, Conor. > if (IS_ENABLED(CONFIG_RISCV_ISA_ZICBOM) && > riscv_isa_extension_available(NULL, ZICBOM)) > riscv_noncoherent_supported(); > --=20 > 2.37.1 (Apple Git-137.1) >=20 --mMMYT62i9d1eIRHl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCY/YruQAKCRB4tDGHoIJi 0oqOAQClwxhHez3G5Ku8YKYt1QD25AwhnbdgPYGZX4nrg3jkDAEA0YEX+g+BVk6l KwiIMBd6nPQZSCwfvdaJvG++kv81mQU= =pBfa -----END PGP SIGNATURE----- --mMMYT62i9d1eIRHl-- --===============1612961023499132602== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv --===============1612961023499132602==--