summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-08-04 15:51:12 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-04 15:51:12 +0300
commitd597690eef4142cf622fd469859ecc56506119b5 (patch)
treee0be5d05994de4b4243a4c76cf6ca13380c3eac3 /Documentation
parent96b585267f552d4b6a28ea8bd75e5ed03deb6e71 (diff)
parent9049fc745300c5e2236cbfc69f5e8cadb6f1f57c (diff)
downloadlinux-d597690eef4142cf622fd469859ecc56506119b5.tar.xz
Merge branch 'akpm' (patches from Andrew)
Merge even more updates from Andrew Morton: - dma-mapping API cleanup - a few cleanups and misc things - use jump labels in dynamic-debug * emailed patches from Andrew Morton <akpm@linux-foundation.org>: dynamic_debug: add jump label support jump_label: remove bug.h, atomic.h dependencies for HAVE_JUMP_LABEL arm: jump label may reference text in __exit tile: support static_key usage in non-module __exit sections sparc: support static_key usage in non-module __exit sections powerpc: add explicit #include <asm/asm-compat.h> for jump label drivers/media/dvb-frontends/cxd2841er.c: avoid misleading gcc warning MAINTAINERS: update email and list of Samsung HW driver maintainers block: remove BLK_DEV_DAX config option samples/kretprobe: fix the wrong type samples/kretprobe: convert the printk to pr_info/pr_err samples/jprobe: convert the printk to pr_info/pr_err samples/kprobe: convert the printk to pr_info/pr_err dma-mapping: use unsigned long for dma_attrs media: mtk-vcodec: remove unused dma_attrs include/linux/bitmap.h: cleanup tree-wide: replace config_enabled() with IS_ENABLED() drivers/fpga/Kconfig: fix build failure
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/DMA-API.txt33
-rw-r--r--Documentation/DMA-attributes.txt2
2 files changed, 15 insertions, 20 deletions
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
index 45ef3f279c3b..1d26eeb6b5f6 100644
--- a/Documentation/DMA-API.txt
+++ b/Documentation/DMA-API.txt
@@ -369,35 +369,32 @@ See also dma_map_single().
dma_addr_t
dma_map_single_attrs(struct device *dev, void *cpu_addr, size_t size,
enum dma_data_direction dir,
- struct dma_attrs *attrs)
+ unsigned long attrs)
void
dma_unmap_single_attrs(struct device *dev, dma_addr_t dma_addr,
size_t size, enum dma_data_direction dir,
- struct dma_attrs *attrs)
+ unsigned long attrs)
int
dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl,
int nents, enum dma_data_direction dir,
- struct dma_attrs *attrs)
+ unsigned long attrs)
void
dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl,
int nents, enum dma_data_direction dir,
- struct dma_attrs *attrs)
+ unsigned long attrs)
The four functions above are just like the counterpart functions
without the _attrs suffixes, except that they pass an optional
-struct dma_attrs*.
-
-struct dma_attrs encapsulates a set of "DMA attributes". For the
-definition of struct dma_attrs see linux/dma-attrs.h.
+dma_attrs.
The interpretation of DMA attributes is architecture-specific, and
each attribute should be documented in Documentation/DMA-attributes.txt.
-If struct dma_attrs* is NULL, the semantics of each of these
-functions is identical to those of the corresponding function
+If dma_attrs are 0, the semantics of each of these functions
+is identical to those of the corresponding function
without the _attrs suffix. As a result dma_map_single_attrs()
can generally replace dma_map_single(), etc.
@@ -405,15 +402,15 @@ As an example of the use of the *_attrs functions, here's how
you could pass an attribute DMA_ATTR_FOO when mapping memory
for DMA:
-#include <linux/dma-attrs.h>
-/* DMA_ATTR_FOO should be defined in linux/dma-attrs.h and
+#include <linux/dma-mapping.h>
+/* DMA_ATTR_FOO should be defined in linux/dma-mapping.h and
* documented in Documentation/DMA-attributes.txt */
...
- DEFINE_DMA_ATTRS(attrs);
- dma_set_attr(DMA_ATTR_FOO, &attrs);
+ unsigned long attr;
+ attr |= DMA_ATTR_FOO;
....
- n = dma_map_sg_attrs(dev, sg, nents, DMA_TO_DEVICE, &attr);
+ n = dma_map_sg_attrs(dev, sg, nents, DMA_TO_DEVICE, attr);
....
Architectures that care about DMA_ATTR_FOO would check for its
@@ -422,12 +419,10 @@ routines, e.g.:
void whizco_dma_map_sg_attrs(struct device *dev, dma_addr_t dma_addr,
size_t size, enum dma_data_direction dir,
- struct dma_attrs *attrs)
+ unsigned long attrs)
{
....
- int foo = dma_get_attr(DMA_ATTR_FOO, attrs);
- ....
- if (foo)
+ if (attrs & DMA_ATTR_FOO)
/* twizzle the frobnozzle */
....
diff --git a/Documentation/DMA-attributes.txt b/Documentation/DMA-attributes.txt
index e8cf9cf873b3..2d455a5cf671 100644
--- a/Documentation/DMA-attributes.txt
+++ b/Documentation/DMA-attributes.txt
@@ -2,7 +2,7 @@
==============
This document describes the semantics of the DMA attributes that are
-defined in linux/dma-attrs.h.
+defined in linux/dma-mapping.h.
DMA_ATTR_WRITE_BARRIER
----------------------