Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4838961imj; Wed, 13 Feb 2019 01:53:18 -0800 (PST) X-Google-Smtp-Source: AHgI3IaCKs/OxZDM1RpjH+iSJJTDHTtjmxj+U7cB6+dyPtNGKtlRUvJ4N1s2uKpkKOUuCbe9cRRC X-Received: by 2002:a62:ea09:: with SMTP id t9mr9172568pfh.228.1550051598576; Wed, 13 Feb 2019 01:53:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550051598; cv=none; d=google.com; s=arc-20160816; b=GtjzGFUVEedctrC4Tac2HA65nKwKCj/cQDbMgA4HqkzNaTOsjmh29IKmmKzltL9ya0 Oi5r5qUD0EqOzSNmEYk1aAZivsGvzppuYZxA9OeW9xOylGwjHoJGA+tq4Aq5JyutfXaG CHuGkzLo9ufAqlq7ZKurHxcSSl6niEm8oLUlxmDkFVS717fHg2vsBd/UFKSVkkQfbNSa ugwBaC9CXY2WbDWfbjDNMrfd22rQ8xdhelH2d6ZyyUX5QqmXRAlPu/kWKfIBM7lCOTFE GAy5lXoeko4PbKsHCmqQvjc7XIl9faaWe6d5uHxwFYpkwMcMaHxh7FGw+h23Zk/imhec zW2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=8ZZTvJaPw8PfKadwYBXqBlltfSltHnwtr+g4DE3dCCY=; b=nS2zdaVFPFnsrDc5Q2AMFxEKX7wkeGUlCltapQpdQ1Rgv8rb6qV2Cf6tj+qw9sLaMV TMNSrpdoxXdS96JtB/+DZZQAfZEu/qr4mDBPXrA81GYOYcKO2lFiyRYLcEsf0Zl3hsaq XO6ZWD5Cmyc+ffT8L0C33rx0WAtBqlviqhjG/y5jIONSZnnEcCNGFuTqbvsrhg3Vddq5 MeE6ix5TUkv4fUN+RSA6Wtvxy1mKkJTQ8e36d1tYM1tVYTmahLuzjfeAHV7c6Yf0Twke dZn7vnlsY8TU9T0GhycjviNHPJnay5CtzkKctIoDh48TD/9RUOdg/9eocxX+HjNFpVVH YHtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rRNSYcyM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n5si7635464pfn.219.2019.02.13.01.53.02; Wed, 13 Feb 2019 01:53:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rRNSYcyM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732555AbfBMHCG (ORCPT + 99 others); Wed, 13 Feb 2019 02:02:06 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:50896 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729649AbfBMHCG (ORCPT ); Wed, 13 Feb 2019 02:02:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8ZZTvJaPw8PfKadwYBXqBlltfSltHnwtr+g4DE3dCCY=; b=rRNSYcyMxmzDkNMx3oHrGcp/n pPD8CE++qGNHThZhR2Nr5HJEJEX4kXXKD8lsKOKFs3JiQ0Ga/ainxJiqQpPoC204MNm+MdxpaT25W 7+rDdIygaB9sa2Bzvi0JG0+DWS+0FWywolTlDWaO+XE582h2uzm5dSZwDnUMa4iHxUq80LIpMuTnw Gg3BFCESqYr/p4+vvQbCiAVzaLZAgrZFJ480p8lEtUeWflW2BN2BFMWewLH4zeqTRoKuaWrPX0MtS 6mp5sSpTMhiJm377UoTKDchRIsxFZfQ7fHo69A5xnchljYxfHX2BsicFiXrnVZ5jgHmN9q66Dewr5 +XHpoL9eQ==; Received: from 089144210182.atnat0019.highway.a1.net ([89.144.210.182] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtoY2-0000Ej-3Z; Wed, 13 Feb 2019 07:01:34 +0000 From: Christoph Hellwig To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Olof Johansson Cc: linuxppc-dev@lists.ozlabs.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: use generic DMA mapping code in powerpc V7 Date: Wed, 13 Feb 2019 08:01:01 +0100 Message-Id: <20190213070133.11259-1-hch@lst.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, this series switches the powerpc port to use the generic swiotlb and noncoherent dma ops, and to use more generic code for the coherent direct mapping, as well as removing a lot of dead code. As this series is very large and depends on the dma-mapping tree I've also published a git tree: git://git.infradead.org/users/hch/misc.git powerpc-dma.7 Gitweb: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.7 Thanks a lot to Christian Zigotzky who spent a lot of time testing iterations on pasemi and FSL boards! Changes since v4: - rebased on top of the latests powerpc/next tree - fix the DART IOMMU bypass selection - remove the return value from arch_dma_set_mask, which was done incorrectly and isn't actually needed. - add a new patch to remove swiotlb_dma_supported - add a new patch to set a dma mask in the pasemi ethernet driver, given that we now validate it - add a new patch to fix a ZONE_DMA32 assumption in the dma-direct patch - split up a few patches to improve bisectability (v5 and v6 were never posted) Changes since v3: - rebase on the powerpc fixes tree - add a new patch to actually make the baseline amigaone config configure without warnings - only use ZONE_DMA for 64-bit embedded CPUs, on pseries an IOMMU is always present - fix compile in mem.c for one configuration - drop the full npu removal for now, will be resent separately - a few git bisection fixes The changes since v1 are to big to list and v2 was not posted in public. arch/powerpc/kernel/dma.c | 362 ------------------------ b/arch/powerpc/Kconfig | 5 b/arch/powerpc/include/asm/device.h | 10 b/arch/powerpc/include/asm/dma-direct.h | 18 - b/arch/powerpc/include/asm/dma-mapping.h | 92 ------ b/arch/powerpc/include/asm/iommu.h | 17 + b/arch/powerpc/include/asm/machdep.h | 4 b/arch/powerpc/include/asm/pci-bridge.h | 5 b/arch/powerpc/include/asm/pci.h | 2 b/arch/powerpc/include/asm/pgtable.h | 1 b/arch/powerpc/include/asm/swiotlb.h | 5 b/arch/powerpc/kernel/Makefile | 3 b/arch/powerpc/kernel/dma-iommu.c | 75 ++++ b/arch/powerpc/kernel/dma-mask.c | 12 b/arch/powerpc/kernel/dma-swiotlb.c | 89 ----- b/arch/powerpc/kernel/pci-common.c | 10 b/arch/powerpc/kernel/setup-common.c | 1 b/arch/powerpc/mm/dma-noncoherent.c | 40 +- b/arch/powerpc/mm/mem.c | 22 - b/arch/powerpc/platforms/44x/ppc476.c | 1 b/arch/powerpc/platforms/44x/warp.c | 2 b/arch/powerpc/platforms/85xx/corenet_generic.c | 5 b/arch/powerpc/platforms/85xx/ge_imp3a.c | 2 b/arch/powerpc/platforms/85xx/mpc8536_ds.c | 2 b/arch/powerpc/platforms/85xx/mpc85xx_ds.c | 4 b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | 4 b/arch/powerpc/platforms/85xx/p1010rdb.c | 1 b/arch/powerpc/platforms/85xx/p1022_ds.c | 2 b/arch/powerpc/platforms/85xx/p1022_rdk.c | 2 b/arch/powerpc/platforms/85xx/qemu_e500.c | 1 b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 1 b/arch/powerpc/platforms/Kconfig.cputype | 3 b/arch/powerpc/platforms/cell/iommu.c | 172 +---------- b/arch/powerpc/platforms/pasemi/iommu.c | 2 b/arch/powerpc/platforms/pasemi/setup.c | 51 --- b/arch/powerpc/platforms/powernv/npu-dma.c | 2 b/arch/powerpc/platforms/powernv/pci-ioda.c | 132 +------- b/arch/powerpc/platforms/pseries/iommu.c | 99 +----- b/arch/powerpc/platforms/pseries/vio.c | 95 ++---- b/arch/powerpc/sysdev/dart_iommu.c | 58 +-- b/arch/powerpc/sysdev/fsl_pci.c | 25 - b/drivers/misc/cxl/vphb.c | 3 b/drivers/net/ethernet/pasemi/pasemi_mac.c | 1 b/include/linux/swiotlb.h | 3 b/kernel/dma/Kconfig | 3 b/kernel/dma/direct.c | 3 b/kernel/dma/mapping.c | 11 b/kernel/dma/swiotlb.c | 12 48 files changed, 317 insertions(+), 1158 deletions(-)