Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2130370rwl; Thu, 30 Mar 2023 06:29:09 -0700 (PDT) X-Google-Smtp-Source: AKy350ZjGVwQcU5rSlzs7qChX40pduUEuTh9bsIbCUUlP/LPmJtZ90tEv87xWgf7x+4fZJTm3kWd X-Received: by 2002:a05:6a00:194e:b0:62a:5ae:3012 with SMTP id s14-20020a056a00194e00b0062a05ae3012mr2619563pfk.1.1680182949587; Thu, 30 Mar 2023 06:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680182949; cv=none; d=google.com; s=arc-20160816; b=oT8OSRqHQkjSjhK41UappV2c9ophKF++r8ZC7UK6cr2Pmtjd7r3juai68rhepvi7Sy 3Y21CDFa3d6+UbKVXI6fodKTWzCf3CLU6ZkKtBs71vdtJKEhFNl5iEkTBbTap8B7+SlZ huvTajjy7HdJh60YqoDMCxWSQwaOF+/XxLUkccCqKnX+lIrxIJbUObxnDbkcOAJJctTp VI4BZ9HMkRnrw20VpEzgMPFoql6g3pEGFdEDwcvi1hsBjpxoN01ZLpYxUBqiLXQUozrf tuP7gCic3qRpuU5gmu5AZH9ah50kX2co6DF4Pv5zW83TRITpCc2xv5Q67fnbh1MyXXxv lwZw== 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=n2pZnebNGLahNe2yjgjrKsFqnYvTRYd7uF1JoUeedu4=; b=o+6Sod2QKNVACzhmByNi0D+9ZGVWruatYBBl9X94Dw1QCFiS11oTJzXpoj4pjfNOX8 bo8JJrnmEFoHbiSXGwSwRrXYa3eAE0gCTRLUl0Po8tCnUJ6raVenIrOVtQxVvFS5DByO 0MrUp5YyMFsGkgWXwzmG9xNqr1l3Ct5m7pSzfz/0ci8Z35KLzECImMJAlPM6h1FaQOpV OiW7j4aUlFiJkUiC+wea51W5iNWBEGcOtRqVUc3D6RT8wK/dR1C2BWKDL55Gpyz0uN2b +ajlxKADItaVgwzM5HAQdj/fTa9PbJoXWAwn7/82OdQPbb8hyrP8KUxywfpMe0C2AfHJ ACLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ipMmc4f2; 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 f16-20020a63f110000000b0050f8d6d85fcsi19708609pgi.303.2023.03.30.06.28.52; Thu, 30 Mar 2023 06:29:09 -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=ipMmc4f2; 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 S231975AbjC3N1M (ORCPT + 99 others); Thu, 30 Mar 2023 09:27:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231822AbjC3N1J (ORCPT ); Thu, 30 Mar 2023 09:27:09 -0400 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B080BDEF; Thu, 30 Mar 2023 06:26:46 -0700 (PDT) Received: by mail-il1-x134.google.com with SMTP id e6so9776646ilu.9; Thu, 30 Mar 2023 06:26:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680182805; x=1682774805; 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=n2pZnebNGLahNe2yjgjrKsFqnYvTRYd7uF1JoUeedu4=; b=ipMmc4f2rhe9ZxmiesNtaMCdByaDBx7tN+zc7KMJSrXwy2WiELheDph1YzfOyUJK5G 2D9w1lws05LiLD96ktr9W079igf4FZMXTfy1rli6Syf8wtA/xOvdvesIM/xHoHpQ4mp2 kGaQPBqZIeQg75WZRmLC1J0vvz0N+J/wHgPfeNx6CWqljr2xVRlnhMmqStDFXeH9OteD UdDKlBrcDx+IHVgGRnNql6fNqhC8UJ/0zLJcMACiQdKHQjGURJds5lWBs1vyz5ebkPWw 0o6fGsGo2wE6PVztfykuJW8aKjmi0krcntJGszy/82gq0ndxxs4fJ8aJQW98nZewfAkA hgxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680182805; x=1682774805; 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=n2pZnebNGLahNe2yjgjrKsFqnYvTRYd7uF1JoUeedu4=; b=XKsMDayOlwVZ/+/jeS5lmBFAGWD0j4RBR2BY2nyji6WZuy/N3FaKHLkPpqeaWPMqUn txdSh18O2NU16utq/lwzwgwz6rUKdkcXa2qlMQymOBmYC4kqkMXed9jSBvMSDdPiiod+ A6fFy4Nl/uQuMY7iayVLVTYQfi+VgqCvtmdJOwiEv7zl7K7TaBAAFoXizow8b/IX+4jf ga8m21Vt/qrehbiq6t46ECtRixi79KHHi06JGkaEF5lYbie94Jf313PUdpuZI8R7wHI/ EPepXZ1PH2imQByNnwrQ5iLig0ayC5BcZrRK7n7MHVomJSJgP0QgfBN8E4W1mQsLjUrT K/ZQ== X-Gm-Message-State: AAQBX9d+jR2BwKkDtcU459i1tNTLR81oh9wsEQLdmwozA42l3tHgpdiM xDe5DgCBBuRVlvi9zaCfTm8eGSjpDHycrDjd/VE= X-Received: by 2002:a05:6e02:1047:b0:325:dd36:7451 with SMTP id p7-20020a056e02104700b00325dd367451mr11322497ilj.1.1680182805604; Thu, 30 Mar 2023 06:26:45 -0700 (PDT) MIME-Version: 1.0 References: <20230327121317.4081816-1-arnd@kernel.org> <20230327121317.4081816-10-arnd@kernel.org> In-Reply-To: <20230327121317.4081816-10-arnd@kernel.org> From: "Lad, Prabhakar" Date: Thu, 30 Mar 2023 14:26:18 +0100 Message-ID: Subject: Re: [PATCH 09/21] riscv: dma-mapping: skip invalidation before bidirectional DMA To: Arnd Bergmann Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Vineet Gupta , Russell King , Neil Armstrong , Linus Walleij , Catalin Marinas , Will Deacon , Guo Ren , Brian Cain , Geert Uytterhoeven , Michal Simek , Thomas Bogendoerfer , Dinh Nguyen , Stafford Horne , Helge Deller , Michael Ellerman , Christophe Leroy , Paul Walmsley , Palmer Dabbelt , Rich Felker , John Paul Adrian Glaubitz , "David S. Miller" , Max Filippov , Christoph Hellwig , Robin Murphy , Lad Prabhakar , 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 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 On Mon, Mar 27, 2023 at 1:16=E2=80=AFPM Arnd Bergmann wro= te: > > 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(-) > Reviewed-by: Lad Prabhakar Cheers, Prabhakar > diff --git a/arch/riscv/mm/dma-noncoherent.c b/arch/riscv/mm/dma-noncoher= ent.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; > -- > 2.39.2 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv