Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4864386imm; Tue, 9 Oct 2018 06:27:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV60fueujxVpQqh2xIOzVDcdMlDwA0t9SvL+2ASEEhLal8BNCQQjfODMZaf+4qzkxz3liFJqH X-Received: by 2002:a62:e091:: with SMTP id d17-v6mr29670613pfm.214.1539091670212; Tue, 09 Oct 2018 06:27:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539091670; cv=none; d=google.com; s=arc-20160816; b=MaQbOwmHydvi7Zi5tK0ToCVSxfRfeLuna+LLdMFpxPFlbbOYhqaAkti4ivEzem9Y1H 20xioq61qml7QR4HF6IHgBZCWVpY29Zbq8+68DS3e5NjwVU2z7Ge4BqCnIuRT91ZIuXK oPG9PtbHX8vra0QsiGAtnLgmKGJ1GCC+JY/zY0EsmChMyhvwmx8040bOQZj28Eayb+xv Xqy/g1Lva2ZD+k/8bkNAJp8bYSAb501ULe40JTyMoLxq9cVQqNI6OsraacqjtJVXmZD4 7/TE/oyiraWNaTJHsx6iqsAAjJv2VichrL9righXwJ5n96ldLxocAHsqCan8mjGdbuZU IAIw== 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=K74mCYmVOLJRzyNfEnzhXh0UECbS5GU9R54tYFzJ4NQ=; b=HpF0hQ/jEwR+gFHM4qDlipP2BGozDOH4+dDLQd9l5mW71qkPQqneCFuanXQhHRrwa2 VMugLXThL+TkTHjoJFKK4sgkOeyqid0Oyxu7Z4JuH8TdRk/ribBbWX1YIBcxTGBKClVv ytJ2piA4cPXGVx44RjlecWxV81J9W4ePUeYVIQokysb58kqu+9rk5hMiuBV5EDkTyQg6 529JQuLorfdHh/Ox1C1oEjRGFJZ+N3woohnpxBDif3gzub6vaGJgrEjJ6aOID7RD5M0N YCNIutkyND57EHP14dhM+1JhK978UZGBQMJY9/Yv96e3Or2Zk9jZxcLNIQ6piY1xTLPn XSTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iOd+EwXl; 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 u22-v6si20614180pfn.111.2018.10.09.06.27.35; Tue, 09 Oct 2018 06:27:50 -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=iOd+EwXl; 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 S1728036AbeJIUnn (ORCPT + 99 others); Tue, 9 Oct 2018 16:43:43 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:50654 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726567AbeJIUnm (ORCPT ); Tue, 9 Oct 2018 16:43:42 -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=K74mCYmVOLJRzyNfEnzhXh0UECbS5GU9R54tYFzJ4NQ=; b=iOd+EwXl95eb2AVGqS8jW/oHlA QkWuS3BVe5xM5dRfwO5pKw3OUinJ8vhM5YMk+pEEpBFS9VSO7m7WMf10lNcIvi6uonCHXdg7g5cBg s9zDsXqxuWo5FyU3W4R5fvifHnciQwKfrG79vSVhNQVH5ICk0jcpJMEdNp4x6CeKZjppu6oqzAEYb QheWujtsqDMvaU3hVYwlEJt6sQ9tbBe4LNe+8RbEmrb+0vl0Wi0pxXCqrq6tN8DEVn3ADjm9t79Uz n6nbJtlxZjGdjvtMy8bVVoAmTtchZSCUPjY7Ye1mas5OKo/Sao130eS9Re9qXUqw8Rfyj/kNW8Odg BX+B971Q==; 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 1g9s1q-0001fX-WC; Tue, 09 Oct 2018 13:26:27 +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 33/33] powerpc/dma: trim the fat from Date: Tue, 9 Oct 2018 15:25:00 +0200 Message-Id: <20181009132500.17643-34-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 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 + 3 files changed, 11 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 264d04f1dcd1..db745575e6a4 100644 --- a/arch/powerpc/include/asm/iommu.h +++ b/arch/powerpc/include/asm/iommu.h @@ -334,5 +334,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 -- 2.19.0