Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4840628imj; Wed, 13 Feb 2019 01:55:44 -0800 (PST) X-Google-Smtp-Source: AHgI3IZHHquf4r8v6nHFlX0Djl1cAa+jc/lHCme8UYiymomchrO7LpHzl+UvoGxZtXnfjP045T1W X-Received: by 2002:a17:902:b114:: with SMTP id q20mr8954460plr.48.1550051744866; Wed, 13 Feb 2019 01:55:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550051744; cv=none; d=google.com; s=arc-20160816; b=cL1YFCTKa3D75rGLk/eZ22P8f9B88x4gfABSqaFaDzdJUEzaAdAx+GbvO+xWd2T68f bP1qjvOToNwfN1H5+qD2jhG4MjeXGQkrQCBeFiE5lFg/rmfHesm7zgeT1pKx/mgT8eud qHHXvtEySj6vrlIw623DJvpolEDmx+OGdWvduJtUuwCagqYsoOgpgthtDXVWL+NKmU3+ 8JYyYPeoGLu87+qTZIIP8UTmkQFlu+Mai4CtajjLdaZjLqtJ7CJmqRI+4gGTlgHeBrWP 9N8OhM9U8fZzyaID8F7YTXHZVRpaE3lMtb877/NEYjBsmossfn1j7IwgYZS6dun1XzbX WyWA== 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=RaKPsZhf3yAc9nFYtHooUoGz8Tz8ZdSiCAVQhnBhHSE=; b=aIp/IrxOjg3TAcIPd4rQsaKF2wJu6FePJ6kj4ycDnVwC7nxY8be01JkBRfa8d8YMOO +hN9HEpmIqT9CkAZ/BfQGNkrqTsduU5zxiekJbAFSX4Nb9ULPfarsvTCJXPFe1itqbBl r7UWoLQlc1uRaHbGj7FeUJAvOhekFbxaabW0nouPza2XwiUvCcCVQmXLTV5e9mZRIGhh +XJD8qmLudQS/Ko7bE4GXBuT3www0YthI9zHA1K072T60Wb7faUzTjUaVYfCxnacnkuq NjVwmIQD/JN7XTJL9oIAua5g8bd2UfxHnrxDgMyMaAR8Lq4rADYkBPj83MYMKated3CF f+iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=uNpPugCU; 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.55.29; Wed, 13 Feb 2019 01:55:44 -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=uNpPugCU; 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 S2388700AbfBMHCn (ORCPT + 99 others); Wed, 13 Feb 2019 02:02:43 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:51230 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388576AbfBMHCj (ORCPT ); Wed, 13 Feb 2019 02:02:39 -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=RaKPsZhf3yAc9nFYtHooUoGz8Tz8ZdSiCAVQhnBhHSE=; b=uNpPugCUs6hfFHEHFuesjWiBfy jpRQnCgGGCbE3MXMBI1GA07nLrgIaDjrjAJ8sYivhtvntNwriL2r3tyAHiMV6nSm76QaOzGEtezzN A9nVOufigevM2Aww2Zszvgj1uoK4JEvIRkfQIgcW5WYm2WvVKzhdOJA8RGnjLbtiYfIYRBY2U/EZm Zl2FfJq34T7TJY68/LW99atG/wZvfASQ6TA3czVk0rgZLtJF8HA0FESKUcUS1IxH4uhwrG0d/x7Z9 Oe7jPkkvOErlGimekmfD59pR4+bFQ0jALPUVu0stMhT4553FxIKWNlucSYkyvFHfkdJwD3j0QfDEs S0qQcfFQ==; 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 1gtoYj-0000ND-JO; Wed, 13 Feb 2019 07:02:17 +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 18/32] powerpc/dma: move pci_dma_dev_setup_swiotlb to fsl_pci.c Date: Wed, 13 Feb 2019 08:01:19 +0100 Message-Id: <20190213070133.11259-19-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 pci_dma_dev_setup_swiotlb is only used by the fsl_pci code, and closely related to it, so fsl_pci.c seems like a better place for it. Signed-off-by: Christoph Hellwig Tested-by: Christian Zigotzky --- arch/powerpc/include/asm/swiotlb.h | 2 -- arch/powerpc/kernel/dma-swiotlb.c | 11 ----------- arch/powerpc/sysdev/fsl_pci.c | 9 +++++++++ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/include/asm/swiotlb.h b/arch/powerpc/include/asm/swiotlb.h index f65ecf57b66c..26a0f12b835b 100644 --- a/arch/powerpc/include/asm/swiotlb.h +++ b/arch/powerpc/include/asm/swiotlb.h @@ -18,8 +18,6 @@ extern const struct dma_map_ops powerpc_swiotlb_dma_ops; extern unsigned int ppc_swiotlb_enable; int __init swiotlb_setup_bus_notifier(void); -extern void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev); - #ifdef CONFIG_SWIOTLB void swiotlb_detect_4g(void); #else diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c index 7d5fc9751622..42badc4bf536 100644 --- a/arch/powerpc/kernel/dma-swiotlb.c +++ b/arch/powerpc/kernel/dma-swiotlb.c @@ -62,17 +62,6 @@ const struct dma_map_ops powerpc_swiotlb_dma_ops = { .get_required_mask = swiotlb_powerpc_get_required, }; -void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev) -{ - struct pci_controller *hose; - struct dev_archdata *sd; - - hose = pci_bus_to_host(pdev->bus); - sd = &pdev->dev.archdata; - sd->max_direct_dma_addr = - hose->dma_window_base_cur + hose->dma_window_size; -} - static int ppc_swiotlb_bus_notify(struct notifier_block *nb, unsigned long action, void *data) { diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 918be816b097..561f97d698cc 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -114,6 +114,15 @@ static struct pci_ops fsl_indirect_pcie_ops = static u64 pci64_dma_offset; #ifdef CONFIG_SWIOTLB +static void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev) +{ + struct pci_controller *hose = pci_bus_to_host(pdev->bus); + struct dev_archdata *sd = &pdev->dev.archdata; + + sd->max_direct_dma_addr = + hose->dma_window_base_cur + hose->dma_window_size; +} + static void setup_swiotlb_ops(struct pci_controller *hose) { if (ppc_swiotlb_enable) { -- 2.20.1