From patchwork Thu Jun 2 15:39:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9151363 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0D28E60221 for ; Fri, 3 Jun 2016 00:20:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F216625404 for ; Fri, 3 Jun 2016 00:20:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E584E28330; Fri, 3 Jun 2016 00:20:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CF7225404 for ; Fri, 3 Jun 2016 00:20:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 611B76ECD0; Fri, 3 Jun 2016 00:20:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7A3216EC14; Thu, 2 Jun 2016 15:42:47 +0000 (UTC) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O8500M0FIB79W10@mailout1.w1.samsung.com>; Thu, 02 Jun 2016 16:42:44 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-a5-575053f3a839 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 81.6C.04866.3F350575; Thu, 2 Jun 2016 16:42:43 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O85008BCI6FXK50@eusync1.samsung.com>; Thu, 02 Jun 2016 16:42:43 +0100 (BST) From: Krzysztof Kozlowski To: Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Stefano Stabellini , Catalin Marinas , Will Deacon , Haavard Skinnemoen , Hans-Christian Egtvedt , Steven Miao , Mark Salter , Aurelien Jacquiot , Mikael Starvik , Jesper Nilsson , Yoshinori Sato , Richard Kuo , Tony Luck , Fenghua Yu , Konrad Rzeszutek Wilk , Geert Uytterhoeven , James Hogan , Michal Simek , Ralf Baechle , David Howells , Ley Foon Tan , Jonas Bonn , "James E.J. Bottomley" , Helge Deller , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Arnd Bergmann , Olof Johansson , Geoff Levand , Martin Schwidefsky , Guan Xuetao , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Boris Ostrovsky , David Vrabel , Juergen Gross , Muli Ben-Yehuda , Bjorn Helgaas , David Airlie , Joerg Roedel , David Woodhouse , Andrew Morton , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, xen-devel@lists.xenproject.org, adi-buildroot-devel@lists.sourceforge.net, linux-c6x-dev@linux-c6x.org, linux-cris-kernel@axis.com, uclinux-h8-devel@lists.sourceforge.jp, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-metag@vger.kernel.org, linux-mips@linux-mips.org, linux-am33-list@redhat.com, nios2-dev@lists.rocketboards.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, discuss@x86-64.org, linux-pci@vger.kernel.org, linux-xtensa@linux-xtensa.org, dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-rdma@vger.kernel.org, iommu@lists.linux-foundation.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Subject: [RFC v3 45/45] dma-mapping: Document the DMA attributes right in declaration Date: Thu, 02 Jun 2016 17:39:47 +0200 Message-id: <1464881987-13203-46-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1464881987-13203-1-git-send-email-k.kozlowski@samsung.com> References: <1464881987-13203-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSfUxTZxTGee97PwpZzc1Vx40uuDQxJm5zfueom9kWM95EDUSXNCHZtMoV DBRrLzVqjOlAdLrCKlgVSprKWr5WCgXNBIOVxtAh1NFB8IMPERUkMOhg3SY4WAvZf7/znOfJ OTk5CiwMMCsUR7OyJX2WJlPFxtHtc/6uj6b3J6vX/9m0Ci42znLgrzOykP+wjYLSWhcL/xa2 cuC5XstAKCcPgyMnHYLX8miYLDchqKjcC8+mehFM5MzSMPf7OIbu8CQLl6uKMHzvHuLg/NXP oXQkgGD4aTMFjtGd0PL4Lw7azWUUXPXEwz/h3EjwgQeD3bsDJmyvMTxzVzMw4ivBUPpkI7wt DlFw0VrHwdjrDVD+4ysEr8x9LEz030dQ4u2nof5FDwOXvQEO7lvNFFT+5MZw47yDhl8KQgxM nrvNQui7CQa6mkpZqHhZg8FUdytS5gajW12gwWwp5MDq+IGGoQedFARsfhaGffk0TA3OYzDf yMVw/de7kXu8vYIhr6+GgqpADQc+SzOC2b/nmM9SyMsWG0Xyms0scdlciHT1BDGZnSlE5JE7 mYwVmSNSQT5FWoZ8LCkbNdKksaSfI6E/viH2egOxWnoQMTV2INJQuTZ5a0rcJ6lS5tETkv7j nQfj0nutIVp3TTh5bmacMqI3Sy6hWIXIbxary/vZRX5X7ByojXCcQuCdSHS1d9OLxbeUWDjs oaIult8kNlQ4FlzLeI8oGl8EcbSB+TPiqH8GRXkprxaLO6oWAjS/WgzYvQu6kidi78wgXhyX ILa1FjFRjo3ojtoqOsoCnygGcxsYM1LaUUw1Wi4ZDuvkQ2najetkjVY2ZKWtO3xMW48Wvy58 Gzlbt/sQr0Cqd5QxHyapBUZzQj6l9SFRgVXLlNn7ktWCMlVz6rSkP3ZAb8iUZB9aqaBV8cri psmvBD5Nky1lSJJO0v/fpRSxK4xoTcbq5bqCcYvTdiCnq8yQFTi+5NB8grqgU2i6t8V0RB7o aU61PXrvZNj3gSdct3ubzvmpNqZtrM//fNB/xd3NZOzlhDcpxbvcZdWNF+xfJmzJiJdcqUFy 6X2rZTrxN33f9Kak+akvkpyZe46sTPDeHFHvma44q6Y7En/++o5JHlDRcrpmw1qslzX/Aa6F gFlxAwAA X-Mailman-Approved-At: Fri, 03 Jun 2016 00:19:26 +0000 Cc: hch@infradead.org, Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Copy documentation abstract about each DMA attribute from Documentation/DMA-attributes.txt to the place with declaration. Suggested-by: Christoph Hellwig Signed-off-by: Krzysztof Kozlowski --- include/linux/dma-mapping.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 6d013ba94213..f349df4cb009 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -14,14 +14,47 @@ /** * List of possible attributes associated with a DMA mapping. The semantics * of each attribute should be defined in Documentation/DMA-attributes.txt. + * + * DMA_ATTR_WRITE_BARRIER: DMA to a memory region with this attribute + * forces all pending DMA writes to complete. */ #define DMA_ATTR_WRITE_BARRIER (1UL << 1) +/* + * DMA_ATTR_WEAK_ORDERING: Specifies that reads and writes to the mapping + * may be weakly ordered, that is that reads and writes may pass each other. + */ #define DMA_ATTR_WEAK_ORDERING (1UL << 2) +/* + * DMA_ATTR_WRITE_COMBINE: Specifies that writes to the mapping may be + * buffered to improve performance. + */ #define DMA_ATTR_WRITE_COMBINE (1UL << 3) +/* + * DMA_ATTR_NON_CONSISTENT: Lets the platform to choose to return either + * consistent or non-consistent memory as it sees fit. + */ #define DMA_ATTR_NON_CONSISTENT (1UL << 4) +/* + * DMA_ATTR_NO_KERNEL_MAPPING: Lets the platform to avoid creating a kernel + * virtual mapping for the allocated buffer. + */ #define DMA_ATTR_NO_KERNEL_MAPPING (1UL << 5) +/* + * DMA_ATTR_SKIP_CPU_SYNC: Allows platform code to skip synchronization of + * the CPU cache for the given buffer assuming that it has been already + * transferred to 'device' domain. + */ #define DMA_ATTR_SKIP_CPU_SYNC (1UL << 6) +/* + * DMA_ATTR_FORCE_CONTIGUOUS: Forces contiguous allocation of the buffer + * in physical memory. + */ #define DMA_ATTR_FORCE_CONTIGUOUS (1UL << 7) +/* + * DMA_ATTR_ALLOC_SINGLE_PAGES: This is a hint to the DMA-mapping subsystem + * that it's probably not worth the time to try to allocate memory to in a way + * that gives better TLB efficiency. + */ #define DMA_ATTR_ALLOC_SINGLE_PAGES (1UL << 8) /*