Received: by 2002:a05:6358:579e:b0:115:34ad:32ad with SMTP id m30csp17726rwf; Thu, 6 Apr 2023 12:02:32 -0700 (PDT) X-Google-Smtp-Source: AKy350a5p/wCljdQXVzQSu63wZhE1mvGLiM2Sn0sPxBEwaCIPqBxjKYxFdd5GB5wxVflnz0JFgeC X-Received: by 2002:a05:6402:1652:b0:502:2440:577e with SMTP id s18-20020a056402165200b005022440577emr522198edx.16.1680807751551; Thu, 06 Apr 2023 12:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680807751; cv=none; d=google.com; s=arc-20160816; b=kLMFyBTIAdUEY0mo/xs5OVAfN0mvvhmNt3puo3B2cZiqx2xEBFbyvONmHGSbsaPhLp xXh9mYtCZ14VwST1b0obLo2jVWKu/Q+SRgEokFwMEICTD3nOyjk8ejajHeLLQKP8Vg0b 1VAVkYiOOhDJLvtz2jM01QXfduBgBf6R+GlGG5NeFr5LUudyAEHWT1BygtAa8o0MNJ2s xdIgYWxEmgzmMl1cZlt10oZQNp2ji2WMiExaKPPedMIy3IMC5bxKuYZKWDAjqWLn5X5r pBgpFahsjiksT0yPMNrXB/Xx15TIaV79bnxnYcayQbYQNay60dHI+fT9GUX5U2XAmcBC K1xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=pUyJ3wxzxoqSuvxPI58fy1Btf6mp8kX94ybQptXUc3Q=; b=UJFUM27v4t5tLNVyroFM4S+40lnS9h8iQSV61iL3HXr59ozgrF2Ipz/sgetZLdztbi JymjF7gT02bGbiPMOLbeEUfiObmdLPViq+/5e1BiPtWPzy1FoZc+SWR9iZ8ulARdKnIC VJ59GABmQunAIczcMkU4LtYrZezXU+16PESj+NuAVKJhoLaJNGkUe+/Im9yycGnJgmKH +BeGMeNTn0JNxY0P2jNVnc1aNZxRAX7yZsjzRneKdESL88Hm+nnu7ySIZ3aaoQiWqhq+ 8c3IvOlsaCfCTsbkel9FSZFv/LMi2RF/2E7gfYGbLVoUDrXV0fdCcDqv9SK/MAlgDTBN AKoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YkKIr0Go; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n22-20020a1709061d1600b00939c395018esi1486187ejh.474.2023.04.06.12.02.03; Thu, 06 Apr 2023 12:02:31 -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=@gmail.com header.s=20210112 header.b=YkKIr0Go; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240232AbjDFS7v (ORCPT + 99 others); Thu, 6 Apr 2023 14:59:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbjDFS7u (ORCPT ); Thu, 6 Apr 2023 14:59:50 -0400 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C09426B2; Thu, 6 Apr 2023 11:59:49 -0700 (PDT) Received: by mail-il1-x132.google.com with SMTP id n1so20340204ili.10; Thu, 06 Apr 2023 11:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680807588; x=1683399588; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pUyJ3wxzxoqSuvxPI58fy1Btf6mp8kX94ybQptXUc3Q=; b=YkKIr0GocwTAvB4t/GGojOyjJQrlawJFDeEIq7fgZQ0DqGk5NImD9Go7I7XBAQOfW3 eYq5ujzUXkEzVnaC07MyyL2e529FZ81atwYQQLFZ9Kb+a+wpWSJjppzOiN8EPS+O/KpE BZIdqjdajls2tbOYgstJBf3atbMy+dZAgb4WZGEHdwwSQfZENcA19TYYhLdkrxfjAkoK NFptTaCqhJiss0Yd4T/aPtBP7+430FpAK+iFijJgvN9PmOXqKoUmQ6/5tAMRTyiV7QUC 2j1LYK4snrCVyLKee25ixG7vc3NoQ5YF0Eio3pnk3FktYwFACXEjuHN16jKqFDhF79mL Pt+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680807588; x=1683399588; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pUyJ3wxzxoqSuvxPI58fy1Btf6mp8kX94ybQptXUc3Q=; b=jqkJOSuiqzZ0OTtg8usyy3IMWRiBRjybROhJ2Tf6DVeBBsn4F2m89Oo6jAY+MjUJ// CBIuFOyKRkF7dtjVxYa2N9UD7LIeCfQp70iO/WwM5uvXv49JUCZv4S0X972MlQrVEtZK CdH7Awxb5Cq2lsgpP1wg/DzkWWL0dPHL+yoKc1rD6t+HeQ1Cr7d8PZhU7rycGDjuoobq VnXIpP1HvPUh1wu7Sbw+L8r/+VqKH7k/NbzFxN6IVspgr+knzYWzev7mhGJ2EDSK+NjZ 94csohZWRHqYrAIUwnQvHAcCgp30c/SlyFWBYHJ6K+kgRRuirRfCe6KcPknQmcZdqPTl ZBCQ== X-Gm-Message-State: AAQBX9cBLbvJIkGmAq/fCBXByNKpP1aER3sjjdl5RINx/rGjThVwsWVR I10+DgFQ+beDA3jwcdAii+mjl1EvJ8F5sgDU0So= X-Received: by 2002:a92:c5cf:0:b0:326:4201:2d8c with SMTP id s15-20020a92c5cf000000b0032642012d8cmr6810904ilt.1.1680807588655; Thu, 06 Apr 2023 11:59:48 -0700 (PDT) MIME-Version: 1.0 References: <20230330204217.47666-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20230330204217.47666-2-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: From: "Lad, Prabhakar" Date: Thu, 6 Apr 2023 18:59:22 +0000 Message-ID: Subject: Re: [PATCH v7 1/6] riscv: mm: dma-noncoherent: Switch using function pointers for cache management To: Christoph Hellwig 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Hi Christoph, On Tue, Apr 4, 2023 at 6:29=E2=80=AFAM Christoph Hellwig wrote: > > 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 usin= g > > and ALTERNATIVE_X() macro. This was manageable when there were just two > > CMO implementations, but now that there are more and more platforms com= ing > > needing custom CMOs, the use of the ALTERNATIVE_X() macro is unmanageab= le. > > > > To avoid such issues this patch switches to use of function pointers > > instead of ALTERNATIVE_X() macro for cache management (the only drawbac= k > > 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. > Ok, I will take the ALTERNATIVE() macro route. Cheers, Prabhakar