Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4839393imj; Wed, 13 Feb 2019 01:53:50 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ/53d9Ms8t2zHYj8sR1PXi5eQqYTLlQSp2bOl45umMb63IM7VhexdisaNhOyX443bRUBvT X-Received: by 2002:a63:2ccd:: with SMTP id s196mr8120034pgs.194.1550051630572; Wed, 13 Feb 2019 01:53:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550051630; cv=none; d=google.com; s=arc-20160816; b=xAFenK2aScBpJfB4cJriF2xowhfSRvC3UHVIe0F99WukCCvHHnYfhUH8AB04T3b3V8 ypRqIBdozb30+4wf9+XgNnUYzt3Xz6+Rz5ubgcW1HrsH7k95/rrABjnEE1Dlj6eqSAWo F4emNL9wBV5s4zTK8UjkVOPMpfn4FesIJLHm8K/2rQYT/Qq0tpMi8aV6H/hJwRx+Tuq8 +DuOCMk6Yar12mTTYaSbayrPPU2NQBVN/StbWFKZOgCtM7+1Xb/dChlMI2J1fffeybhK O6SxPtM4HVW49ZB3scIOSOFyFHAmfmACrzG7LHzlO54aIGLBnbennRokasdGCwSlnfYz WoLQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=deIo4waZ4Tvrtcfo/8rp2UNAq5cX4H01UYLCap4CyU8=; b=Q4Z4Y/jvrOm0F/sT8wmvQYSy5d94r8mzD2eZ0S+T0Fvtz3M3L4JTyiKfIgB7qj+huH EnRpPaN3JSALJDRGSkCofx7ejqmNS5aosVwiBZF8JN24AWXeGJPVYiJYLXUXjUXsKW3L 0rdvxdVH/lKEFc6I7vNKIQVE9Wy+YBAQhI3iHqAky8P5sDx1c2LdoF/82TXVqUaRHSaE ciVeMht72xvEEIcTY3epcRgSIY9WL9DZ4beOTMZpzfIjSK4yvqRg9Yj5Pny5f1d63MEi DOxIhnFtqSvbQLYmsbRKxs14oLY5U1UOH3metmPmaEYp/YmX91PiL57C9yI2wozhIRwy xCaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Ha8HlbjR; 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 a18si15419621plm.75.2019.02.13.01.53.35; Wed, 13 Feb 2019 01:53:50 -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=Ha8HlbjR; 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 S2388080AbfBMHCW (ORCPT + 99 others); Wed, 13 Feb 2019 02:02:22 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:51054 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387517AbfBMHCU (ORCPT ); Wed, 13 Feb 2019 02:02:20 -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:References:In-Reply-To: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:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=deIo4waZ4Tvrtcfo/8rp2UNAq5cX4H01UYLCap4CyU8=; b=Ha8HlbjRNGN3NvehSoklkkWai1 tBEvQ91haxXzseIP5Sl+v2l/hoHeatAJDTOCUjK4DyNH71UgwIPDbuhHKKDOK/OvekiUuOdnWzOPJ S5aJb3mc6tRqZzgzg4Dx2etFIvnWKDruux8W+RDF/Al09InX4tCgMeeI9Ly4jHJi8knwVG+P8zfr4 08nxRVOk5smjUC5jAk03SKDwvOBSZS4ulyBCZPFGwBNqOeTpdVV57pcRJpLWgto3KejmJHItGHYpd Sb7+qvp/ox0nNVF6rgRLpmLvEF/CEAzUzPVanO5ddisUCokzjxhoDuT/AdrmvgvOA+H9tJ5Jnu1dR Urq5XupA==; 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 1gtoYZ-0000Ji-Sz; Wed, 13 Feb 2019 07:02:08 +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, Christian Zigotzky Subject: [PATCH 14/32] powerpc/dma: stop overriding dma_get_required_mask Date: Wed, 13 Feb 2019 08:01:15 +0100 Message-Id: <20190213070133.11259-15-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190213070133.11259-1-hch@lst.de> References: <20190213070133.11259-1-hch@lst.de> 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 The ppc_md and pci_controller_ops methods are unused now and can be removed. The dma_nommu implementation is generic to the generic one except for using max_pfn instead of calling into the memblock API, and all other dma_map_ops instances implement a method of their own. Signed-off-by: Christoph Hellwig Tested-by: Christian Zigotzky --- arch/powerpc/include/asm/device.h | 2 -- arch/powerpc/include/asm/dma-mapping.h | 2 -- arch/powerpc/include/asm/machdep.h | 2 -- arch/powerpc/include/asm/pci-bridge.h | 1 - arch/powerpc/kernel/dma.c | 29 -------------------------- kernel/dma/mapping.c | 2 -- 6 files changed, 38 deletions(-) diff --git a/arch/powerpc/include/asm/device.h b/arch/powerpc/include/asm/device.h index 1aa53318b4bc..3814e1c2d4bc 100644 --- a/arch/powerpc/include/asm/device.h +++ b/arch/powerpc/include/asm/device.h @@ -59,6 +59,4 @@ struct pdev_archdata { u64 dma_mask; }; -#define ARCH_HAS_DMA_GET_REQUIRED_MASK - #endif /* _ASM_POWERPC_DEVICE_H */ diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 1d80174db8a4..dc7f7bcdf65d 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h @@ -112,7 +112,5 @@ static inline void set_dma_offset(struct device *dev, dma_addr_t off) #define HAVE_ARCH_DMA_SET_MASK 1 -extern u64 __dma_get_required_mask(struct device *dev); - #endif /* __KERNEL__ */ #endif /* _ASM_DMA_MAPPING_H */ diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 8311869005fa..7b70dcbce1b9 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h @@ -47,9 +47,7 @@ struct machdep_calls { #endif #endif /* CONFIG_PPC64 */ - /* Platform set_dma_mask and dma_get_required_mask overrides */ int (*dma_set_mask)(struct device *dev, u64 dma_mask); - u64 (*dma_get_required_mask)(struct device *dev); int (*probe)(void); void (*setup_arch)(void); /* Optional, may be NULL */ diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index d7492dca6599..236a7460b6ec 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h @@ -46,7 +46,6 @@ struct pci_controller_ops { #endif int (*dma_set_mask)(struct pci_dev *pdev, u64 dma_mask); - u64 (*dma_get_required_mask)(struct pci_dev *pdev); void (*shutdown)(struct pci_controller *hose); }; diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index e5db4d3f8bea..0d52107b90f0 100644 --- a/arch/powerpc/kernel/dma.c +++ b/arch/powerpc/kernel/dma.c @@ -318,35 +318,6 @@ int dma_set_mask(struct device *dev, u64 dma_mask) } EXPORT_SYMBOL(dma_set_mask); -u64 __dma_get_required_mask(struct device *dev) -{ - const struct dma_map_ops *dma_ops = get_dma_ops(dev); - - if (unlikely(dma_ops == NULL)) - return 0; - - if (dma_ops->get_required_mask) - return dma_ops->get_required_mask(dev); - - return DMA_BIT_MASK(8 * sizeof(dma_addr_t)); -} - -u64 dma_get_required_mask(struct device *dev) -{ - if (ppc_md.dma_get_required_mask) - return ppc_md.dma_get_required_mask(dev); - - if (dev_is_pci(dev)) { - struct pci_dev *pdev = to_pci_dev(dev); - struct pci_controller *phb = pci_bus_to_host(pdev->bus); - if (phb->controller_ops.dma_get_required_mask) - return phb->controller_ops.dma_get_required_mask(pdev); - } - - return __dma_get_required_mask(dev); -} -EXPORT_SYMBOL_GPL(dma_get_required_mask); - static int __init dma_init(void) { #ifdef CONFIG_IBMVIO diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index a11006b6d8e8..40c0af744692 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -207,7 +207,6 @@ int dma_mmap_attrs(struct device *dev, struct vm_area_struct *vma, } EXPORT_SYMBOL(dma_mmap_attrs); -#ifndef ARCH_HAS_DMA_GET_REQUIRED_MASK static u64 dma_default_get_required_mask(struct device *dev) { u32 low_totalram = ((max_pfn - 1) << PAGE_SHIFT); @@ -238,7 +237,6 @@ u64 dma_get_required_mask(struct device *dev) return dma_default_get_required_mask(dev); } EXPORT_SYMBOL_GPL(dma_get_required_mask); -#endif #ifndef arch_dma_alloc_attrs #define arch_dma_alloc_attrs(dev) (true) -- 2.20.1