Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1218124imd; Thu, 1 Nov 2018 12:04:59 -0700 (PDT) X-Google-Smtp-Source: AJdET5fW6SduUkuI21SJaxoaHsZt53mVdq8hlCO4/UqIOPnEmAx7ACiEqKytiGD0KClWK+Wh2JtC X-Received: by 2002:a62:2bd4:: with SMTP id r203-v6mr7194038pfr.105.1541099099766; Thu, 01 Nov 2018 12:04:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541099099; cv=none; d=google.com; s=arc-20160816; b=Xar4h7ut/IvOJdD0KUMnIn8WTz2PSFTyY5BQ0iKN3fnhLyO7MGgkXyZJwJsR+qsj4H kMRD9S90FXPfHiDnoMmb1rKKuuZdwxdByyuPCjYDEGW/JRRgpIzM5FJsjhOOMDaZ18At foWqvuWoLDAGjoIyVz3EOG3d78HksR1zXJnHNfAIHN5MmDbREJqDYYPF0EoCW+ZiAhMc XETXXZHPHORYfJjs217YZZ2hXDiEz38D/YkPzRqIXudZdAUg9Ru63pcDq8RJ9u28QaZm Kr+ik0NIVC0Qb2HMI46OatfFJf+HqY12UdepOLQfLT3fPcfjjXxT563dGl901HtR6aLc su0A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=csBfI1CYjSX9tZQgJRJEFBHcbmd20fyGTnJaBhYvo9o=; b=zBCupecDcwoZ14cLvcHpE31Kd3RxUF/HcWVmoiqzTrQWjhU3piDxqJJqmd2/X3wGP3 wuem7epvgaPnzzihV2RhAv9WqZSRN5wlMsXPRU32HFhld0kQjkpIjQ+yHXChrqi4Rfeu wqa08205UXKd1BZ21WRS/xmZM21YouEkXhrQx3E44r3+n+/p53LW17Ilpp7IkhlhUBG8 A3gVmHPyxqJicI58T8pogahn3D0W/uBExY5LWG8t9JbIrmxMVMD3xi4zS1J5A+lPbLoD Q/QS4OfsJHu8tZTr0F3sa4eWjA4Alk1CdUIH4OQp3azKl0pqG82EuK7BUZ3bSuacI/P0 lv1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=s8oV6rOz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2-v6si20965704plb.123.2018.11.01.12.04.43; Thu, 01 Nov 2018 12:04:59 -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=pass header.i=@gmail.com header.s=20161025 header.b=s8oV6rOz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726524AbeKBEIJ (ORCPT + 99 others); Fri, 2 Nov 2018 00:08:09 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52189 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726107AbeKBEIJ (ORCPT ); Fri, 2 Nov 2018 00:08:09 -0400 Received: by mail-wm1-f65.google.com with SMTP id w7-v6so2273247wmc.1 for ; Thu, 01 Nov 2018 12:03:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=csBfI1CYjSX9tZQgJRJEFBHcbmd20fyGTnJaBhYvo9o=; b=s8oV6rOzE1Qti03eT1v6TIDRcnrIRFmo3Loar/koIl1V8nLREq/Ar3ysjrXgZeTUV8 UjA6brzjg2E8Uy0xiL+MULxcPFaB3VbJ9bxm1heRXdRVcjhX4eszfxnSzzl1eBYmQhT0 PFYBcceteQKDjfizaK3Kaafb6WXMm/arwfG2KdhEqFLC2UeOhMR66TLG1yKOivYu/VJe m8gw6Ds7bGNCyYOKX5e2hF6NXGHlhRvDAhXU/8b+olCXs44bwRH3dprPApr+8u1VEK0M ZbEdX/g90JjfHQ7Q05ocEC4KXXbiVNW6cmoaZnn1MEZ/WZ8XumtcqI9Yj8xPOLSICLMr ajiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=csBfI1CYjSX9tZQgJRJEFBHcbmd20fyGTnJaBhYvo9o=; b=W0bDmLrg245cVV/9lHH/epYEXjzH21h1DWV8WcvItOQoWaz5rX+z6EHe5Dg41i+f+M LKztzLAPNKtNKwnyTNGq7of4jZk83IJIWzKdaUocDV7lBw7DH11K6KgzHILYO7oAudcU SOkNJpWNdvAFF9TtT+pRANvFkqojmsYEskRqNyI8hMrtRRjTdhsP0sUX5wAuFq8XO70l FgOBxh40wFJgAkKIRgJP87jbxQ6KRIiBCLxDFBtjAiKYkTLczSSK24tE9GlQWG9AczRo yjjUGUvf8VXbIeuZee5Crz5HGLF6Uf3h4AlaCG1AifYwtFzKtQz/EMDAOlgefG4V+UDT cz8g== X-Gm-Message-State: AGRZ1gL850Cgf7u24zKjwupWqkuDfsNEcKoWunXiuQT29kPxfKcsPoOf RRKSr9bhwrD51G69IK8X0Du2Qalv X-Received: by 2002:a1c:7301:: with SMTP id d1-v6mr6711161wmb.72.1541099033617; Thu, 01 Nov 2018 12:03:53 -0700 (PDT) Received: from [10.67.50.106] ([192.19.223.250]) by smtp.googlemail.com with ESMTPSA id p19-v6sm14537256wmc.46.2018.11.01.12.03.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 12:03:52 -0700 (PDT) Subject: Re: [PATCH] ARM64: dma: move swiotlb helpers under CONFIG_IOMMU_DMA To: Olof Johansson , Catalin Marinas , Will Deacon Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20181101185340.32664-1-olof@lixom.net> From: Florian Fainelli Openpgp: preference=signencrypt Autocrypt: addr=f.fainelli@gmail.com; prefer-encrypt=mutual; keydata= xsDiBEjPuBIRBACW9MxSJU9fvEOCTnRNqG/13rAGsj+vJqontvoDSNxRgmafP8d3nesnqPyR xGlkaOSDuu09rxuW+69Y2f1TzjFuGpBk4ysWOR85O2Nx8AJ6fYGCoeTbovrNlGT1M9obSFGQ X3IzRnWoqlfudjTO5TKoqkbOgpYqIo5n1QbEjCCwCwCg3DOH/4ug2AUUlcIT9/l3pGvoRJ0E AICDzi3l7pmC5IWn2n1mvP5247urtHFs/uusE827DDj3K8Upn2vYiOFMBhGsxAk6YKV6IP0d ZdWX6fqkJJlu9cSDvWtO1hXeHIfQIE/xcqvlRH783KrihLcsmnBqOiS6rJDO2x1eAgC8meAX SAgsrBhcgGl2Rl5gh/jkeA5ykwbxA/9u1eEuL70Qzt5APJmqVXR+kWvrqdBVPoUNy/tQ8mYc nzJJ63ng3tHhnwHXZOu8hL4nqwlYHRa9eeglXYhBqja4ZvIvCEqSmEukfivk+DlIgVoOAJbh qIWgvr3SIEuR6ayY3f5j0f2ejUMYlYYnKdiHXFlF9uXm1ELrb0YX4GMHz80nRmxvcmlhbiBG YWluZWxsaSA8Zi5mYWluZWxsaUBnbWFpbC5jb20+wmYEExECACYCGyMGCwkIBwMCBBUCCAME FgIDAQIeAQIXgAUCVF/S8QUJHlwd3wAKCRBhV5kVtWN2DvCV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FYFj5Lj5x34LKPx7MpgAmj0H7SDhpFWF2FzcC1bjiW9mjW HaKaX23Awt97AqQZXegbfkJwX2Y53ufq8Np3e1542lh3/mpiGSilCsaTahEGrHK+lIusl6mz Joil+u3k01ofvJMK0ZdzGUZ/aPMZ16LofjFA+MNxWrZFrkYmiGdv+LG45zSlZyIvzSiG2lKy kuVag+IijCIom78P9jRtB1q1Q5lwZp2TLAJlz92DmFwBg1hyFzwDADjZ2nrDxKUiybXIgZp9 aU2d++ptEGCVJOfEW4qpWCCLPbOT7XBr+g/4H3qWbs3j/cDDq7LuVYIe+wchy/iXEJaQVeTC y5arMQorqTFWlEOgRA8OP47L9knl9i4xuR0euV6DChDrguup2aJVU8JPBBgRAgAPAhsMBQJU X9LxBQkeXB3fAAoJEGFXmRW1Y3YOj4UAn3nrFLPZekMeqX5aD/aq/dsbXSfyAKC45Go0YyxV HGuUuzv+GKZ6nsysJw== Message-ID: <5b524dcf-f78c-25af-6a70-9c85aa8e4a42@gmail.com> Date: Thu, 1 Nov 2018 12:03:44 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181101185340.32664-1-olof@lixom.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/1/18 11:53 AM, Olof Johansson wrote: > Fixes the following tinyconfig warnings: > arch/arm64/mm/dma-mapping.c:174:12: warning: '__swiotlb_mmap_pfn' defined but not used [-Wunused-function] > arch/arm64/mm/dma-mapping.c:163:12: warning: '__swiotlb_get_sgtable_page' defined but not used [-Wunused-function] > > Signed-off-by: Olof Johansson Christoph sent an alternative solution here: http://lists.infradead.org/pipermail/linux-arm-kernel/2018-October/609480.html > --- > arch/arm64/mm/dma-mapping.c | 58 ++++++++++++++++++++++----------------------- > 1 file changed, 29 insertions(+), 29 deletions(-) > > diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c > index 3a703e5d4e32..62356c64e180 100644 > --- a/arch/arm64/mm/dma-mapping.c > +++ b/arch/arm64/mm/dma-mapping.c > @@ -160,35 +160,6 @@ void arch_sync_dma_for_cpu(struct device *dev, phys_addr_t paddr, > __dma_unmap_area(phys_to_virt(paddr), size, dir); > } > > -static int __swiotlb_get_sgtable_page(struct sg_table *sgt, > - struct page *page, size_t size) > -{ > - int ret = sg_alloc_table(sgt, 1, GFP_KERNEL); > - > - if (!ret) > - sg_set_page(sgt->sgl, page, PAGE_ALIGN(size), 0); > - > - return ret; > -} > - > -static int __swiotlb_mmap_pfn(struct vm_area_struct *vma, > - unsigned long pfn, size_t size) > -{ > - int ret = -ENXIO; > - unsigned long nr_vma_pages = vma_pages(vma); > - unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; > - unsigned long off = vma->vm_pgoff; > - > - if (off < nr_pages && nr_vma_pages <= (nr_pages - off)) { > - ret = remap_pfn_range(vma, vma->vm_start, > - pfn + off, > - vma->vm_end - vma->vm_start, > - vma->vm_page_prot); > - } > - > - return ret; > -} > - > static int __init atomic_pool_init(void) > { > pgprot_t prot = __pgprot(PROT_NORMAL_NC); > @@ -358,6 +329,35 @@ arch_initcall(arm64_dma_init); > #include > #include > > +static int __swiotlb_get_sgtable_page(struct sg_table *sgt, > + struct page *page, size_t size) > +{ > + int ret = sg_alloc_table(sgt, 1, GFP_KERNEL); > + > + if (!ret) > + sg_set_page(sgt->sgl, page, PAGE_ALIGN(size), 0); > + > + return ret; > +} > + > +static int __swiotlb_mmap_pfn(struct vm_area_struct *vma, > + unsigned long pfn, size_t size) > +{ > + int ret = -ENXIO; > + unsigned long nr_vma_pages = vma_pages(vma); > + unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; > + unsigned long off = vma->vm_pgoff; > + > + if (off < nr_pages && nr_vma_pages <= (nr_pages - off)) { > + ret = remap_pfn_range(vma, vma->vm_start, > + pfn + off, > + vma->vm_end - vma->vm_start, > + vma->vm_page_prot); > + } > + > + return ret; > +} > + > /* Thankfully, all cache ops are by VA so we can ignore phys here */ > static void flush_page(struct device *dev, const void *virt, phys_addr_t phys) > { > -- Florian