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: 1697451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 8FC66DF2AB for ; Mon, 5 Nov 2012 13:50:45 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TVN2A-0005nf-LW; Mon, 05 Nov 2012 13:48:11 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TNlIC-0002SQ-Vz for linux-arm-kernel@lists.infradead.org; Mon, 15 Oct 2012 14:05:18 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MBX005C6TRGFXA0@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 15 Oct 2012 23:04:28 +0900 (KST) X-AuditID: cbfee61a-b7f976d000001eb9-96-507c17ebadf0 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id FE.F6.07865.BE71C705; 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 linux-arm-kernel@lists.infradead.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 Subject: [RFC 1/2] common: DMA-mapping: add DMA_ATTR_FORCE_CONTIGUOUS attribute 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+NgFrrPJMWRmVeSWpSXmKPExsVy+t9jAd034jUBBluPs1lsenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6M7tfTmQvu81ZMuvqavYHxOHcXIyeHhICJxO3jPxghbDGJC/fW s4HYQgKLGCVuzK/uYuQCsjcwSXzYfhwswSZgKNH1tgvI5uAQEaiRmDeDEaSGWeA1o8SsnZvB aoQF/CV+tL5iAbFZBFQlVp/5xwpSzyvgIdE/XwHElBBQkJgzyQakglPAU+Lpw7mMEGs9JOY1 7maewMi7gJFhFaNoakFyQXFSeq6hXnFibnFpXrpecn7uJkawt59J7WBc2WBxiFGAg1GJh/en V3WAEGtiWXFl7iFGCQ5mJRHeZ4+AQrwpiZVVqUX58UWlOanFhxilOViUxHmbPVIChATSE0tS s1NTC1KLYLJMHJxSDYxc1uvX/zM6tfLAnP2OlyfrT+Nayf9kvtep9YccbtSdZQ2sEFtkqvl4 zvz3f84HPExuZVv4Y+Htjud5i0+U7gs2TIjbd+RsjMKie/u//byZ2+2zVfjsyz8ujoe9P6// uOzlLE6n3X3tT+XePRfKuu673u7FhGeHl+pFpJinPbLZdSVoxaFoNZn2biWW4oxEQy3mouJE AHSMqw3yAQAA X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. X-Spam-Note: CRM114 invocation failed X-Spam-Score: -7.3 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.34 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Mailman-Approved-At: Mon, 05 Nov 2012 08:45:43 -0500 Cc: Russell King - ARM Linux , Arnd Bergmann , Inki Dae , Kyungmin Park , Rob Clark , Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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, };