From patchwork Fri Mar 14 19:52:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 3834971 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F3DB6BF540 for ; Fri, 14 Mar 2014 19:53:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 13AB02034C for ; Fri, 14 Mar 2014 19:53:50 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E207020340 for ; Fri, 14 Mar 2014 19:53:48 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOYAL-0001DJ-AA; Fri, 14 Mar 2014 19:53:13 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOYA8-0007te-9D; Fri, 14 Mar 2014 19:53:00 +0000 Received: from smtp.codeaurora.org ([198.145.11.231]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOYA0-0007rh-Iz for linux-arm-kernel@lists.infradead.org; Fri, 14 Mar 2014 19:52:54 +0000 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 995FA13F013; Fri, 14 Mar 2014 19:52:32 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 89A7B13F11F; Fri, 14 Mar 2014 19:52:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from lauraa-linux1.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: lauraa@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 245EB13F11B; Fri, 14 Mar 2014 19:52:32 +0000 (UTC) From: Laura Abbott To: Catalin Marinas Subject: [PATCHv2 3/3] arm64: Use arm64 coherent APIs for non-coherent freeing Date: Fri, 14 Mar 2014 12:52:25 -0700 Message-Id: <1394826745-24191-3-git-send-email-lauraa@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1394732716-11507-2-git-send-email-lauraa@codeaurora.org> In-Reply-To: <1394732716-11507-2-git-send-email-lauraa@codeaurora.org> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140314_155252_820213_0D48572F X-CRM114-Status: GOOD ( 12.96 ) X-Spam-Score: -1.9 (-) Cc: Laura Abbott , linux-arm-kernel@lists.infradead.org, Ritesh Harjani X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The noncoherent free function currently unconditionally frees back to the page allocator which is incorrect for CMA pages. call the coherent free function to correctly differentiate between pages. Signed-off-by: Laura Abbott --- arch/arm64/mm/dma-mapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index 608c343..99ff063 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c @@ -104,7 +104,7 @@ static void arm64_swiotlb_free_noncoherent(struct device *dev, size_t size, void *swiotlb_addr = phys_to_virt(dma_to_phys(dev, dma_handle)); vunmap(vaddr); - swiotlb_free_coherent(dev, size, swiotlb_addr, dma_handle); + arm64_swiotlb_free_coherent(dev, size, swiotlb_addr, dma_handle, attrs); } static dma_addr_t arm64_swiotlb_map_page(struct device *dev,