Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp357350rwr; Wed, 19 Apr 2023 07:26:32 -0700 (PDT) X-Google-Smtp-Source: AKy350anvYXlSy/kMWvaZyOjWPT7K+vAzlK7+h/daC6sPIbTHODgTmEX8m9UvdOxMsCzydgdFhf3 X-Received: by 2002:a17:90b:2249:b0:246:fd10:a652 with SMTP id hk9-20020a17090b224900b00246fd10a652mr3184306pjb.33.1681914391862; Wed, 19 Apr 2023 07:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681914391; cv=none; d=google.com; s=arc-20160816; b=OO8u84SZ6KddkOsFfH4v68pJdR47tTza85BnQf82jLLFGoR+77IkWaC+NQyce/3rNH PJ1wJIfpbkZGndXdGhlhrZ9ucEiuhF11qV/RcvCUXb1i20/GhYdVHJJq5T5OVh0R9J7+ mOputuFqQS7yU5xVE+jG0xD2QqGCtPRVEbOC5qvl1n9Uoqxqnp07L0bmS/lo15hpGQFj vsoP/z4MnBOSt1YD7u+63nLwczRg9SPrRXb1EY9y/4spX+Zil0aFixo7k/vrCZr86NFi elF8f5u7FStNTnYZN5aKSRSYqnc+XB0LnzEaJXtOb6bQ3lsF9ZtH0f3Q6JMRGxB8PS9T OCdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=IvT99d3vu2s9u2HdXHuOsCskK0/5VChFq+aBcaoQwKM=; b=hzezR/GmdbXnbJOOslT+jPb1LFd6K5wTRRYKkX+1fAZDuaxdVp3zynAnCh9GcQdTVK 8qGv3txA5BzikbsJJHZhYGiHahhaxql4+ZYR5CgqsMoR//KjUCaSkgMKgxOn0y6zkdzR nkFRHjOieQkGPvcXiGyh47P1yRG/NrzgPWBhteSjzyiQeFWeJ8+Np8GrCk/Ls0NU/EQ6 EW/FrPG8a1FMIAyzLtI0c+JOlzhbse5tUZ8b+EIXY0zSzASGjOPSBXBYyPehWcn0/Erz b/VHRsi3WqfgmHqdHjTFruJtub4Ha7fsshI/x1wMeE10XeWhJuNh5TlGRf8SfE9j9gSk Xwxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=eJ51Lyhm; 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 oc14-20020a17090b1c0e00b0024695095bb3si1864431pjb.189.2023.04.19.07.26.20; Wed, 19 Apr 2023 07:26: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=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=eJ51Lyhm; 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 S233004AbjDSOXV (ORCPT + 99 others); Wed, 19 Apr 2023 10:23:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231230AbjDSOXI (ORCPT ); Wed, 19 Apr 2023 10:23:08 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4376DB76A for ; Wed, 19 Apr 2023 07:22:53 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-63d2ba63dddso1793938b3a.2 for ; Wed, 19 Apr 2023 07:22:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20221208.gappssmtp.com; s=20221208; t=1681914172; x=1684506172; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=IvT99d3vu2s9u2HdXHuOsCskK0/5VChFq+aBcaoQwKM=; b=eJ51Lyhme8n3XB+0k6fcBFov9PY8/EUmTR8+nuSaGr7xBsijqIoLjwhsLzVxYH/nx0 wauVowtfzqnaLMg0Md06tjLXI3lWkSGzsXedNOsMpQwkDCNvEtBTyQ19M/Yyo6D06BSV XNjXn0CGdLZl3nFWqDjNax+yB6CXLq01SwKNwyDS36uGnLYxQFXzNQuK/+7hScqPlZwX z+agJw/VCIGMUixwVDzm2XMnLSn8GR3DsnMXY+jrQCfbr9O1Le1uXDKTi2rYkt7oJ2Ce tyNNGrxSj0L54sdbIeiSTDtndMc3YiWnjyxMJLeRw/TsNRHsyFeDM9KNzzDNKUVPs4Et pKOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681914172; x=1684506172; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=IvT99d3vu2s9u2HdXHuOsCskK0/5VChFq+aBcaoQwKM=; b=CAb7eU3jm+uGbXmC8NV+BrlAEzZ+jzcXsczd94NtIPHUMYcOfEUrX9rdxpgei0+9XE Dv62jltY87gxgRzelBD+GRuzlbYAAlwcBXoQtHHRVwgpo68Vg3rOIZqHu7Stuut/uBPn nQw3NKInJl7jfViI4bms0NGtYUmANK4BjoU3pGBT5a10gL0Iov9S4Krh1Z2dbcJGpYMq SggSLPbSWe5jKziMrYh3B4cPwfc+vu2B7us8l+NbvPqb4N+nmkG5PGqct+LDwiMvXa0s m1OwCBBsneMPyRlhpYD0r+dNy3aiU7Nv6fb4hlQ9kkIe/WVSA0BtubY+Fkkx7DBm9lCf sssg== X-Gm-Message-State: AAQBX9eevElweIwcfbRqYfXPx612p8Z2n6U5n1xuuw1lzPCR3kRoDjK1 GPjYT/vbMeWbpDJvQ515NAGShnKaIIfZm4rPL+5w+A== X-Received: by 2002:a05:6a00:130a:b0:63b:859f:f094 with SMTP id j10-20020a056a00130a00b0063b859ff094mr4002975pfu.20.1681914171995; Wed, 19 Apr 2023 07:22:51 -0700 (PDT) Received: from localhost ([135.180.227.0]) by smtp.gmail.com with ESMTPSA id d2-20020a63d642000000b005140ce70582sm10431557pgj.44.2023.04.19.07.22.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:22:51 -0700 (PDT) Date: Wed, 19 Apr 2023 07:22:51 -0700 (PDT) X-Google-Original-Date: Wed, 19 Apr 2023 07:22:44 PDT (-0700) Subject: Re: [PATCH 09/21] riscv: dma-mapping: skip invalidation before bidirectional DMA In-Reply-To: <20230327121317.4081816-10-arnd@kernel.org> CC: linux-kernel@vger.kernel.org, Arnd Bergmann , vgupta@kernel.org, linux@armlinux.org.uk, neil.armstrong@linaro.org, linus.walleij@linaro.org, Catalin Marinas , Will Deacon , guoren@kernel.org, bcain@quicinc.com, geert@linux-m68k.org, monstr@monstr.eu, tsbogend@alpha.franken.de, dinguyen@kernel.org, shorne@gmail.com, deller@gmx.de, mpe@ellerman.id.au, christophe.leroy@csgroup.eu, Paul Walmsley , dalias@libc.org, glaubitz@physik.fu-berlin.de, davem@davemloft.net, jcmvbkbc@gmail.com, Christoph Hellwig , robin.murphy@arm.com, prabhakar.mahadev-lad.rj@bp.renesas.com, Conor Dooley , linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-oxnas@groups.io, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org From: Palmer Dabbelt To: arnd@kernel.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Mon, 27 Mar 2023 05:13:05 PDT (-0700), arnd@kernel.org wrote: > From: Arnd Bergmann > > For a DMA_BIDIRECTIONAL transfer, the caches have to be cleaned > first to let the device see data written by the CPU, and invalidated > after the transfer to let the CPU see data written by the device. > > riscv also invalidates the caches before the transfer, which does > not appear to serve any purpose. > > Signed-off-by: Arnd Bergmann > --- > arch/riscv/mm/dma-noncoherent.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/mm/dma-noncoherent.c b/arch/riscv/mm/dma-noncoherent.c > index 640f4c496d26..69c80b2155a1 100644 > --- a/arch/riscv/mm/dma-noncoherent.c > +++ b/arch/riscv/mm/dma-noncoherent.c > @@ -25,7 +25,7 @@ void arch_sync_dma_for_device(phys_addr_t paddr, size_t size, > ALT_CMO_OP(clean, vaddr, size, riscv_cbom_block_size); > break; > case DMA_BIDIRECTIONAL: > - ALT_CMO_OP(flush, vaddr, size, riscv_cbom_block_size); > + ALT_CMO_OP(clean, vaddr, size, riscv_cbom_block_size); > break; > default: > break; Acked-by: Palmer Dabbelt