From patchwork Tue Feb 16 14:14:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 62024 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1689726lbl; Tue, 16 Feb 2016 06:16:05 -0800 (PST) X-Received: by 10.66.255.39 with SMTP id an7mr25893720pad.2.1455632165382; Tue, 16 Feb 2016 06:16:05 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id l80si51506986pfj.31.2016.02.16.06.16.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2016 06:16:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVgPD-0003yW-KX; Tue, 16 Feb 2016 14:15:07 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVgP9-0003Rm-BX for linux-arm-kernel@lists.infradead.org; Tue, 16 Feb 2016 14:15:05 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O2N00J1B8WEDD20@mailout2.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 16 Feb 2016 14:14:38 +0000 (GMT) X-AuditID: cbfec7f4-f79026d00000418a-1c-56c32ece663f Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 67.BE.16778.ECE23C65; Tue, 16 Feb 2016 14:14:38 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O2N00MB78WA7Q60@eusync3.samsung.com>; Tue, 16 Feb 2016 14:14:38 +0000 (GMT) From: Marek Szyprowski To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM64: dma-mapping: fix IOMMU-based dma_mmap_atts() implementation Date: Tue, 16 Feb 2016 15:14:25 +0100 Message-id: <1455632065-14620-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGJMWRmVeSWpSXmKPExsVy+t/xq7rn9A6HGfStF7R4v6yH0WLT42us FmuP3GW3OPjhCavFy48nWBxYPdbMW8PosXlJvUffllWMAcxRXDYpqTmZZalF+nYJXBmN/ZMY C96xV9zac4O1gfEQWxcjJ4eEgInEzKfT2SFsMYkL99YDxTk4hASWMkosMO1i5AIym5gknu9Y D1bPJmAo0fW2C8wWEdCQmNL1mB2kiFlgGaPEvOXLwBLCAqESd5+1M4LYLAKqEu2rX4AN5RXw kJjxywZil5zE/5crmCYwci9gZFjFKJpamlxQnJSea6hXnJhbXJqXrpecn7uJEeL7LzsYFx+z OsQowMGoxMPL4XEoTIg1say4MvcQowQHs5II779XQCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8 c3e9DxESSE8sSc1OTS1ILYLJMnFwSjUwCpwQ7rl5a8qipTf6WHb/t3Tay/woVFIpZ+3r1VHB nxfx+iQGRSk1xR2yc2/Mq9yQe23/tisLb/OHLvnAmSq9LkDm/BkWhodeVRxHdhTxSdbH2fvE T/bc+u/q0/1eIQ9vddveCi5c2LhD9VCu59SP+46zL69qnxrzdWmeiM+Ev4t+zfMRi3VnVGIp zkg01GIuKk4EAJpFYZv5AQAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160216_061503_612836_BC079199 X-CRM114-Status: GOOD ( 12.60 ) X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [210.118.77.12 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [210.118.77.12 listed in wl.mailspike.net] -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Will Deacon , Robin Murphy , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org IOMMU-based DMA-mapping implementation doesn't support dma_declare_coherent() based regions, so there is no point to call dma_mmap_from_coherent() from __iommu_mmap_atts(). This patch removes useless code. Signed-off-by: Marek Szyprowski --- arch/arm64/mm/dma-mapping.c | 5 ----- 1 file changed, 5 deletions(-) -- 1.9.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index 331c4ca..573b1e6 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c @@ -636,14 +636,9 @@ static int __iommu_mmap_attrs(struct device *dev, struct vm_area_struct *vma, struct dma_attrs *attrs) { struct vm_struct *area; - int ret; vma->vm_page_prot = __get_dma_pgprot(attrs, vma->vm_page_prot, is_device_dma_coherent(dev)); - - if (dma_mmap_from_coherent(dev, vma, cpu_addr, size, &ret)) - return ret; - area = find_vm_area(cpu_addr); if (WARN_ON(!area || !area->pages)) return -ENXIO;