Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp11294455rwb; Fri, 25 Nov 2022 13:42:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf71w/MQm4p2PrjzhkB/Tx5BrAtrKkZ54ty7EFELC8Jou0fKUqe2x2FCFU4e3wlYp2gzYJnz X-Received: by 2002:a17:906:a146:b0:7a7:bf8c:1824 with SMTP id bu6-20020a170906a14600b007a7bf8c1824mr34508441ejb.767.1669412562032; Fri, 25 Nov 2022 13:42:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669412562; cv=none; d=google.com; s=arc-20160816; b=eSfMrFjX6RlLaOmHm0fQ9AcS4Nrwrt6j3F3Kkhrwsmg3jHgAArDSJqTir1I0S9yerR Al13OJeQBXSVJNEHvUpxtTQzBSGWkotGX/2zq9/XsZ45B5ID3gb6cAB2Psl+TQ5dJFOr 9n18qTcXFhrdQK4v9ac90mKQdP5o8zHCpshKt4AKVJ6w02H51YfOKA/ZrQR1hgUMym2m i0lCyvld+fO0cq6DyQWPcZtLder/bZ6Of3U9LCp0ArPqK8APKyhElvIHzCnM1c9lMeV9 cuvlNUMurHGIKQ40Chr7ZZDodyG3BB5bWu+RhGnemCSF2+dPks/PmowbrOrW94L+ype+ 1cRg== 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=6sD/Opg2kMqx/4KzDzQ2UqRnrUwBi1wf4XCjq+pkybA=; b=VrNcZij7EQp8Ms35b+PYWbLMHs40D8cXhNBmYqnJ/w0hlQRSn5f9vc5DUoBQ8ju/la G7az2BKH6UDYZMUFOVEyP3vqPEggExi5U0++j3yU5+gje+OmzMk3NjqEx4S9bATTVph+ a65u/BoTTmr889PLJplOHk+LVg2OyX6u1q/QiRnYmL3IIJnnW+NSYbZs8ChGaMD3EBTz HvxJtj5kVRwHkmvQMQ80PBXu9xw7tqlUXINMbHQk+7SSCfkqcuU1T8/ClqAMFirt3TXq TArD7uIL2asFyrk7MehwL3kHlVoBYlj0I5y/UvOflcCiwNxg8E/MhkLzLERAGx0EH+Rf VqHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bm45a8aZ; 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 br13-20020a170906d14d00b00783c42d2da1si3384936ejb.425.2022.11.25.13.42.21; Fri, 25 Nov 2022 13:42:42 -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=@gmail.com header.s=20210112 header.b=bm45a8aZ; 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 S229878AbiKYUxd (ORCPT + 85 others); Fri, 25 Nov 2022 15:53:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbiKYUxb (ORCPT ); Fri, 25 Nov 2022 15:53:31 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9705D303E3; Fri, 25 Nov 2022 12:53:30 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id ha10so12733136ejb.3; Fri, 25 Nov 2022 12:53:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=6sD/Opg2kMqx/4KzDzQ2UqRnrUwBi1wf4XCjq+pkybA=; b=bm45a8aZ6R6jyfumNKlTQyyX9hJCa0YY6TrulwUgivh5dhWtAX1bCCMmZ08MHPJr5C mPuiZLrNlD35kkTOdRQX3P6vmYKq6k88AiAyxUNTeiLX5kZfS2FIb8F4LVRwMRwLyoBR sBJarFQgNJ2Rw5J5CTM0fKSLfGS+AMheq8vm7Gh+7GgYzxeLXtgK4Grq9hEMOJ1Puc+p BhPbWAPaKANSNaWrUuHQ9wofHHU5krRiyj+W/YRKUPUtL115CxeSSL4kRBpZIiJV7n9M fmP1eSAOAmUa2Tl6bgoTtzluUzFDlRbkjk3BeOHi8tPpqN9oxOyHgn7udlOJIrpMhNwW Ngag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=6sD/Opg2kMqx/4KzDzQ2UqRnrUwBi1wf4XCjq+pkybA=; b=bh759STP+WSgrq54vDkTqE6+ZoPPYyjugetKYgJmtH59MD7kiVOgPpMOgM703qrG9s 3Innw+TZc7msS8bPH3gnkoqxl9ydEQjgvSZSLgmNWahqlj6LPPS9wEhMXq2wzK25ACF6 y3N/agkU7iHFbwv/Zhi0CS6+b+sVtKIR/mFTOwMPTovVyng7Ekb6nxMgPx9g3OPj+QU8 R8T5zNW29j9+mntoHsAZXx2kbFtEnVoIJljbYAehA5oe1NhTuAxUesdrWkjK9a3gWN2m BCyGtGx8P/ZzgZz0suhwEecqDX+B199nciY4XJUCO27QobR4ohmUVuY0mBvriQnheXpO 92+w== X-Gm-Message-State: ANoB5plvxvDKT3EYQ7auhjTYM/7qjhgAOyhMV8rWbAatf1dHPucgxKfo HYKmSuhDKH0L8BJlW4RNSVeBVkGuLuzwdVj3b70= X-Received: by 2002:a17:906:8a57:b0:7ad:a030:4915 with SMTP id gx23-20020a1709068a5700b007ada0304915mr34077097ejc.267.1669409609046; Fri, 25 Nov 2022 12:53:29 -0800 (PST) MIME-Version: 1.0 References: <20221124172207.153718-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20221124172207.153718-6-prabhakar.mahadev-lad.rj@bp.renesas.com> <3689906.Lt9SDvczpP@diego> <3b5e52c5-7a1c-8bdd-b076-0c5e13463274@sholland.org> In-Reply-To: <3b5e52c5-7a1c-8bdd-b076-0c5e13463274@sholland.org> From: "Lad, Prabhakar" Date: Fri, 25 Nov 2022 20:53:02 +0000 Message-ID: Subject: Re: [PATCH v4 5/7] riscv: mm: dma-noncoherent: Pass direction and operation to ALT_CMO_OP() To: Samuel Holland Cc: =?UTF-8?Q?Heiko_St=C3=BCbner?= , Paul Walmsley , Palmer Dabbelt , Albert Ou , Geert Uytterhoeven , Magnus Damm , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Guo Ren , Jisheng Zhang , Atish Patra , Anup Patel , Andrew Jones , Nathan Chancellor , Philipp Tomsich , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.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=-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 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 Samuel, Thank you for the review. On Fri, Nov 25, 2022 at 6:49 PM Samuel Holland wrote: > > On 11/24/22 13:18, Lad, Prabhakar wrote: > > Hi Heiko, > > > > Thank you for the review. > > > > On Thu, Nov 24, 2022 at 6:29 PM Heiko St=C3=BCbner wr= ote: > >> > >> Am Donnerstag, 24. November 2022, 18:22:05 CET schrieb Prabhakar: > >>> From: Lad Prabhakar > >>> > >>> Pass direction and operation to ALT_CMO_OP() macro. > >>> > >>> This is in preparation for adding errata for the Andes CPU core. > >> > >> can you provide more explanation why that is necessary please? > >> I guess you want to use different cache operations for some cases? > >> > > Yes basically to call different cache operations based on the dir and > > operations (and also this allows to export just one function to handle > > the errata). I'll update the commit message in the next version. > > This makes things less efficient, because it requires more instructions > and registers inside the alternative section, and your function > duplicates the logic from arch_sync_dma_for_device(). The alternative is > already passed the operation (clean/flush/invalidate) as a token, so you > can construct the function name with token pasting. > I did think about it but that didn't help for example in the arch_dma_prep_coherent() we are calling flush token, but on RZ/Five for arch_dma_prep_coherent() we have to do nothing. Cheers, Prabhakar