Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2896139rwl; Mon, 27 Mar 2023 06:48:40 -0700 (PDT) X-Google-Smtp-Source: AKy350azxomGUm6yjsIgY1FiIV7AX91VlDHT7DB4ScL93lAew0B5E9PGAYy7Q/wHVRq58cYTmg0T X-Received: by 2002:a17:906:a399:b0:930:9385:ce51 with SMTP id k25-20020a170906a39900b009309385ce51mr12419247ejz.68.1679924920764; Mon, 27 Mar 2023 06:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679924920; cv=none; d=google.com; s=arc-20160816; b=BiVHQhSTqn3mdv01jgTC8h72MR/TpFfmhkbF41DaH5kZDNpb9C4qoo6oVaqBVTjIRI 1Mr2QoAUicKmdCAYuLodaZQksuyisSe/zh9SG5HpceeeqCJCWxPctHTYY4uA9NXnYz8H YCrksq2UqhiaGZVs37YWQy6x0mUGXmEA4aZZYCeGuZfxrraX7VXTCoRl0e41V5k5OlB5 k8CwTP6jdyujvDLAYaqevVzPFhmuTI/qsmLG7ui/O058QJNoHlIKCrwjAi83R3XgfLFv IBzOFeEr5HTBP4o4tWOJ0SrGIh+GwlqH1N4/+ncqcBWxIiftSIhkRkK/pPZCx+qw+PhB xRTA== 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=+vhvSwRRpxTC/V1jfa0B8Ur3pblkhP6qRbkUddosRDU=; b=ap1hpBBuxAJj7dsnR4Xln/gQ4ZGyiYI9C2HtI5avM+t64rfD7bRzvzFuW1dZFUPt8J iFsH/zWRleVwf4ToXXDweIk67IB+1PW6Ci1vGsCOrI2yVRyuFosAsP/ERhCRdW7ykdd8 J1AkU2qrQAN84OrVZ0KT/90WrStdBUoEBceIycn+rsWlv/vUU99yWDlTyZfteabdQz3U SzYBkzGj+Vw0L2X0e2OugFdzAKEZ+9C5HQDvdogCi8W8tW2qAA9GFqtdZBdQJfjJsDYf sDpGtDWds8hfk5VKj9aer1lKqgMZAZbtPpc3O/TSceYsf1tfQpEmPvoNYezRTWIwx5h1 QJMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=me5d4slZ; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gz22-20020a170907a05600b009332bb8b1fcsi6930796ejc.842.2023.03.27.06.48.16; Mon, 27 Mar 2023 06:48:40 -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=@kernel.org header.s=k20201202 header.b=me5d4slZ; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232467AbjC0Nhk (ORCPT + 99 others); Mon, 27 Mar 2023 09:37:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232102AbjC0Nhh (ORCPT ); Mon, 27 Mar 2023 09:37:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68E9E1BC6; Mon, 27 Mar 2023 06:37:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 02D5E61286; Mon, 27 Mar 2023 13:37:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66B4CC433AE; Mon, 27 Mar 2023 13:37:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679924255; bh=sKw5GnPYWTx1tEo+IYG63yzmzH5uUSkHi5W70RXeiXE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=me5d4slZ7BQwLYQm0UbRAC2iVqyUYiUxghqwGTfCH/vpOgHLgDekGA1TBK2dJnpUc 9WkLB4v/ufSmAfgCCV5YSuoaGaKiOwCqLyqumjx5XyRbF9dJBFFSs6HLt7PEmp891n XwMOQwvU37TpfHRmLM6F2Wu2rjJcr08TSj+OfMLw3e/eYNtc8Ff3gi22phENHfgyn4 DNtHVC4q96uONAXntDKuUBjVgg2LmxrGjTx5EvWUGZrk2TnDCWrxinTYGMaEa37yw+ smAD8fYPQMq6WbMRXe/30WkwvLcPhMLKpDQqlLl5O9Eqp+HZa9Zv6aqE9YRxyDLRSD 1UErhgcXn+Ddg== Received: by mail-ed1-f52.google.com with SMTP id r11so36361759edd.5; Mon, 27 Mar 2023 06:37:35 -0700 (PDT) X-Gm-Message-State: AAQBX9eEu4XKsmRvh0JrG+LYiYn12N/qN/lZiehJvyNIK6uUwrxWSZIa fogXil5VslYgdYJZExPp8pksxJBCtWLuhtdig5k= X-Received: by 2002:a17:906:4746:b0:8ab:b606:9728 with SMTP id j6-20020a170906474600b008abb6069728mr5893837ejs.5.1679924253534; Mon, 27 Mar 2023 06:37:33 -0700 (PDT) MIME-Version: 1.0 References: <20230327121317.4081816-1-arnd@kernel.org> <20230327121317.4081816-11-arnd@kernel.org> In-Reply-To: <20230327121317.4081816-11-arnd@kernel.org> From: Guo Ren Date: Mon, 27 Mar 2023 21:37:22 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 10/21] csky: dma-mapping: skip invalidating before DMA from device To: Arnd Bergmann Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Vineet Gupta , Russell King , Neil Armstrong , Linus Walleij , Catalin Marinas , Will Deacon , 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=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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 8:15=E2=80=AFPM Arnd Bergmann wro= te: > > From: Arnd Bergmann > > csky is the only architecture that does a full flush for the > dma_sync_*_for_device(..., DMA_FROM_DEVICE) operation. The requirement > is only make sure there are no dirty cache lines for the buffer, > which can be either done through an invalidate operation (as on most > architectures including arm32, mips and arc), or a writeback (as on > arm64 and riscv). The cache also has to be invalidated eventually but > csky already does that after the transfer. > > Use a 'clean' operation here for consistency with arm64 and riscv. > > Signed-off-by: Arnd Bergmann > --- > arch/csky/mm/dma-mapping.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/arch/csky/mm/dma-mapping.c b/arch/csky/mm/dma-mapping.c > index 82447029feb4..c90f912e2822 100644 > --- a/arch/csky/mm/dma-mapping.c > +++ b/arch/csky/mm/dma-mapping.c > @@ -60,11 +60,9 @@ void arch_sync_dma_for_device(phys_addr_t paddr, size_= t size, > { > switch (dir) { > case DMA_TO_DEVICE: > - cache_op(paddr, size, dma_wb_range); > - break; > case DMA_FROM_DEVICE: > case DMA_BIDIRECTIONAL: > - cache_op(paddr, size, dma_wbinv_range); > + cache_op(paddr, size, dma_wb_range); Reviewed-by: Guo Ren > break; > default: > BUG(); > -- > 2.39.2 > --=20 Best Regards Guo Ren