Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3513390rwl; Mon, 27 Mar 2023 15:32:44 -0700 (PDT) X-Google-Smtp-Source: AKy350aKOhHYdDJUbxLFqyyBWFQ1LdhT3aYiUVIMokmy/NiQYOXKZZuCgHz4zJuivsvV0gYacd6P X-Received: by 2002:a17:90b:4a50:b0:23d:21c9:193 with SMTP id lb16-20020a17090b4a5000b0023d21c90193mr14511705pjb.2.1679956364016; Mon, 27 Mar 2023 15:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679956363; cv=none; d=google.com; s=arc-20160816; b=N7choKuagyBbSv/aPzsCmG5e1o6bYjwSwyJCrwjqBpH/7jdHaXzC/OaqY8db3JOtfI /Evrv1zX8I8/bLAJe65xCLFHI5lFNE3+iwE/jK9JFRYRi+qOPmWPIH8rhCz0HMFDF9SQ 1WH9JkxUALgKwy8tYkMpNIHtMVBD7cRZ5Lk4nGfA5NS0KT+cbeoEM5GLwm6F4PgXEArb kzajTNwhuGq0cyZs2rNOlTm5rq9iZbw2fP1untoXgAyrjuAdL3NQv5fL+ZCcIP0ZvK0x bYlypw8dxzd0j3jyX11MGC2AIq3EPHNhF5C1mBhorVoeDw1sYp3dCnRUjjoOfxbylgqr bt8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=6B+A/KUX2k3p+4OAz+KDJjQDxuvyfZUaSAQqfteGE50=; b=Xzir37es8glCq4WRAYLkqCM3whdbi5BkG6xVO9JmyF/U6CL91y1adj2Avo9QaiXgmp kOh8FZD/GVRQa9Je5RR3/WDzljyLObcSaZ+cOWr8dEKZc5wYYkG/cjxKJFp01iJ4str+ Norqfy80lOjcb7ST8NWwgU59uAUcHHeNrF512fQxlQueaH/IsFidMcu5FVlQIwOydfLg /Pz/7KST2Qw2wvv6PQvSMYzV5T/696uy7At3rzpIsiHB4s0BarPXAQ2msiyyWodBZDm6 v5/U5OoPk0+dMnsHwImaXiNmy3QxE/65TfU6ljiBx64uwFv/n9znVGj5jPYvz/Gq+Y6j 7K1A== ARC-Authentication-Results: i=1; mx.google.com; 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 q62-20020a17090a4fc400b00230c717f66esi6756584pjh.172.2023.03.27.15.32.30; Mon, 27 Mar 2023 15:32:43 -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; 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 S232169AbjC0WZh (ORCPT + 99 others); Mon, 27 Mar 2023 18:25:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231977AbjC0WZe (ORCPT ); Mon, 27 Mar 2023 18:25:34 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8912C40CF; Mon, 27 Mar 2023 15:25:21 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 31BF267373; Tue, 28 Mar 2023 00:25:15 +0200 (CEST) Date: Tue, 28 Mar 2023 00:25:15 +0200 From: Christoph Hellwig 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 Subject: Re: [PATCH 21/21] dma-mapping: replace custom code with generic implementation Message-ID: <20230327222514.GA17904@lst.de> References: <20230327121317.4081816-1-arnd@kernel.org> <20230327121317.4081816-22-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230327121317.4081816-22-arnd@kernel.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_NONE 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 > +static inline void arch_dma_cache_wback(phys_addr_t paddr, size_t size) > { > + dma_cache_wback(paddr, size); > +} > > +static inline void arch_dma_cache_inv(phys_addr_t paddr, size_t size) > +{ > + dma_cache_inv(paddr, size); > } > +static inline void arch_dma_cache_wback_inv(phys_addr_t paddr, size_t size) > { > + dma_cache_wback_inv(paddr, size); > +} There are the only calls for the three functions for each of the involved functions. So I'd rather rename the low-level symbols (and drop the pointless exports for two of them) rather than adding these wrapppers. The same is probably true for many other architectures. > +static inline bool arch_sync_dma_clean_before_fromdevice(void) > +{ > + return false; > +} > > +static inline bool arch_sync_dma_cpu_needs_post_dma_flush(void) > +{ > + return true; > } Is there a way to cut down on this boilerplate code by just having sane default, and Kconfig options to override them if they are not runtime decisions? > +#include I can't really say I like the #include version here despite your rationale in the commit log. I can probably live with it if you think it is absolutely worth it, but I'm really not in favor of it. > +config ARCH_DMA_MARK_DCACHE_CLEAN > + def_bool y What do we need this symbol for? Unless I'm missing something it is always enable for arm32, and only used in arm32 code.