Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4755950rdh; Wed, 29 Nov 2023 09:43:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFn1jCkyOrdYcqaT2tP8MMQP3KFRdgm2AbwAKlCK47ZS+Wgh91OykeIm6hyfEqclhCpYbrQ X-Received: by 2002:a05:6a00:3a04:b0:6cb:bc06:b058 with SMTP id fj4-20020a056a003a0400b006cbbc06b058mr20137357pfb.0.1701279820021; Wed, 29 Nov 2023 09:43:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701279820; cv=none; d=google.com; s=arc-20160816; b=BiLiEIRxALzHIbbgtZPtuidaXO+qaACsa64CyhCgDIrIeiO5nQhmfR5DrpeMJheDTg 1gknfkVHS4ZGkT5gfj+3H2xMm9ot7Vsv6j+vtcjiQfTYEsbiFqkRUhged3IfHP1WFW1j +K5tQRDm0gUiThekP52I4mT8AI1Y9O3exSiTotzXrkM8nO3sm52tJ9Y8KwIEKbSoRCrz blnd4QwobPg8oqrBKROIRwoP3fEhKxOPnVyCMNyLu3eFB2CZTD3C/M8iwPR36eh9zsTh pnEZ6PwMQRu6ZT7ToLDML/86mAfA6kwQLAlD2tfC0R1Kjxblo57eW+dwt0LXOzsUkTMa M8Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=w2UzGswL3dvdIh5CwduBSjWlS0OKkZSMdZ5ez0DqiDQ=; fh=GNBXEYaBv/m3jVEMpTGTRjnFoUB0WOii+EMJk4vaWPQ=; b=0Dg4pFhCmoiJMasEJv6ZOYLQ6O+PjqTmMIgJfi6ydBUoTT2WYYRRUX7XuSnwIR2HDq Ni0QC8pJJhk/+dQpx/dvo/wRM0ttcOp/GAmrBiQIN2+QH+8XlOJd9JD/A7InkHcYaI/W suJ0qPcfiGYb95cPWGoiyC4ivN1VBL9CrMo5xYRv16hj6N2Z3JXBfHwPPHX3oUM6ulpZ CyeR+5LPw2VTd55vtSSLQLlHPuKFCYFIowo+xwC9IicXYEDubRSt5w14JrkUqA4NSIWA DdsbJzuzCjAE+EQSi9IME7WMM1OtSmfl2jlfVI3+MbTC8KrJWOuVhzx4rzuvo8et8b94 Kdyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id j6-20020a056a00130600b006bd27e41c17si14430948pfu.314.2023.11.29.09.43.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 09:43:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id A925380BFEDF; Wed, 29 Nov 2023 09:43:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230432AbjK2RnP (ORCPT + 99 others); Wed, 29 Nov 2023 12:43:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbjK2RnP (ORCPT ); Wed, 29 Nov 2023 12:43:15 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 32D39F4; Wed, 29 Nov 2023 09:43:17 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8BBFBC15; Wed, 29 Nov 2023 09:44:03 -0800 (PST) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 81BF13F73F; Wed, 29 Nov 2023 09:43:12 -0800 (PST) From: Robin Murphy To: Joerg Roedel , Christoph Hellwig Cc: Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Paul Walmsley , Palmer Dabbelt , Albert Ou , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Suravee Suthikulpanit , David Woodhouse , Lu Baolu , Niklas Schnelle , Matthew Rosato , Gerald Schaefer , Jean-Philippe Brucker , Rob Herring , Frank Rowand , Marek Szyprowski , Jason Gunthorpe , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org Subject: [PATCH 0/7] dma-mapping: Clean up arch_setup_dma_ops() Date: Wed, 29 Nov 2023 17:42:57 +0000 Message-Id: X-Mailer: git-send-email 2.39.2.101.g768bb238c484.dirty MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 29 Nov 2023 09:43:34 -0800 (PST) Hi all, Prompted by Jason's proposal[1], here's a first step towards truly unpicking the dma_configure vs. IOMMU mess. As I commented before, we have an awful lot of accumulated cruft and technical debt here making things more complicated than they need to be, and we already have hacks on top of hacks trying to work around it, so polishing those hacks even further is really not a desirable direction of travel. And I do know they're hacks, because I wrote most of them and still remember enough of the context of the time ;) I'm taking a methodical bottom-up approach here, so step 1 is cleaning *all* the out-of-date stuff from arch_setup_dma_ops() and simplifying that interface, which gets it right out of the way for the next step of pulling apart {of,acpi}_dma_configure(). This part is really a dma-mapping series, but I'm not sure yet if would need to target the IOMMU tree - nothing here should strictly depend on the pending IOMMU change, but the follow-up patches might. Still working on those, so hopefully I'll know soon... Thanks, Robin. [1] https://lore.kernel.org/linux-iommu/0-v1-720585788a7d+811b-iommu_fwspec_p1_jgg@nvidia.com/ Robin Murphy (7): OF: Retire dma-ranges mask workaround OF: Simplify DMA range calculations ACPI/IORT: Handle memory address size limits as limits dma-mapping: Add helpers for dma_range_map bounds iommu/dma: Make limit checks self-contained iommu/dma: Centralise iommu_setup_dma_ops() dma-mapping: Simplify arch_setup_dma_ops() arch/arc/mm/dma.c | 3 +-- arch/arm/mm/dma-mapping-nommu.c | 3 +-- arch/arm/mm/dma-mapping.c | 12 ++++++---- arch/arm64/mm/dma-mapping.c | 5 +--- arch/loongarch/kernel/dma.c | 9 ++----- arch/mips/mm/dma-noncoherent.c | 3 +-- arch/riscv/mm/dma-noncoherent.c | 3 +-- drivers/acpi/arm64/dma.c | 17 ++++--------- drivers/acpi/arm64/iort.c | 18 +++++++------- drivers/acpi/scan.c | 3 +-- drivers/hv/hv_common.c | 6 +---- drivers/iommu/amd/iommu.c | 8 ------- drivers/iommu/dma-iommu.c | 35 ++++++++++----------------- drivers/iommu/dma-iommu.h | 6 +++++ drivers/iommu/intel/iommu.c | 7 ------ drivers/iommu/iommu.c | 2 ++ drivers/iommu/s390-iommu.c | 6 ----- drivers/iommu/virtio-iommu.c | 10 -------- drivers/of/device.c | 42 ++++++--------------------------- include/linux/acpi_iort.h | 4 ++-- include/linux/dma-direct.h | 18 ++++++++++++++ include/linux/dma-map-ops.h | 6 ++--- include/linux/iommu.h | 7 ------ 23 files changed, 78 insertions(+), 155 deletions(-) -- 2.39.2.101.g768bb238c484.dirty