Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2664508rwd; Wed, 14 Jun 2023 06:04:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5b9so7+CrgOYi/n+KYo3OzhXJtsjjgLjzyrRaVrnl/4g7VQ4x+xjYPaHXKyTnOSGtpo799 X-Received: by 2002:a17:906:974b:b0:966:5035:6973 with SMTP id o11-20020a170906974b00b0096650356973mr20866529ejy.50.1686747846093; Wed, 14 Jun 2023 06:04:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686747846; cv=none; d=google.com; s=arc-20160816; b=sUKXbkOD+WQ5eHIQZGkC98FROYuvLzb1DcA4iOTASrC7oKXACnv+mDtyGXPg28psZv IrQ/7/V7158EZuoyfWO1c8vM+BeK1qgLPRhGwKvcai+eOZQ8YfCTbm/hhyyOS6w9fHP5 f+K0H9p+qCvt0BKsXHq8BX1EMcvvHC+CFQPhoYQFfM8aHn/yMJ+1+ot50CMYN3pwIKIO fwDhQ5tOOYwJQr8UCeTcRTDzodn1rQoQhKvwKF7gaTp7HbdUMKs4bejRb83uYNu3tQ5y 65TO1aMqFn9kSURx80wkYmuHj1JN3dcm91MAVcT3YOAJbR+mul3EsBEtcEXovEkw4tYO ug8w== 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=/wi20iR3aQR7q9wgEfHg3OvnmC0VIjOXlEhxRWFU404=; b=Grn3hF//ioSAV7iSt2HkDQlg5Rvem42sb3c/T7EgpCiM3toVIdNFwJrQDOVYeQUenw BKzeivoeJJeJGpB+9Cl3UQGMFZUYNnTQd33+2QEWxRAoahBJe2l/WdMMF5jNc8xk3tFd h+fnQnvDnmSYFEaYQBwU5LJ1jWITIcvRUWjz4Xawq4ZIvMevO5hBkHnda3Q4kZg83HdL hyjCnzSB6nyUd7QAKYSG9SU/iRy+Y+x1r7uo2bz9aYZs5Awimlbm1+DsbUVZzqkszoKs rUpbAWyAS5z2uCdeZnDAHmQjnzbCg2gCnxSoTXelylB/g/a5wQNA2tyvcNeUH66NR30P VhHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=yIRQ9VaL; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=MN1KtIp6; 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 o3-20020a17090608c300b00974bd4b5e1asi4665306eje.108.2023.06.14.06.03.33; Wed, 14 Jun 2023 06:04:06 -0700 (PDT) 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=fm1 header.b=yIRQ9VaL; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=MN1KtIp6; 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 S244622AbjFNMg2 (ORCPT + 99 others); Wed, 14 Jun 2023 08:36:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236257AbjFNMgW (ORCPT ); Wed, 14 Jun 2023 08:36:22 -0400 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2912B1BDA; Wed, 14 Jun 2023 05:36:09 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 71A9A320027A; Wed, 14 Jun 2023 08:36:07 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Wed, 14 Jun 2023 08:36:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type: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=fm1; t=1686746167; x=1686832567; bh=/w i20iR3aQR7q9wgEfHg3OvnmC0VIjOXlEhxRWFU404=; b=yIRQ9VaLmhYNvJ7VPL aIczJP634G2iW7do0KWyL6aYOhuFsc4QG00mqeYFH01kUogNIcHGfk5v+IpF62Ue jqAL/8sqmNozQRp1AkA9kyt3y1n8NCtqr+yLhuY1ESGa+LujJijvADCyDsQIg90V /er6lIOc344X9T+DQUydJAs/UyKi3vrGCa4ikpGMOvEQSpq/W0zGo79i4wgRoEdg WTw8WyggGHyoluJE72cUvp3MNbMI0qAv8vMP7tsE+6/teYIuQqvMdjyQM1Bfan+f rxJyI0tpdQwnnMWaL+9RxdhlNLni4dWDqwOv3H9MDW0IMY3STvyhrrzpDBdLMqW9 ziNQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type: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=1686746167; x=1686832567; bh=/wi20iR3aQR7q 9wgEfHg3OvnmC0VIjOXlEhxRWFU404=; b=MN1KtIp6YBLpIaq17zVFU3FRCWKQJ yv8Z7/vtGmbDpWOD6wu05MDIv2rHrKm5nvZRReioje4Hh0JLsSv8m6b/TQPCYABG ZNkOB7+bCa9h0doqFmQMHVA3Gw0rRVI9IO7sJueJnnpv6s5mk8Mia7L9TdfmAzN/ BAqd3lVmpBkKpCN7V6QtWGODD8Ur3sA4UR3ZE2VeL1ImnBujkPqFnq70uAZsRnGr 6V9kdccnyxFdRfugSagS1I9u9KbzPGFuRu3Q3F8rCafHVMNjhH3ZnNE7WtfukcFc HcegiOmV1P5N3QSif9makzr8a5/ZdyHEuC6X1Ym8aC3EWO/kAkX7vznPw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedvtddgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5CE22B60086; Wed, 14 Jun 2023 08:36:05 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-492-g08e3be04ba-fm-20230607.003-g08e3be04 Mime-Version: 1.0 Message-Id: <4f69fcfe-debb-4979-9070-1d58ba35032c@app.fastmail.com> In-Reply-To: <20230614104759.228372-4-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20230614104759.228372-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20230614104759.228372-4-prabhakar.mahadev-lad.rj@bp.renesas.com> Date: Wed, 14 Jun 2023 14:35:44 +0200 From: "Arnd Bergmann" To: Prabhakar , "Conor.Dooley" , "Geert Uytterhoeven" , guoren , "Andrew Jones" , "Paul Walmsley" , "Palmer Dabbelt" , "Albert Ou" , "Samuel Holland" , linux-riscv@lists.infradead.org, "Christoph Hellwig" Cc: "Rob Herring" , "Krzysztof Kozlowski" , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Linux-Renesas , "Biju Das" , "Lad, Prabhakar" Subject: Re: [PATCH v9 3/6] riscv: mm: dma-noncoherent: nonstandard cache operations support 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,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Wed, Jun 14, 2023, at 12:47, Prabhakar wrote: > From: Lad Prabhakar > > Introduce support for nonstandard noncoherent systems in the RISC-V > architecture. It enables function pointer support to handle cache > management in such systems. > > This patch adds a new configuration option called > "RISCV_NONSTANDARD_CACHE_OPS." This option is a boolean flag that > depends on "RISCV_DMA_NONCOHERENT" and enables the function pointer > support for cache management in nonstandard noncoherent systems. > > Signed-off-by: Lad Prabhakar I understand that Christoph will still not like this, but I think this is as good as it gets, making the standard variant the fast path, and using the function pointers only for the nonstandard cases. > #include > +#include > > static bool noncoherent_supported; > > +struct riscv_cache_ops noncoherent_cache_ops = { > + .clean = NULL, > + .inval = NULL, > + .flush = NULL, > +}; This could be marked __read_mostly or __ro_after_init as a micro-optimization, if anyone cares. Arnd