From patchwork Wed Nov 14 08:23:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10682165 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43BF7139B for ; Wed, 14 Nov 2018 08:25:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38A2D2A654 for ; Wed, 14 Nov 2018 08:25:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C9092B020; Wed, 14 Nov 2018 08:25:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 937452A654 for ; Wed, 14 Nov 2018 08:25:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B9E76B02A0; Wed, 14 Nov 2018 03:25:00 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0F9006B02A2; Wed, 14 Nov 2018 03:25:00 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF1E06B02A3; Wed, 14 Nov 2018 03:24:59 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by kanga.kvack.org (Postfix) with ESMTP id 897336B02A0 for ; Wed, 14 Nov 2018 03:24:59 -0500 (EST) Received: by mail-pg1-f200.google.com with SMTP id r16so10118438pgr.15 for ; Wed, 14 Nov 2018 00:24:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=cGKlbU+oXvVAhC9QKwibc5KJRN1/gP8lP8pMNbJHI/s=; b=BDMF7sW7ItLHwUeaUW6dKTzAZJY8z8rCIRne/Gl+VkbLkF0/3uyzUWL0RR9fTi5zcC z0OwQkoPB/fUWSpqBc6TIxXHgzngZcYofw9Z1sP+DMaJdwGQiJTH1IuNs/DKbpheDfCd V9pn5E0fWKEJ9xrUC8H6ub9teHmQpnwFn5nW3srblQ89jIAoG3iq8cHWOacTITNcm8CQ nHEiFXTrx93B/hr4+cGh9+LbgkoTUmNYNM1oHIIoOKfMavd1jYthBRttVzfxoSeKSf/7 ahv+UPVtNR5E+7lW/XEpdZb/ymiBygosmEhjVVb5xdkEriaQNSZTOXUumFL7gdH1j772 NMrA== X-Gm-Message-State: AGRZ1gL18DtF3pWdeDzM0J+JrL0/BAnRgtnxtXR2MhmtXdHUnHGoYUKI rQU+9bpRd3V0T4WE5KYVhzoTkNwK+RpRA1jKOEcAJnt8e9db9f53JahCumvz6vmUV66LihbHm9l pQjqHdjZNmnbDs/f6WjMQcSN5Hs6F3qjH6/vVz3it8nRd8em9mgqOC4Jw+c8sVbs= X-Received: by 2002:a65:65c9:: with SMTP id y9mr905901pgv.438.1542183899219; Wed, 14 Nov 2018 00:24:59 -0800 (PST) X-Google-Smtp-Source: AJdET5cyD0t8qFV59//Ok9noJKP/2QSZZYZzZeh2z0Q4IYuBRTerfHMIZkpZoEgIiKk99pFDSvlO X-Received: by 2002:a65:65c9:: with SMTP id y9mr905878pgv.438.1542183898467; Wed, 14 Nov 2018 00:24:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542183898; cv=none; d=google.com; s=arc-20160816; b=VMvngEKB/XJ/UdrB+u94FXhGjsL+a5YemkVb8tZeki2lTQXLjXlwBzNR0y4hS2V3ye g26JupgJCEmufn9MsFkt/1wfwMOwMLHcDsy57nMMBdhFaeoz2a8RF6xgIQeInU2/wpRk oI2uOOBhipBgwI3RpgyCCw0rRePkTP5wNoeRzkbsqqfQMugUz0KUdqDP39hO/wJBBLLC AIIQHrw9TdmIG/PiscY3p7ecDspfw/SGhYUm+eOStt2LlKOJPqj4qRfZEWWCkrJLFUD5 vpN+It+bzUMXd704yn1DgOdIi1aSkHUuHFd5fcqLyrgIG2/T/JPZBFYw6sK0K7B7ns0Y ZeuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=cGKlbU+oXvVAhC9QKwibc5KJRN1/gP8lP8pMNbJHI/s=; b=K50yxJpg2Iuxrw2gWbiUVx895vGqE5EGoUL7d2KKgbU8UM9iFnviMRIkXf6ZRAr01g wYt/ANSp9WGAEfPasAKU1JklICERhRmKtPvvSXtqT0NsS4GlJDFWtcSmOJU3oFBfNLCA /u0vrckLp5r2tQcTsNIQtkaFZ0ynLCBf+RKjfy62jr8pKFkWqN/TeRN274mZc/s8+W2T uTNbatDKYLg9nmjCdIxHCZxtzGkAI0LSV+jPMTygs2qLIbb7259LVQ3iJQpF5c+LcpoV QovpqwZPpE3lor3c/+tGUbTWg3uC4hrrvjkf6tj6wT+jkYyKjY+BreLWXc/It8yY/mWy NA3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=uBHwx7q1; spf=pass (google.com: best guess record for domain of batv+ddbc6e1cf1a82b64ebec+5561+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+ddbc6e1cf1a82b64ebec+5561+infradead.org+hch@bombadil.srs.infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id a61-v6si26097445pla.430.2018.11.14.00.24.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Nov 2018 00:24:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of batv+ddbc6e1cf1a82b64ebec+5561+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=uBHwx7q1; spf=pass (google.com: best guess record for domain of batv+ddbc6e1cf1a82b64ebec+5561+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+ddbc6e1cf1a82b64ebec+5561+infradead.org+hch@bombadil.srs.infradead.org 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=cGKlbU+oXvVAhC9QKwibc5KJRN1/gP8lP8pMNbJHI/s=; b=uBHwx7q1acfmjD/ZLBF1dylHjd inhGc1Qt0pHe8F6EN1uMv1mJnvAWhG/BCPCdkVxdznQpiyR74bN7A9fBaG42cYcaD5hRY/hilfGYq Mbn3AiXZpa5LhBfqTbbDZN8IeT3+J6C3CMlljhcWOCQxtxhQy1RdMNfr9yDoonbDSlau3slibb6gI +b1c/EWwG6UWdrBvC16xYmF1f2TMmywSbgoo5T+jSypezJ9gbJsolvz88A2RMUZDT07OBaAmGP+86 8pPJsX5700ZGCt73NfA6EDDONlesXd+TWyEvOT5qi8DS6py2eotw1JVdWFx8fzeACkufQIqeHSJG/ o4WTcM3w==; Received: from 089144211136.atnat0020.highway.a1.net ([89.144.211.136] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMqTh-0005Bc-Lf; Wed, 14 Nov 2018 08:24:50 +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 34/34] powerpc/dma: trim the fat from Date: Wed, 14 Nov 2018 09:23:14 +0100 Message-Id: <20181114082314.8965-35-hch@lst.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181114082314.8965-1-hch@lst.de> References: <20181114082314.8965-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP There is no need to provide anything but get_arch_dma_ops to . More the remaining declarations to and drop all the includes. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h | 29 ------------------- arch/powerpc/include/asm/iommu.h | 10 +++++++ arch/powerpc/platforms/44x/ppc476.c | 1 + arch/powerpc/platforms/85xx/corenet_generic.c | 1 + arch/powerpc/platforms/85xx/qemu_e500.c | 1 + arch/powerpc/sysdev/fsl_pci.c | 1 + 6 files changed, 14 insertions(+), 29 deletions(-) diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index a59c42879194..565d6f74b189 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h @@ -1,37 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (C) 2004 IBM - * - * Implements the generic device dma API for powerpc. - * the pci and vio busses */ #ifndef _ASM_DMA_MAPPING_H #define _ASM_DMA_MAPPING_H -#ifdef __KERNEL__ - -#include -#include -/* need struct page definitions */ -#include -#include -#include -#include -#include - -static inline unsigned long device_to_mask(struct device *dev) -{ - if (dev->dma_mask && *dev->dma_mask) - return *dev->dma_mask; - /* Assume devices without mask can take 32 bit addresses */ - return 0xfffffffful; -} - -/* - * Available generic sets of operations - */ -#ifdef CONFIG_PPC64 -extern const struct dma_map_ops dma_iommu_ops; -#endif static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { @@ -43,5 +15,4 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) return NULL; } -#endif /* __KERNEL__ */ #endif /* _ASM_DMA_MAPPING_H */ diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h index 5128aac8e165..46a8d4716d90 100644 --- a/arch/powerpc/include/asm/iommu.h +++ b/arch/powerpc/include/asm/iommu.h @@ -332,5 +332,15 @@ extern bool iommu_fixed_is_weak; #define iommu_fixed_is_weak false #endif +extern const struct dma_map_ops dma_iommu_ops; + +static inline unsigned long device_to_mask(struct device *dev) +{ + if (dev->dma_mask && *dev->dma_mask) + return *dev->dma_mask; + /* Assume devices without mask can take 32 bit addresses */ + return 0xfffffffful; +} + #endif /* __KERNEL__ */ #endif /* _ASM_IOMMU_H */ diff --git a/arch/powerpc/platforms/44x/ppc476.c b/arch/powerpc/platforms/44x/ppc476.c index e55933f9cd55..a5e61e5c16e2 100644 --- a/arch/powerpc/platforms/44x/ppc476.c +++ b/arch/powerpc/platforms/44x/ppc476.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c index b0dac307bebf..0ea13697189e 100644 --- a/arch/powerpc/platforms/85xx/corenet_generic.c +++ b/arch/powerpc/platforms/85xx/corenet_generic.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff --git a/arch/powerpc/platforms/85xx/qemu_e500.c b/arch/powerpc/platforms/85xx/qemu_e500.c index 27631c607f3d..c52c8f9e8385 100644 --- a/arch/powerpc/platforms/85xx/qemu_e500.c +++ b/arch/powerpc/platforms/85xx/qemu_e500.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include "smp.h" diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 964a4aede6b1..9584765dbe3b 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include