Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2589019rwd; Fri, 16 Jun 2023 05:54:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6NBMqNbVr6cwFis5BMu+PMP6Q1Paam3PdaEiCzCZT1yK441aRGpwEqJO+Jgm70L8z3HMBe X-Received: by 2002:a17:90a:51:b0:25c:1047:93b5 with SMTP id 17-20020a17090a005100b0025c104793b5mr1247243pjb.24.1686920050131; Fri, 16 Jun 2023 05:54:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686920050; cv=none; d=google.com; s=arc-20160816; b=GLhgnMRJs0ssdwMcjcJsP47mv656s/0SBTc3Qwz+WsoSHS93ep5HoR/O1kX1Zed6rU sP1mbDanPE1U57gGwgIT+mhpzWuxPhj807LsfAR5t2iFOH8K7pUzbBghq6AGcUmulbTR fqaJ2X+LXSLAMUYO+/C4vlnxeTTqhEaLlbJVOE/hEUJNvkVJuAFk98cN5mdFf8HghZ1C ZWmpXwmqXilYomJ+khxMiNcdITGd8oLi5y2cNGYpkqB4s3kQ5p2vUjtXZLukyi6gRjft rOVBpuFRcSuRJEZ81mRNQoycSVrOhXbidBA2iq+e/wdySOsdP/e26HgZvnNegL/gmNeI I1+g== 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=SVXfmE9xuqvJBkC+/tsNkqbXmSmcyqz9tBTp7H4fW+s=; b=hzkWp3dX5Z3JdcO1HhRcVjx8ezzBozFMYLpsPeTl2VWZ7sN91fTxOxIMGwQl2PLJWK CvcAm1ulOMVScrdCl9WhIaa+DrMdu1iUH/St4rygkOsxAai8KyRvmtVbpX9CJfnzrIpv tCQq6jrghZPGwyouxZjjdk/W6ibYBG0U/jKuSTsEaDJ9KnEF3n5sZel20dBWojupzJxo Q+XPTTdh4Kncb1U0fTz7Enjr7NlkaJsJwUvSQLIhyA9nL6XJdmBA/KfZhBycBum7Ffqh DouaNGWfPDkgoCxllfzoisvQ/rs1ROwzQtN+emkm05zqq8ft5UFD3kBbsb9Tfi4R8wcv ZBaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Dm5UP0cq; 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 z7-20020a17090a1fc700b0025690b76c95si1515721pjz.10.2023.06.16.05.53.49; Fri, 16 Jun 2023 05:54:10 -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=20221208 header.b=Dm5UP0cq; 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 S1344766AbjFPMOP (ORCPT + 99 others); Fri, 16 Jun 2023 08:14:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345320AbjFPMON (ORCPT ); Fri, 16 Jun 2023 08:14:13 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26CB430E0; Fri, 16 Jun 2023 05:14:12 -0700 (PDT) Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-77d7f0ea1daso24391539f.0; Fri, 16 Jun 2023 05:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686917651; x=1689509651; 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=SVXfmE9xuqvJBkC+/tsNkqbXmSmcyqz9tBTp7H4fW+s=; b=Dm5UP0cq9vx0CoXvsXIryqw8idxJ2dtcwVacxjTrmAU9AR6CvAa9+/4i+scxeoC8Vo dfPkhHBacDXFYB/BCowsuEN6nyqZVA+z/TddxswHEMZ1IOjShH6gieq+VxwvGetmMKp4 0l989bM/DyQJcCFMTOK+kEqHG8i8vt1Y1A903YL/Sp78hSXrciNgy0uHsDarFMKetsa3 LqYiJCuW6gWs17nAg7Aak2DCjJPImSKAz45kewQUwE95OZLVDRMTmZCW1fgPgIa1qr2w ieuXTW2ROTAwUgwIQ06NV2F0Tvm98mk8CA32KhZkLm20BLGv7YQz0r/qHWK8ftVn0ViL mjRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686917651; x=1689509651; 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=SVXfmE9xuqvJBkC+/tsNkqbXmSmcyqz9tBTp7H4fW+s=; b=I56MBreBcaRhEf2Jb/RJb5WlG+ZajgUva9EC/b/egqM7fg7QawBpPjlHuPojZ6Fdhd K1vVx12po5R5RzzUTh+L/PWhs7d65WaKVV08XfbpYRnDUKTy9NEWohMEnAsLJ6qipcPk ASdpbR6fuw4ASbJMfFbOAo1vX3jbitzihVuttA/d3oU9U5x0dJ3kKjF/il5JmdHmti9T CG+rMhXUCjIsTnjNtf8PSKfUT+wZxBGZZ3GQjp7W4yvP+ddqN66b1HTK1qO/LZyxH6iP nRrOqgiam3StkBqpEfpm6j1Pf8D1XCtRV+6fSe9qcaWtBE9Ve98+x+7Lu5jce6d+uohV g3wA== X-Gm-Message-State: AC+VfDwoSyqPtWZi0fUXsJAAytmiqyF5jq3JkUzX9va5njo4w43mhWKo uUBGSHWda/ZavjPYcozocjMV3DNJofcPDKCK4gA= X-Received: by 2002:a5e:c103:0:b0:753:42d:25ec with SMTP id v3-20020a5ec103000000b00753042d25ecmr2481529iol.20.1686917651264; Fri, 16 Jun 2023 05:14:11 -0700 (PDT) MIME-Version: 1.0 References: <20230614104759.228372-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20230614104759.228372-4-prabhakar.mahadev-lad.rj@bp.renesas.com> <4f69fcfe-debb-4979-9070-1d58ba35032c@app.fastmail.com> In-Reply-To: <4f69fcfe-debb-4979-9070-1d58ba35032c@app.fastmail.com> From: "Lad, Prabhakar" Date: Fri, 16 Jun 2023 13:13:44 +0100 Message-ID: Subject: Re: [PATCH v9 3/6] riscv: mm: dma-noncoherent: nonstandard cache operations support To: Arnd Bergmann Cc: "Conor.Dooley" , Geert Uytterhoeven , guoren , Andrew Jones , Paul Walmsley , Palmer Dabbelt , Albert Ou , Samuel Holland , linux-riscv@lists.infradead.org, Christoph Hellwig , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Linux-Renesas , Biju Das , "Lad, Prabhakar" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Arnd, Thank you for the review. On Wed, Jun 14, 2023 at 1:36=E2=80=AFPM Arnd Bergmann wrote= : > > 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 =3D { > > + .clean =3D NULL, > > + .inval =3D NULL, > > + .flush =3D NULL, > > +}; > > This could be marked __read_mostly or __ro_after_init as > a micro-optimization, if anyone cares. > Ok, I will do that in the next version. Cheers, Prabhakar