Received: by 10.213.65.68 with SMTP id h4csp1416378imn; Mon, 19 Mar 2018 03:41:06 -0700 (PDT) X-Google-Smtp-Source: AG47ELuRGWkvXJAwq5z5jedN2EZtsSMHwKEuLLKJATLicx4E4OCf03ZUDUC5QIxSa3zLZHjbj5Ix X-Received: by 10.98.39.7 with SMTP id n7mr8182135pfn.161.1521456066572; Mon, 19 Mar 2018 03:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521456066; cv=none; d=google.com; s=arc-20160816; b=cHjvreO2H3z7eaQImCgT/CvhQFwNftc2eYWaduiShP390/nk7MpD4aCWq3uBZrXiVk 0m2wogXb/dPR9jd+YxTxtabt6O3q2I1CRKefHfRSZVufmsg6g2q7kG6RL8l1bpuB5kc5 d6UqDOSdZk5B4fLnmEFld9Xx8220kBTIywrN3rAfLONz8ntz218Ni1FHV9MTKz5+/1TW tDHeULR2l3MJpXVXLBX8dPRpbFFFhcGvDRCQMGfhg59mbwHwMjyG/xGDdcDLIW7XkeVm Tv6blPT2p/k03O4VXi/lB3EoimdHHKpSLzh+E/XvHkjsRgCjbkUaYGEhsrcqA5dfzv7c KPxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=sKTltezW9lyfaLvMUZcB/BgWVHsFrtWR8dwZLcISK/U=; b=hk/W7ec6mRUdEmsW+AYGMIz38O1xriO13a1vo+wqTLNmg/dTzUQdyb93hWeIHcy5Sa E35qGk/mgh6ptdPzyaYYXwFC9wFCHnhooGqihAruD/RfG0XSwegfr2orFmOaJ8VMjFvI miyBzBh/O4Wzu1RZLt9GttQKZEVLQVaVyMQv1ib/qUa3C6vAPzLdLD0JMXZJPTd1B4GH +cS6JmrwWgo1bwpbBPs9WzusTzajIp0/bdm0mjxEF2G1pb52UHm42ZMWupT/UGcMfVCV u3M7JuwxW0z1QwMSYjeNxW4Ua4firEeCaVBTinpa1ro8zry1yXO+AIi7xNbNonD4HRBr 0oww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=MHPqJ5tJ; 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 f1-v6si11918261plb.73.2018.03.19.03.40.52; Mon, 19 Mar 2018 03:41:06 -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=MHPqJ5tJ; 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 S933035AbeCSKjk (ORCPT + 99 others); Mon, 19 Mar 2018 06:39:40 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55284 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932989AbeCSKjc (ORCPT ); Mon, 19 Mar 2018 06:39:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding: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=sKTltezW9lyfaLvMUZcB/BgWVHsFrtWR8dwZLcISK/U=; b=MHPqJ5tJ53BzpH08+sJjukNcz Dkngo8s6/dEqqx0gYR2Gclq8tXnGTsackKeueBrVcvJYf7CkCcdDec4RREwOKbSIgmlJ3oJwd7Nt/ GKqYNajRpE079y5EvUpn03E2YArujuZDjk0P+Zz658pinAJH9mnDm3iFt+wMynOtfWSA2ukmuHjcH aLYGWp9UKNfILfOrnRatn4CPTc4+UT3k6xNiVsEJaycwP2hUT7q1v4XLxKsChuvXvyOQ1QDM5KHIy kgMCCPm2kH/N1ZXeY0aFO6x/5/bQuQypnX9EW7Gktx5SboRSJMuFkYu7kwEZUWn00vKGxxg4Ooi5z c95+4UEEw==; Received: from 178.114.187.156.wireless.dyn.drei.com ([178.114.187.156] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1exsCJ-000651-Tc; Mon, 19 Mar 2018 10:39:24 +0000 From: Christoph Hellwig To: x86@kernel.org Cc: Konrad Rzeszutek Wilk , Tom Lendacky , David Woodhouse , Muli Ben-Yehuda , Jon Mason , Joerg Roedel , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/14] swiotlb: remove swiotlb_{alloc,free}_coherent Date: Mon, 19 Mar 2018 11:38:26 +0100 Message-Id: <20180319103826.12853-15-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180319103826.12853-1-hch@lst.de> References: <20180319103826.12853-1-hch@lst.de> 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 Unused now that everyone uses swiotlb_{alloc,free}. Signed-off-by: Christoph Hellwig --- include/linux/swiotlb.h | 8 -------- lib/swiotlb.c | 38 -------------------------------------- 2 files changed, 46 deletions(-) diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 5b1f2a00491c..965be92c33b5 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h @@ -72,14 +72,6 @@ void *swiotlb_alloc(struct device *hwdev, size_t size, dma_addr_t *dma_handle, void swiotlb_free(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_addr, unsigned long attrs); -extern void -*swiotlb_alloc_coherent(struct device *hwdev, size_t size, - dma_addr_t *dma_handle, gfp_t flags); - -extern void -swiotlb_free_coherent(struct device *hwdev, size_t size, - void *vaddr, dma_addr_t dma_handle); - extern dma_addr_t swiotlb_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 8b06b4485e65..15954b86f09e 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c @@ -157,13 +157,6 @@ unsigned long swiotlb_size_or_default(void) return size ? size : (IO_TLB_DEFAULT_SIZE); } -/* Note that this doesn't work with highmem page */ -static dma_addr_t swiotlb_virt_to_bus(struct device *hwdev, - volatile void *address) -{ - return phys_to_dma(hwdev, virt_to_phys(address)); -} - static bool no_iotlb_memory; void swiotlb_print_info(void) @@ -752,28 +745,6 @@ swiotlb_alloc_buffer(struct device *dev, size_t size, dma_addr_t *dma_handle, return NULL; } -void * -swiotlb_alloc_coherent(struct device *hwdev, size_t size, - dma_addr_t *dma_handle, gfp_t flags) -{ - int order = get_order(size); - unsigned long attrs = (flags & __GFP_NOWARN) ? DMA_ATTR_NO_WARN : 0; - void *ret; - - ret = (void *)__get_free_pages(flags, order); - if (ret) { - *dma_handle = swiotlb_virt_to_bus(hwdev, ret); - if (dma_coherent_ok(hwdev, *dma_handle, size)) { - memset(ret, 0, size); - return ret; - } - free_pages((unsigned long)ret, order); - } - - return swiotlb_alloc_buffer(hwdev, size, dma_handle, attrs); -} -EXPORT_SYMBOL(swiotlb_alloc_coherent); - static bool swiotlb_free_buffer(struct device *dev, size_t size, dma_addr_t dma_addr) { @@ -793,15 +764,6 @@ static bool swiotlb_free_buffer(struct device *dev, size_t size, return true; } -void -swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr, - dma_addr_t dev_addr) -{ - if (!swiotlb_free_buffer(hwdev, size, dev_addr)) - free_pages((unsigned long)vaddr, get_order(size)); -} -EXPORT_SYMBOL(swiotlb_free_coherent); - static void swiotlb_full(struct device *dev, size_t size, enum dma_data_direction dir, int do_panic) -- 2.14.2