Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp791802rwl; Fri, 31 Mar 2023 02:22:59 -0700 (PDT) X-Google-Smtp-Source: AKy350bKhxAvxLiFz5bFHruP1tPyCzKDqOOlgs6oGpQSoCGOG45yvpqiaPln7SvA63SnJ9wEfpYn X-Received: by 2002:a17:906:74c3:b0:944:4d7:d3d9 with SMTP id z3-20020a17090674c300b0094404d7d3d9mr4138316ejl.2.1680254579234; Fri, 31 Mar 2023 02:22:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680254579; cv=none; d=google.com; s=arc-20160816; b=pF7mgvoeQpRaGjT1XR1KOOY3j1D4E81AuJ3gjYXYgmofyselSJVg8RvUNHxSR2w77Z mghbf8eIPsZwwKJfYWANZYNggx6jxAiG4FZqZavWJkN1IUQgagQkR7y+wPfI7J9XIwMG pyH6cd64b3YaY9WqkvmuKvM0epihnfZhbrGHf0SVKnKnYd6s4AW+j8OUCXHkaKLdIm0p Kxovzr3g1GLu3TvQU3GUs6zdWBjBcK3NhTCwmRwluaHkWS8BCZlVUNhsSDs4kkkE3c+s qmm4La3AZZyhFNcyfvnjw8U0hN2s9/E4VRyc1S++xL2ESSB8B85AGFgBD/5WLTkDn6GE MvSw== 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=h5CSdrZ6l2xgXTKH1xLlq+jBgcd46ofV0BIoXJ6/6jM=; b=CsDrW6ODngDVDgNZiQxc5EqTqFILvKnuzeXxBa3rRlXPH0AZ9i3KTjHJA1RwXZFTlR h5wt2Osbqf/lNYGeoaXgwo1dmJKXiZrls2Yhx5DCJ/F5NRCHeUx0P6kXE4FJFFUoo3AM WnHH3t1923GYx1Hth8WAzI/w/O17w6WlOkDUyk6rvb9wiYes0g7uOy1GdnMS9UgNKXUL 0Y1fGYDwDuUHv/ocXVP2pvA9iRiKlQnEnc1hoSD/FVZIferd0/rkS/Szq7CnsW7ffk/N F7mi733rYtChmutkvCqc3NA4ydJ0GfI+OCfwyYjFsFnw476lF2ouDahAo3bDdUWiB8Zk 0v4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NHiE7PIU; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id op28-20020a170906bcfc00b009311b97abe3si1623216ejb.112.2023.03.31.02.22.34; Fri, 31 Mar 2023 02:22:59 -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=@linaro.org header.s=google header.b=NHiE7PIU; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230239AbjCaJLC (ORCPT + 99 others); Fri, 31 Mar 2023 05:11:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbjCaJLA (ORCPT ); Fri, 31 Mar 2023 05:11:00 -0400 Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BB271738 for ; Fri, 31 Mar 2023 02:10:57 -0700 (PDT) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-5419d4c340aso403260597b3.11 for ; Fri, 31 Mar 2023 02:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680253856; 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=h5CSdrZ6l2xgXTKH1xLlq+jBgcd46ofV0BIoXJ6/6jM=; b=NHiE7PIU/1phremrSsF3/CQl6d7YKEdlDtlJ9Vwel53T7D2fDOz9Eopk4FcpZ1dSIm yu9e8Xh0JHbk1x3sJ/r5+kRcRDuV43DeZbQfu0w/kMYchm+WG+IUDHf/BC224Jw6v7Hy BSChRpraLXKpD4dnyCnfqBFCzvRsPoxHhXE18GrmUrPhY5zXpmqt7RX+zSjGr8+FpZWf ToQfnMbBgbPLRwCOIxrk4oSI0MRhYms+6xQVhERPGNAPOHshN0F5ZLgiT7jrBiYwUPBP vXOpSg0fjuin5LV315t/YgapeHNpqFNhTohezab0YMYOQMGNlql4NMgvD7BZ1XLyiAEG j5lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680253856; 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=h5CSdrZ6l2xgXTKH1xLlq+jBgcd46ofV0BIoXJ6/6jM=; b=bOVaIQh+dAqWbuncmsz4yRxMOJ8cDiF6Mo+br7CbYOA1VsUJPggomu5h1MgU2lPT3k P9zbapzsGYm5AVukTNXc2P/BWhGKN3M/rLH8mByEt87s0mpGn47uUQVZEAesLJKAoQK/ 85nyZrHlhnnYe/k/AWw7cU2Jx3ysexsTCQlKr9aiuBuWwmX8PDMquLoQwYo8rXFWh/Xx ToPtFA6+rd4FXXBmmfrhdzs/NfGWXjgbQ1MsCDTnvFhWpIoG43kvzabcunmtZ5ed2b0t nv7CHk/TZxEBYvFzbnKsmIlBbnM1C7AVmLRphqi7W4yB5lTwOycSUHylKmX4JelEbyq6 i20Q== X-Gm-Message-State: AAQBX9ejLwYR1CFqoI6gLNfpwdmWXS2Xt0wXvo5crIrnoiva8yQFJt8d MuCDsDOXdGBJX8/vTYpBc5laDHUsQJZftHmrfpqfzQ== X-Received: by 2002:a81:b388:0:b0:545:8202:bbcf with SMTP id r130-20020a81b388000000b005458202bbcfmr12463339ywh.9.1680253856716; Fri, 31 Mar 2023 02:10:56 -0700 (PDT) MIME-Version: 1.0 References: <20230327121317.4081816-1-arnd@kernel.org> <20230327121317.4081816-18-arnd@kernel.org> In-Reply-To: <20230327121317.4081816-18-arnd@kernel.org> From: Linus Walleij Date: Fri, 31 Mar 2023 11:10:44 +0200 Message-ID: Subject: Re: [PATCH 17/21] ARM: dma-mapping: use arch_sync_dma_for_{device,cpu}() internally To: Arnd Bergmann Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Vineet Gupta , Russell King , Neil Armstrong , 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,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 2:16=E2=80=AFPM Arnd Bergmann wro= te: > From: Arnd Bergmann > > The arm specific iommu code in dma-mapping.c uses the page+offset based > __dma_page_cpu_to_dev()/__dma_page_dev_to_cpu() helpers in place of the > phys_addr_t based arch_sync_dma_for_device()/arch_sync_dma_for_cpu() > wrappers around the. Broken sentence? > In order to be able to move the latter part set of functions into > common code, change the iommu implementation to use them directly > and remove the internal ones as a separate interface. > > As page+offset and phys_address are equivalent, but are used in > different parts of the code here, this allows removing some of > the conversion but adds them elsewhere. > > Signed-off-by: Arnd Bergmann Looks good to me, took me some time to verify and understand the open-coded version of PFN_UP() and this refactoring alone makes the patch highly valuable. Reviewed-by: Linus Walleij Yours, Linus Walleij