Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4866409imm; Tue, 9 Oct 2018 06:29:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV62onMgSO7AN1OLR15QBpqLkklniRwugc40aInkmUjSnDjdfqP7Ll+1U1jb0vvdl3dG44n7y X-Received: by 2002:a17:902:187:: with SMTP id b7-v6mr28912834plb.150.1539091764849; Tue, 09 Oct 2018 06:29:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539091764; cv=none; d=google.com; s=arc-20160816; b=j4D9FWatREt4RKEG5EEgGacCiSxtIxQdsjIwVorMwi+iFRAPKhu62+l/3yvzZBaqPS kmHdb7CYMk2bEMim1kFiGbMJP7GapsAne9lvkwN/KSDy7NE4kdEA6Ie4mBXpE+P/AA8g r8SsgkrJPWahSsv3Cxp8dqJbc7H4D5RsWcSmFILVwGvXbnkYC3jwi4jYUNzCdgUg0vt0 TUjISmjiw9Yw7qM/7Onxy+S0NwCsMNjOY4c0mNznOLyaTgCnrjhRK3nGayOov+9OADF6 URn4C/cncvDSUAPjSdCOVJN89IkL8EHSmMiV6GVgk5MK2Y+ZI44hXqiN/jm5infVgdbO N0gg== 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=GyWd0Lo9AxD2VefpnzNk6M6Gl77/Y8uKx1+B97yGPx0=; b=SN7KO06CDH0g6CeHkz+2MfVWQecMRgFIgCu0g4swMYE6u7SFsKx2oH5kBdxfKVCDP9 ugb9yYHwJ7ZOL47WCFRgiseDcLlwTyjtyQTYuojV4DpB3JXNUJnLpjwtEyDXV41qtRLn qFb9ed4bxPvb7OZJar3z8xPoVAsgMAhHIDRcjIwg1xwZxOQjckdh5gpq/RGifEHLwe7O McHCKeGqiDLb1OziSlQ+GWHgUt77TNuhxJJ+OquemEoDbulYHvJv8+3JrHj6Qwk5pAvv /6H2e+Cb0+NES0bsVeez6neF0Crd+8W2pkRkYqsgybxLI5qMMgDB1s3ZBoC3Jzh5sKSK CDiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=BMOV8qXB; 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 e17-v6si17698226pgv.54.2018.10.09.06.29.10; Tue, 09 Oct 2018 06:29:24 -0700 (PDT) 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=BMOV8qXB; 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 S1727608AbeJIUnP (ORCPT + 99 others); Tue, 9 Oct 2018 16:43:15 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:49778 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726496AbeJIUnP (ORCPT ); Tue, 9 Oct 2018 16:43:15 -0400 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=GyWd0Lo9AxD2VefpnzNk6M6Gl77/Y8uKx1+B97yGPx0=; b=BMOV8qXB41wC4W8/bbi3aYrijK TlI8/2FhwFlmlxnQQrJh6ZE76liyoTcn7el9pv24SU+6iiDV3Kxc0mHG1f9i0ZbSqOhURcKDWewm1 EfRV03cAbTTLgrvv68mqwEf2F91FqHyCjkzumggZTr5SaQhp0xu6LzuXQk6O3N9cCtPR9FlPiXjQY jVJa9JtYvg6KDlPdcWHczJYiwuJJ3Apu0rvzMvW55b//86+oeHpZIyefr6QbhhFb26WuEmzm9O1P7 szFvBivrpmQun3tvnXcED0SxsLghN8ErfOU46mqp0rhhUc8snhrlztJCfXcvALdRDcUcrOT5Dqe2X XQPYiDyQ==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g9s1O-0001OL-GI; Tue, 09 Oct 2018 13:25:58 +0000 From: Christoph Hellwig To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, iommu@lists.linux-foundation.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 22/33] powerpc/dma: move pci_dma_dev_setup_swiotlb to fsl_pci.c Date: Tue, 9 Oct 2018 15:24:49 +0200 Message-Id: <20181009132500.17643-23-hch@lst.de> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181009132500.17643-1-hch@lst.de> References: <20181009132500.17643-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 --- 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 93a4622563c6..60cb86338233 100644 --- a/arch/powerpc/kernel/dma-swiotlb.c +++ b/arch/powerpc/kernel/dma-swiotlb.c @@ -63,17 +63,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.19.0