Received: by 10.213.65.68 with SMTP id h4csp664564imn; Fri, 23 Mar 2018 12:55:55 -0700 (PDT) X-Google-Smtp-Source: AG47ELseypMOUiD51r3SVTATsrfOfD27mYdOfQkPw106KTs1f1hVSD+5hrmzndCPPv1BS1iWRVu2 X-Received: by 2002:a17:902:8c8c:: with SMTP id t12-v6mr20353343plo.100.1521834955193; Fri, 23 Mar 2018 12:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521834955; cv=none; d=google.com; s=arc-20160816; b=uyQoYXzuvPJdcrWEv77BPetv9xiB+dSSgc+F18xi4nIO/POKzyCN3h8fqiqyAkw/Qi 8oXQJuBklG3lVAfThzkd4j661cAyLz5y0naBqhV5fSneBJAK18FNpRZziZHUGkxun4D9 TQXa9AtOT+QDPob8uHuXYMVGzD3nbes5FbBgtWNVsLq69Zb6i0cfyDugoRuywX2X1FVe uKzfSBTdLgTvDAZm9MpQYTloIOuUJ+zf8TsNu/VqIw6oUzA5VVMKAR8mOc3uXmeNNVCC nyb23tQK3yMXcb/eZHdY1ZNzILyO3V1mzpylKz03clpCjuw/kG1UltY+OLWVTJCJKrhf Kl0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=KkUTDihPxY0wxddp0NKpfyfg14LTQR0lAnRw9HTZLcY=; b=lexuJ5bBYq8Bd9gTCZGVLvKk4en0OMaGghxx7j6PlZRhZJu9rIbZADNLz41ep7Tsfn 6HuQU5hpj+aHSJi67d2isHdisuP6nH0hT5bcRpHHLQbZChceKBxOgNwXTPRoN4B2C0dp mNm8qR/HZpYwIZIDpx7T1mUkqF8f6TfW0eY5Mp1miup2SsTSzZS2KxJBUWn62Gq7okhu /qF3R56CUxZsVIIC5VTs80MrigDTcz+bBVjoqbbY4uE5i5ij8fB4E+YC7Jkmwjnh1E7K RunKiZ0FpBBAdBriLVyhEQwqirTReEsKR39b7KjC5wSyIsVv3sGdOqvaRfl9Wcxtzf3D FHKg== ARC-Authentication-Results: i=1; mx.google.com; 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 r68si7393441pfi.413.2018.03.23.12.55.40; Fri, 23 Mar 2018 12:55:55 -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; 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 S1752249AbeCWTyu (ORCPT + 99 others); Fri, 23 Mar 2018 15:54:50 -0400 Received: from terminus.zytor.com ([198.137.202.136]:34419 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751921AbeCWTyt (ORCPT ); Fri, 23 Mar 2018 15:54:49 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w2NJsKcV020304; Fri, 23 Mar 2018 12:54:20 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w2NJsJNV020301; Fri, 23 Mar 2018 12:54:19 -0700 Date: Fri, 23 Mar 2018 12:54:19 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Christoph Hellwig Message-ID: Cc: mingo@kernel.org, hch@lst.de, dwmw2@infradead.org, linux-kernel@vger.kernel.org, thomas.lendacky@amd.com, konrad.wilk@oracle.com, jdmason@kudzu.us, hpa@zytor.com, torvalds@linux-foundation.org, peterz@infradead.org, mulix@mulix.org, tglx@linutronix.de, joro@8bytes.org Reply-To: dwmw2@infradead.org, linux-kernel@vger.kernel.org, thomas.lendacky@amd.com, konrad.wilk@oracle.com, jdmason@kudzu.us, hpa@zytor.com, mingo@kernel.org, hch@lst.de, torvalds@linux-foundation.org, peterz@infradead.org, mulix@mulix.org, tglx@linutronix.de, joro@8bytes.org In-Reply-To: <20180319103826.12853-15-hch@lst.de> References: <20180319103826.12853-15-hch@lst.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/dma] dma/swiotlb: Remove swiotlb_{alloc,free}_coherent() Git-Commit-ID: 16e73adbca76fd18733278cb688b0ddb4cad162c X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 16e73adbca76fd18733278cb688b0ddb4cad162c Gitweb: https://git.kernel.org/tip/16e73adbca76fd18733278cb688b0ddb4cad162c Author: Christoph Hellwig AuthorDate: Mon, 19 Mar 2018 11:38:26 +0100 Committer: Ingo Molnar CommitDate: Tue, 20 Mar 2018 10:01:59 +0100 dma/swiotlb: Remove swiotlb_{alloc,free}_coherent() Unused now that everyone uses swiotlb_{alloc,free}(). Tested-by: Tom Lendacky Signed-off-by: Christoph Hellwig Reviewed-by: Thomas Gleixner Cc: David Woodhouse Cc: Joerg Roedel Cc: Jon Mason Cc: Konrad Rzeszutek Wilk Cc: Linus Torvalds Cc: Muli Ben-Yehuda Cc: Peter Zijlstra Cc: iommu@lists.linux-foundation.org Link: http://lkml.kernel.org/r/20180319103826.12853-15-hch@lst.de Signed-off-by: Ingo Molnar --- 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 @@ out_warn: 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)