Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5507401rwl; Mon, 3 Apr 2023 22:34:24 -0700 (PDT) X-Google-Smtp-Source: AKy350bh1aDsaCnKtlUBnUttNWs3Vgn0+UquwqYuwU0XwBj8cWkQAInhKtC8ADDbYzTgbdYzdSu+ X-Received: by 2002:a17:906:e24a:b0:928:796d:71e8 with SMTP id gq10-20020a170906e24a00b00928796d71e8mr935660ejb.3.1680586464299; Mon, 03 Apr 2023 22:34:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680586464; cv=none; d=google.com; s=arc-20160816; b=hRqBzqXLNSis2oQ8xamwQVQBXsYlMK03FQ46rsBRs7FUTbNgPIAEueIz+q3NN9iXVH B0oegAHmGAQF0tIfYbZ5h/CUrOJg9zBLQ+WWHjGNZuPMHZu+lL6HuLQ41B2dF84TLI7j iExz6mK2Nc8bTxq85L4jKYsVTl+TL9kdbPGMG83FHXzSI6Cks02hPsxr9SaRrbbm8A5B WBuK5yIhtbErdYniBatfHrRFWwIl6GxFH5zHiG8z92w8jHxXU8BTgJ6ke4ed91U2GGZq hGFa8M7XI0yyy1UqhssQGJbMgbE6ibyB8wqG6auZ824AV6dAcVb6KqX1Rhd0Nv8XwRXY mY2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kvrrME49HSEm3e3PUjpTJ/N0A8XCBPZx1NZzV7RUN7w=; b=KMqrMKoG6lyL15g4eZ+HQd93uU/arHFJE7c3FSxuLclJUWtWtGzj1gK+nBSAiBN9Tc wcdltWFWluBRBBdHbWYcMaAFhlyBxG60+BL3b3Vxjpkb515KNGRbC6utyGH0LreeDtmE OY4yWcnJAsPVNCEHx+8WdaVdFGETIGVY4TDFSUXocvG9+jbNeQzDnDhT8OSvm4BKLkix njskCH2pzursg3vccX3nbyYCqI1IAq15MGNBvvAFUvWPDVt1ArlS/uN22bAvMM181U6n eFId8J2r3AfZ4y4Ec9Ic8++at4GApx6YY2hzftFE9B6VGa+cSlhGk1mzy21r6cSVN0+v e2YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="iN5/NV0Z"; 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 vr9-20020a170907a50900b009485b3ac6acsi4706798ejc.342.2023.04.03.22.33.57; Mon, 03 Apr 2023 22:34:24 -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=@infradead.org header.s=bombadil.20210309 header.b="iN5/NV0Z"; 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 S233317AbjDDF3j (ORCPT + 99 others); Tue, 4 Apr 2023 01:29:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231552AbjDDF3h (ORCPT ); Tue, 4 Apr 2023 01:29:37 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCF9F10E3; Mon, 3 Apr 2023 22:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=kvrrME49HSEm3e3PUjpTJ/N0A8XCBPZx1NZzV7RUN7w=; b=iN5/NV0ZdBH39LOKFmDddySJn4 O8mRnqfW7uoArL0ggKDA8qmMZkql25oVue3G1bnyKR95wYDE5Xj5/sBYAR9rSUTV8LrMfb3ULeAj+ A1XWRnk6HRLVvh6bXS+XLtRMmLE2n1j1F59DIl7LdJYL8DPKhaM9+YbOZGL4nJ7uNObjjkRVtK3FA 8DgDOOaRQ2delNCqK/zhhDYdT9Ff1ve6yB/jQONvKAx9MTbEtbZp/qbsuRnGeDVwPeTG0Y6VI8Pk4 FfnDXcjZbOhulsVGbgxe34wfNSs+C1Jka3G3f6RXWPgQjJM4+4TNlG2jysYEjtt/yJ94aqENfIDTf blymWRPQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pjZES-00060U-2V; Tue, 04 Apr 2023 05:29:24 +0000 Date: Mon, 3 Apr 2023 22:29:24 -0700 From: Christoph Hellwig To: Prabhakar Cc: Arnd Bergmann , Conor Dooley , Geert Uytterhoeven , Heiko Stuebner , Guo Ren , Andrew Jones , Paul Walmsley , Palmer Dabbelt , Albert Ou , Samuel Holland , linux-riscv@lists.infradead.org, Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das , Lad Prabhakar Subject: Re: [PATCH v7 1/6] riscv: mm: dma-noncoherent: Switch using function pointers for cache management Message-ID: References: <20230330204217.47666-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20230330204217.47666-2-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230330204217.47666-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 Thu, Mar 30, 2023 at 09:42:12PM +0100, Prabhakar wrote: > From: Lad Prabhakar > > Currently, selecting which CMOs to use on a given platform is done using > and ALTERNATIVE_X() macro. This was manageable when there were just two > CMO implementations, but now that there are more and more platforms coming > needing custom CMOs, the use of the ALTERNATIVE_X() macro is unmanageable. > > To avoid such issues this patch switches to use of function pointers > instead of ALTERNATIVE_X() macro for cache management (the only drawback > being performance over the previous approach). > > void (*clean_range)(unsigned long addr, unsigned long size); > void (*inv_range)(unsigned long addr, unsigned long size); > void (*flush_range)(unsigned long addr, unsigned long size); > NAK. Function pointers for somthing high performance as cache maintainance is a complete no-go.