Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2089565rwl; Thu, 30 Mar 2023 06:02:28 -0700 (PDT) X-Google-Smtp-Source: AKy350aoEAeKSgN7763KswjovLih9ps0Y6eYUeykqUAcv73YCX7bjMVvsHuxzw7zhBKmpjLca5Sk X-Received: by 2002:a17:903:264b:b0:196:8d96:dc6b with SMTP id je11-20020a170903264b00b001968d96dc6bmr2249263plb.2.1680181348578; Thu, 30 Mar 2023 06:02:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680181348; cv=none; d=google.com; s=arc-20160816; b=1HE9d8qbhHpcj7bLjItIz6r+CiKkxA9qzPo1GyxlXgc/OjBGjmGDQk21frLRdwnlB/ 9PhzwDGSeVgC46J2DzibuUo7geYS+393RlQto+Pd3PLdOqFobyodeD0GasXLBCWI5Hs9 bm4AbNf2goOlEXvvxpUaut2mqHfdR8vN6Rjn6rkT8e9H/7HEdcAg0mI0N23p6OSLZgpn Xmv7Qd3cVNDAx0Zn9i6LRkLXH0WhhxoEviKIoz8FIRfs2gibtllkUDtQ/HZL54MHgq6z QuqWjHGQ5HEVDHZERkWsH4UPgkabM8Ofl1rcVci8gs7JzKWPzIbZ/iQ+vlSyOTZ4/3uZ LqGA== 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=db58zgLapT4+5eM+e2dEcRQMOxpl02qLJJqJynMawPw=; b=NYFZ42UI+J3ZS4rgj32SfLQyBEEpnKsqEuAc0IN3aHWLsiZz5hERu9MLt3vuHrLAv3 bkm27kcDCFsq3A9d1qwg+ctOUL+WH9+X/seAHQFILVJ9HFqJGSv1GFqK3DxSZrbDR6aA Hp9q7Q5pQTRX2tZIRTgb0dFA7ybj58pTV2rRkVo5idBYwrPFfHr94FgNGoEFpeLa1VoV z0W6/pMen/cV0JubJ5hBNw9F3HgE1Vf8XVVjaQlrzhbFHbfutdMnO5nCLU63nqxYkFA1 aPc+0dBSo3rxtA3413Ycd+bLTTEMVd6Fn3nfZGLmVdgN4LyDIg/ZdNTVYutogSQwuC37 jFcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gvyLOSrV; 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 l14-20020a170903120e00b0019e6763b110si9403592plh.232.2023.03.30.06.02.01; Thu, 30 Mar 2023 06:02:28 -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=gvyLOSrV; 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 S231687AbjC3M7f (ORCPT + 99 others); Thu, 30 Mar 2023 08:59:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231338AbjC3M7e (ORCPT ); Thu, 30 Mar 2023 08:59:34 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D22393FF; Thu, 30 Mar 2023 05:59:33 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id d14so8225507ion.9; Thu, 30 Mar 2023 05:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680181172; x=1682773172; 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=db58zgLapT4+5eM+e2dEcRQMOxpl02qLJJqJynMawPw=; b=gvyLOSrV5NqLHUuxidIYczTpyccsUd898Kt8qAjGZCJm8EQYH5JcTmwLqg57uC0cvB j7U0x9dcm2RsX8dLxVGcboGq4Pdvm6cDFGIifVhW5LUG0BZhpnkLq+12fDfUITmPUgDN KJqbUWD1A1NNvcxlD8Va+DklQ7yRgA9v4iGNa+yDzNCF8hz/BAHOp1sivo3m/ett+i3j AtVwEXoZrtByosb2V89SvT6DgwFv0o1YJU+4lunFRTh6XWRbkQcRhcsLjusSr3Liunwq utzWcTAPvMsNoessMz8HZ9Y6dfPH5hnImowquLEBicF67L5RSN3ovwZ4QUhqVrtpFGVk CyWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680181172; x=1682773172; 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=db58zgLapT4+5eM+e2dEcRQMOxpl02qLJJqJynMawPw=; b=GgNj6eOVH4dLtqkJAK20/LMKhswJVWtIN9ax47qNYhIqspEW1sBhaVfRTt7mbducAS A/wL6rr6YO66M44LZIMe9BkSx3c+JNzUH2xnkc9r16MHCiyeI9R5RCxyWglII8gxQ5w9 bCYPeEdyfcSC9EbpkKYIRbRIn1fOLUaCcupt2cSthVyshskd+TLGJZ/7cDJ3Z0WSEc2T gqEy2kgE0dRFahKJNbnTFzw+K5B/w3khCo8Uhz8SEdOzJwdYgXsGMQJ9OgGE/zmWWUmz aJq0z2ghF6yhujSghCM5ciilGkpsMS6qST4Dl4itQDFvqWqHPhZqC3K5AaOIx7YVrdRs Nk2g== X-Gm-Message-State: AAQBX9fjeB2bUp6zI1YBXwPHLB+knqRrRPpcKMIVKdRSSK8EliD4FX/T Wqsbf9lEIPRblE8XG9XZYEc24SZtKOBBy0KIZbE= X-Received: by 2002:a02:95c3:0:b0:3eb:3166:9da4 with SMTP id b61-20020a0295c3000000b003eb31669da4mr2710421jai.2.1680181172425; Thu, 30 Mar 2023 05:59:32 -0700 (PDT) MIME-Version: 1.0 References: <20230327121317.4081816-1-arnd@kernel.org> <20230327121317.4081816-9-arnd@kernel.org> In-Reply-To: <20230327121317.4081816-9-arnd@kernel.org> From: "Lad, Prabhakar" Date: Thu, 30 Mar 2023 13:59:06 +0100 Message-ID: Subject: Re: [PATCH 08/21] riscv: dma-mapping: only invalidate after DMA, not flush 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 > > No other architecture intentionally writes back dirty cache lines into > a buffer that a device has just finished writing into. If the cache is > clean, this has no effect at all, but if a cacheline in the buffer has > actually been written by the CPU, there is a drive bug that is likely > made worse by overwriting that buffer. > > 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 d919efab6eba..640f4c496d26 100644 > --- a/arch/riscv/mm/dma-noncoherent.c > +++ b/arch/riscv/mm/dma-noncoherent.c > @@ -42,7 +42,7 @@ void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t si= ze, > break; > case DMA_FROM_DEVICE: > case DMA_BIDIRECTIONAL: > - ALT_CMO_OP(flush, vaddr, size, riscv_cbom_block_size); > + ALT_CMO_OP(inval, 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