From patchwork Mon Oct 15 14:03:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 12236 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 34919241A4 for ; Mon, 15 Oct 2012 14:06:38 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id AC6A9A190A7 for ; Mon, 15 Oct 2012 14:06:37 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so3633545iag.11 for ; Mon, 15 Oct 2012 07:06:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:cc:subject:x-beenthere:x-mailman-version :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=opWVTkixOSIW2KNfSIHO8yQjmCm9YJPmFRviIvIlacg=; b=nY3fJAw1pHmOEhMcnOQ11DBZU54ZJgv9/Ke9h6TULcfnFWkg17OlcojAxDvXKmv8va 5O9RmLgYqDR5KYgl8B6bQeohmwFhcjD5UKFAoyiatZLGE60jD2S3Jbz2mDlXF5vy9aj4 ZNSu+9jE3qI6PUxqM2rC8Yf0/LJvyLHERmJO4EVH5r+cXAA4T18l88rrnsHV+Ez3FW8W GhLAT6O3jRne54knJ7yr7YJ4WQ/cX2MJI8QaNPT2vaXh5ATeKqD1ulK4MXb3DEgF5ZUY 7CXBdb2m4GrpxCQv3KKKxMmi48XJIs0y6+IiAVQidM+jCMDV4sr8F68a/AzWcM6CHAbe FUyw== Received: by 10.50.161.169 with SMTP id xt9mr7123438igb.62.1350309997039; Mon, 15 Oct 2012 07:06:37 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp578986igt; Mon, 15 Oct 2012 07:06:36 -0700 (PDT) Received: by 10.204.147.153 with SMTP id l25mr3096847bkv.109.1350309995642; Mon, 15 Oct 2012 07:06:35 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id ie15si24850642bkc.105.2012.10.15.07.06.33; Mon, 15 Oct 2012 07:06:35 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TNlJQ-0001KL-9Q; Mon, 15 Oct 2012 14:06:32 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TNlJP-0001KF-Dr for linaro-mm-sig@lists.linaro.org; Mon, 15 Oct 2012 14:06:31 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MBX0029FTRG5T90@mailout2.samsung.com> for linaro-mm-sig@lists.linaro.org; Mon, 15 Oct 2012 23:04:28 +0900 (KST) X-AuditID: cbfee61b-b7fd46d0000046e0-ed-507c17ece048 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id FB.6A.18144.CE71C705; Mon, 15 Oct 2012 23:04:28 +0900 (KST) Received: from localhost.localdomain ([106.116.147.30]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MBX00JMCTQOCL70@mmp1.samsung.com> for linaro-mm-sig@lists.linaro.org; Mon, 15 Oct 2012 23:04:27 +0900 (KST) From: Marek Szyprowski To: linux-arm-kernel@lists.infradead.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Mon, 15 Oct 2012 16:03:51 +0200 Message-id: <1350309832-18461-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1350309832-18461-1-git-send-email-m.szyprowski@samsung.com> References: <1350309832-18461-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIJMWRmVeSWpSXmKPExsVy+t9jAd034jUBBkves1t8ufKQyYHR4/a/ x8wBjFFcNimpOZllqUX6dglcGd2vpzMX3OetmHT1NXsD43HuLkZODgkBE4nGc89ZIGwxiQv3 1rN1MXJxCAksYpTofdTAAuGsYpK42NTEBlLFJmAo0fW2C8jm4BARqJGYN4MRpIZZ4DWjxKyd m8FqhAX8JX60vgKbyiKgKrH6zD9WkHpeAQ+J/vkKIKaEgILEnEk2IBWcAp4STx/OZQSxhYAq 5jXuZp7AyLuAkWEVo2hqQXJBcVJ6rpFecWJucWleul5yfu4mRrDHn0nvYFzVYHGIUYCDUYmH 96dXdYAQa2JZcWXuIUYJDmYlEd5nj4BCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeZs9UgKEBNIT S1KzU1MLUotgskwcnFINjHYXP5wyXC3nwPJhMcOHKKu9KQ+UJ679+8lnGd+eI4kxG7NO3tSb E5Tn9zv1fnLNC4MVom/9z585JLPBOzY0Yv/OhyVPMpQfbPv16OR208tLvcV6J8o0V+ku6Fuz 4NzW5y1XLQsfeDHNiKoW1AxRFra+epR/h8y2KekHl1zLS91389Ru1h120/YqsRRnJBpqMRcV JwIA9DNOP/QBAAA= Cc: Russell King - ARM Linux , Arnd Bergmann , Inki Dae , Kyungmin Park Subject: [Linaro-mm-sig] [RFC 1/2] common: DMA-mapping: add DMA_ATTR_FORCE_CONTIGUOUS attribute X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQlUvo+9Tm8zTWeBzR27rTJAkU+UYRKmhOiEhfOdKsII7DLbZ5ndnSxMpWkUuPvFgrdGxXgh This patch adds DMA_ATTR_FORCE_CONTIGUOUS attribute to the DMA-mapping subsystem. By default DMA-mapping subsystem is allowed to assemble the buffer allocated by dma_alloc_attrs() function from individual pages if it can be mapped as contiguous chunk into device dma address space. By specifing this attribute the allocated buffer is forced to be contiguous also in physical memory. Signed-off-by: Marek Szyprowski --- Documentation/DMA-attributes.txt | 9 +++++++++ include/linux/dma-attrs.h | 1 + 2 files changed, 10 insertions(+) diff --git a/Documentation/DMA-attributes.txt b/Documentation/DMA-attributes.txt index f503090..e59480d 100644 --- a/Documentation/DMA-attributes.txt +++ b/Documentation/DMA-attributes.txt @@ -91,3 +91,12 @@ transferred to 'device' domain. This attribute can be also used for dma_unmap_{single,page,sg} functions family to force buffer to stay in device domain after releasing a mapping for it. Use this attribute with care! + +DMA_ATTR_FORCE_CONTIGUOUS +------------------------- + +By default DMA-mapping subsystem is allowed to assemble the buffer +allocated by dma_alloc_attrs() function from individual pages if it can +be mapped as contiguous chunk into device dma address space. By +specifing this attribute the allocated buffer is forced to be contiguous +also in physical memory. diff --git a/include/linux/dma-attrs.h b/include/linux/dma-attrs.h index f83f793..c8e1831 100644 --- a/include/linux/dma-attrs.h +++ b/include/linux/dma-attrs.h @@ -17,6 +17,7 @@ enum dma_attr { DMA_ATTR_NON_CONSISTENT, DMA_ATTR_NO_KERNEL_MAPPING, DMA_ATTR_SKIP_CPU_SYNC, + DMA_ATTR_FORCE_CONTIGUOUS, DMA_ATTR_MAX, };