Received: by 10.223.185.116 with SMTP id b49csp2860545wrg; Mon, 5 Mar 2018 09:50:01 -0800 (PST) X-Google-Smtp-Source: AG47ELshhbgaFdh6KU9uph5AUh5d3lQy1XQy5GPOr2AVCXKTS0TyCCpacdloTMxUbBbsErsHmPum X-Received: by 10.99.113.85 with SMTP id b21mr13163526pgn.305.1520272201368; Mon, 05 Mar 2018 09:50:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520272201; cv=none; d=google.com; s=arc-20160816; b=vQv46sQJvrNicS1BBL5pU9tm/OmWzaqPHKfwxWIW3+Am1et1NCTdzViurFLDJPDX6n p+1zDWSiCfA9Jg2sMQrCk5YjCkqJSdBBP0LcRf01v+TI7xdxMJFkqShQg3O3JqX+Rhya NaiHK2csKatC9uaQOptqS3iEo2QYX1x9IIi7P1WNIwU/bKwldcodd26vSijU5tmzPLdV MF3Y2wLyKngNr6NKHv3MYQttd8isS5p7w4wkDWD8JckaSldsl37KVJbBaFFqAVPy0C5v A6V65GHs1jnSTdu1jb2nuiSO8aI4ChfB28Py+tFEijurWTqulQHUCTDrHfOBtscCQ01X NWVA== 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=OhuUb4AfSmlXLwrdgwbxRwKNu5V62q2buMdvGAiuPBNQOzi243RDzIYm+Wvj1ldUbV bEDMmWPSDhuL1RJTsaVWzAEoD9Ve7Kxipt8MH2nxqrWZf0yNo56j4vQsdvwv97zNZWcG ZwQ6+EArfpvDrYcWl6ndzdg34QRKtY1lF4uJen5iTO0o2GnUAUIVQnTtTKU+gzUMACRb NJFEN/lIBBo5P8NRCm4Oe60aNJEl4IGoJK9IWerbb33h2SmKoIuwPxIJxs/JkUR5EDb+ 2Gtv831xP70nnbBEyWaGyYSQTFPLBecXwVV7YWn9Zo7hbCRWlbdof7GpeR7nOXBE0J+0 Nbbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=d74Num9e; 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 m1-v6si9912103pli.332.2018.03.05.09.49.47; Mon, 05 Mar 2018 09:50:01 -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=d74Num9e; 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 S1752823AbeCERrh (ORCPT + 99 others); Mon, 5 Mar 2018 12:47:37 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:60798 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751723AbeCERrW (ORCPT ); Mon, 5 Mar 2018 12:47:22 -0500 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=d74Num9ezhyVnTqTnvSwC95IV /RDu3y3qH5tTIgqYAZLYGe37RwCuQUqshH4KDdQA1q49LyCHiyDL766PsF1+W4siTtBz8OS0oeN5Y i3H+9aOuSluadat6JNX9XZj683QkUmDEJUanF/TTX3d4Q+WaamxYW2dajQ01//muKCOCO5ZJjrbq7 IHVEfF0LCXTE3OfduZJb6S+WsLw4EIoHXrAK2haDRoFks6AoMRlNoETIGolt4VRGYSOVETZ+z3Br6 KjyoSTWh3+BIblaAJgcxhpzM0Aa2h5NaT9JgXPWru7yEKeiBiQ5wWTRPjE3odfedWpzLlnkultnUK fdTTQjtBg==; Received: from [209.116.154.70] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1esuCZ-0002yD-MJ; Mon, 05 Mar 2018 17:47:07 +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 13/13] swiotlb: remove swiotlb_{alloc,free}_coherent Date: Mon, 5 Mar 2018 09:46:55 -0800 Message-Id: <20180305174655.9878-14-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180305174655.9878-1-hch@lst.de> References: <20180305174655.9878-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