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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 063FFC46467 for ; Sat, 7 Jan 2023 21:53:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232925AbjAGVxf (ORCPT ); Sat, 7 Jan 2023 16:53:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232675AbjAGVx2 (ORCPT ); Sat, 7 Jan 2023 16:53:28 -0500 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BAD236325; Sat, 7 Jan 2023 13:53:27 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id C755E5C00A7; Sat, 7 Jan 2023 16:53:19 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Sat, 07 Jan 2023 16:53:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc: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=1673128399; x=1673214799; bh=J0Hsmp/ZZA pKnx0B5sCmuSruqbIuHaEX01SlY2kzFRM=; b=kzRcmPNZNu/H7aqihcqSRgUWfO co0tjtqxHgQrpli1E5Ajw90YVrqCDe9AhYhFNEad/MlGDXaPVc4LNDTl9MAKWakj nboXEUvB79kI30NGLDVHXDb9z+gHlKaEzsEjhy8b3choHAjBaXX/3tZTeypV9LBU WzR2JfVbb4YkZqwFTzjDLqAOa7Aam12aj8TFs3o9r2v4Jtf7T/D3VgDbZFJC5GMf 2RRgJdaQEssbxMdNQ8R5JZzKT6b10PcXP0WD6GlzMWJYGoYmVMLDUIZJYSUffXBX dB3EqI0AdSCa4C4+yiE/PtDGuQGJnIN7lqeAf9B1jFQP4L4PryU1PE0e2PkA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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= fm2; t=1673128399; x=1673214799; bh=J0Hsmp/ZZApKnx0B5sCmuSruqbIu HaEX01SlY2kzFRM=; b=blJIInZRK/GQsOPIwBvXOweynQ3zlY5g4o11vjwnOdZF GMLtY/FKHS3cHS130rnJPXBIF9neGtjk65Xw9hduShzP48m1Wxehuqbwk3TqftM4 4utkwjLZwrpDcMf0qdMvAc/kpWLTJG0HLqyBKJwM37tVSveAuSCXVtuAdypfTXZu fPOa+9wt5tXZkPHMwI0AnGsQlKj9qw4U7bMlZ43fkfIaLe7SG5c4nptJigcxBPv5 UqmdbppF4UgI98XyDv3xWijjh+M3KyMgitAEQpF3wsOwXyGBre7POZlFhF7boWmj Q0wo7RKEaXYqYYjT+LqicIfgfOdiZLYmUnmTrUvHnA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrkedvgdduheduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2053AB60086; Sat, 7 Jan 2023 16:53:17 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1185-g841157300a-fm-20221208.002-g84115730 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <20230106185526.260163-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20230106185526.260163-2-prabhakar.mahadev-lad.rj@bp.renesas.com> <6f7d06ef-d74d-4dfc-9b77-6ae83e0d7816@app.fastmail.com> Date: Sat, 07 Jan 2023 22:52:55 +0100 From: "Arnd Bergmann" To: "Conor Dooley" Cc: Prabhakar , "Conor.Dooley" , "Geert Uytterhoeven" , =?UTF-8?Q?Heiko_St=C3=BCbner?= , guoren , "Andrew Jones" , "Paul Walmsley" , "Palmer Dabbelt" , "Albert Ou" , "open list:RISC-V ARCHITECTURE" , "open list" , devicetree@vger.kernel.org, Linux-Renesas , "Lad, Prabhakar" , "Philipp Tomsich" , "Nathan Chancellor" , "Atish Patra" , "Anup Patel" , "Tsukasa OI" , "Jisheng Zhang" , "Mayuresh Chitale" Subject: Re: [RFC PATCH v6 1/6] riscv: mm: dma-noncoherent: Switch using function pointers for cache management Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 7, 2023, at 00:29, Conor Dooley wrote: > On Fri, Jan 06, 2023 at 11:31:33PM +0100, Arnd Bergmann wrote: >> On Fri, Jan 6, 2023, at 19:55, Prabhakar wrote: >> > From: Lad Prabhakar >> > +struct riscv_cache_ops zicbom_cmo_ops = { >> > + .clean_range = &zicbom_cmo_clean_range, >> > + .inv_range = &zicbom_cmo_inval_range, >> > + .flush_range = &zicbom_cmo_flush_range, >> > +}; >> > +#else >> > +struct riscv_cache_ops zicbom_cmo_ops = { >> > + .clean_range = NULL, >> > + .inv_range = NULL, >> > + .flush_range = NULL, >> > + .riscv_dma_noncoherent_cmo_ops = NULL, >> > +}; >> > +#endif >> > +EXPORT_SYMBOL(zicbom_cmo_ops); >> >> Same here: If the ZICBOM ISA is disabled, nothing should >> reference zicbom_cmo_ops. > >> Also, since ZICBOM is a standard >> extension, I think it makes sense to always have it enabled, >> at least whenever noncoherent DMA is supported, that way >> it can be the default that gets used in the absence of any >> nonstandard cache controller. > > While I think of it, this is not possible as Zicbom requires toolchain > support whereas the alternative methods for non-coherent DMA do not. Ah, I see. Would it be possible to use the same .long trick as in the other ones though? Something like #if CONFIG_AS_VERSION >= 23600 /* or whichever version */ /* proper inline asm */ #else /* .long hack */ #endif That way everyone can use it, and the hack would automatically go away in a few years after linux requires a newer toolchain. Alternatively, the entire noncoherent-dma support could be made to depend on whichever toolchain introduced Zicbom. Arnd