From patchwork Tue Sep 16 16:45:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 4918661 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9A0429F32F for ; Tue, 16 Sep 2014 16:46:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC3052017D for ; Tue, 16 Sep 2014 16:48:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (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 CC9B820138 for ; Tue, 16 Sep 2014 16:48:28 +0000 (UTC) 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 1XTvtf-0003vP-LO; Tue, 16 Sep 2014 16:46:31 +0000 Received: from smtp.codeaurora.org ([198.145.11.231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XTvtd-0003o4-EX for linux-arm-kernel@lists.infradead.org; Tue, 16 Sep 2014 16:46:29 +0000 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 2A22913FC6E; Tue, 16 Sep 2014 16:46:08 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 1D5C113FC70; Tue, 16 Sep 2014 16:46:08 +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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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.1 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 AE27113FC6E; Tue, 16 Sep 2014 16:46:07 +0000 (UTC) From: Laura Abbott To: Andrew Morton Subject: [mmotm][PATCH] common: dma-mapping: Store page array in vm_struct Date: Tue, 16 Sep 2014 09:45:54 -0700 Message-Id: <1410885954-24260-1-git-send-email-lauraa@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140916_094629_505380_3329A07D X-CRM114-Status: GOOD ( 13.32 ) X-Spam-Score: -0.7 (/) Cc: linux-mm@kvack.org, Mitchel Humpherys , Laura Abbott , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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 Commit 54329ac (common: dma-mapping: introduce common remapping functions) factored out common code for remapping arrays of pages. The code before the refactor relied on setting area->pages with the array of mapped pages for easy access later. The refactor dropped this, breaking parts of the ARM DMA API. Fix this by setting the page array in the same place. Reported-by: Mitchel Humpherys Signed-off-by: Laura Abbott --- drivers/base/dma-mapping.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/base/dma-mapping.c b/drivers/base/dma-mapping.c index 3a6af66..9e8bbdd 100644 --- a/drivers/base/dma-mapping.c +++ b/drivers/base/dma-mapping.c @@ -285,6 +285,8 @@ void *dma_common_pages_remap(struct page **pages, size_t size, if (!area) return NULL; + area->pages = pages; + if (map_vm_area(area, prot, pages)) { vunmap(area->addr); return NULL;