Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4244498rwl; Sat, 7 Jan 2023 14:09:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXuK3AVsDDTxD5vW+tmkvbFBts6us1Hy6a8AeIa6tJRd1O/pQubKvlrYjuATvth7eR0m9qf8 X-Received: by 2002:a17:906:ecf7:b0:7c4:f6e4:3e92 with SMTP id qt23-20020a170906ecf700b007c4f6e43e92mr59146134ejb.31.1673129375822; Sat, 07 Jan 2023 14:09:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673129375; cv=none; d=google.com; s=arc-20160816; b=JUqk0FsFtmnytHU65qibZXK3MBUI1kwqSjkPcd/lVoivNwdOVvjwwFLFFSAeUavMMP uIKDNRXnyfA5OfPNEm3J/+wqSrvbc7EwlajIAvvurr8/GTU1hPSjvDTpsqoV9wPPyuKa KYpdIvbhukr+h4V0ZAnUZp0IduC7vZRuRXwC5djRjbVrFihvBv44XnU+Dj+hRUyMDUhX CMqkCya3A+YqVnH/TrA2mjRM9CwhQ9x5Xy3k2s3vzyobBvhmh7QEIhuAW7dHSLWzzjlr IrS2Ov18oVCJxF9dZ3w1eaR9ef6uDpWMb9oR6LA7CtXYZu2NsEB4D8ChWGWtaHAtaTFz 1Taw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=J0Hsmp/ZZApKnx0B5sCmuSruqbIuHaEX01SlY2kzFRM=; b=X55d9H3nMycCeKuVEh3JErfa9+dIS9JD9AU+rlvwMRuK0MkKsJmtczLMv7msuu3bsY eQjpC6nex6NOkxMhDXqupoh2hteZw8OSH9o6lVvnpmN3+fIAyjQP/v5GDeNfl2LOBUPT v6lHdAywZE6Ju8GYKIq0lggb4nlFbuDW1z4nDh41ADcPxDOJcIt1wc0kTChVc97H85Vz KS3ulN8oRQPz7cPtW4sHT8/gu45LW2jyizrovnaTG5n+KtVkEpRr+iQOM9rKFu5AQZKt W03coKzUBdKZ9SL6Vlls+6CHygzQVf5YOZsC5IZERLT3RgF5BoFJQl7pEVDjiKYAbuvt typQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=kzRcmPNZ; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=blJIInZR; 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 a10-20020a170906368a00b007c143a8a656si3803577ejc.997.2023.01.07.14.09.23; Sat, 07 Jan 2023 14:09:35 -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=@arndb.de header.s=fm2 header.b=kzRcmPNZ; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=blJIInZR; 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 S232889AbjAGVxe (ORCPT + 53 others); Sat, 7 Jan 2023 16:53:34 -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 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 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 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