Lines Matching +full:data +full:- +full:mapping
2 Dynamic DMA mapping using the generic device
8 of the API (and actual examples), see Documentation/core-api/dma-api-howto.rst.
11 Part II describes extensions for supporting non-consistent memory
13 non-consistent platforms (this is usually only legacy platforms) you
16 Part I - dma_API
17 ----------------
19 To get the dma_API, you must #include <linux/dma-mapping.h>. This
27 Part Ia - Using large DMA-coherent buffers
28 ------------------------------------------
76 Part Ib - Using small DMA-coherent buffers
77 ------------------------------------------
81 Many drivers need lots of small DMA-coherent memory regions for DMA
84 much like a struct kmem_cache, except that they use the DMA-coherent allocator,
86 for alignment, like queue heads needing to be aligned on N-byte boundaries.
95 dma_pool_create() initializes a pool of DMA-coherent buffers
101 alignment requirement for this type of data is "align" (which is expressed
150 Part Ic - DMA addressing limitations
151 ------------------------------------
203 Returns the maximum size of a mapping for the device. The size parameter
204 of the mapping functions like dma_map_single(), dma_map_page() and
212 Returns the maximum optimal size of a mapping for the device.
214 Mapping larger buffers may take much longer in certain scenarios. In
215 addition, for high-rate short-lived streaming mappings, the upfront time
216 spent on the mapping may account for an appreciable part of the total
237 Part Id - Streaming DMA mappings
238 --------------------------------
255 DMA_TO_DEVICE data is going from the memory to the device
256 DMA_FROM_DEVICE data is coming from the device to the memory
265 capability, it will fail if the user tries to map a non-physically
276 the driver may specify various platform-dependent flags to restrict
303 primitive should be treated as read-only by the device. If the device
308 accesses data that may be changed by the device. This memory should
309 be treated as read-only by the driver. If the driver needs to write
317 are flushed from the processor) and once before the data may be
319 cache lines are updated with data that the device may have changed).
328 must be identical to those passed in (and returned) by the mapping
342 API for mapping and unmapping for pages. All the notes and warnings
343 for the other mapping APIs apply here. Also, although the <offset>
344 and <size> parameters are provided to do partial page mapping, it is
358 API for mapping and unmapping for MMIO resources. All the notes and
359 warnings for the other mapping APIs apply here. The API should only be
360 used to map device MMIO resources, mapping of RAM is not permitted.
368 will fail to create a mapping. A driver can check for these errors by testing
369 the returned DMA address with dma_mapping_error(). A non-zero return value
370 means the mapping could not be created and the driver should take appropriate
371 action (e.g. reduce current DMA mapping usage or delay and try again later).
385 The mapping process is allowed to destroy information in the sg.
387 As with the other mapping interfaces, dma_map_sg() can fail. When it
393 With scatterlists, you use the resulting mapping like this::
412 accessed sg->address and sg->length as shown above.
421 must be the same as those and passed in to the scatter/gather mapping
449 Synchronise a single contiguous or scatter/gather mapping for the CPU
451 as those passed into the sg mapping API. With the sync_single API,
453 those passed into the single mapping API to do a partial sync.
460 - Before reading values that have been written by DMA from the device
462 - After writing values that will be written to the device using DMA
464 - before *and* after handing memory to the device if the memory is
495 The interpretation of DMA attributes is architecture-specific, and
497 Documentation/core-api/dma-attributes.rst.
505 you could pass an attribute DMA_ATTR_FOO when mapping memory
508 #include <linux/dma-mapping.h>
509 /* DMA_ATTR_FOO should be defined in linux/dma-mapping.h and
510 * documented in Documentation/core-api/dma-attributes.rst */
520 presence in their implementations of the mapping and unmapping
533 Part Ie - IOVA-based DMA mappings
534 ---------------------------------
536 These APIs allow a very efficient mapping when using an IOMMU. They are an
538 where DMA mapping performance, or the space usage for storing the DMA addresses
546 Is used to try to allocate IOVA space for mapping operation. If it returns
548 DMA mapping API should be used. The ``struct dma_iova_state`` is allocated
555 Can be used by the driver to check if the IOVA-based API is used after a
575 Must be called to sync the IOMMU page tables for IOVA-range mapped by one or
578 For drivers that use a one-shot mapping, all ranges can be unmapped and the
588 and mapping individual regions. In that case
605 Part II - Non-coherent DMA allocations
606 --------------------------------------
621 This routine allocates a region of <size> bytes of non-coherent memory. It
630 The dir parameter specified if data is read and/or written by the device,
690 This routine allocates <size> bytes of non-coherent and possibly non-contiguous
696 indicated by sgt->nents, but it might have multiple CPU side segments as
697 indicated by sgt->orig_nents.
699 The dir parameter specified if data is read and/or written by the device,
730 Return a contiguous kernel mapping for an allocation returned from
735 Once a non-contiguous allocation is mapped using this function, the
737 to manage the coherency between the kernel mapping, the device and user space
745 Unmap a kernel mapping returned by dma_vmap_noncontiguous(). dev must be the
767 alignment *and* width that you must observe when either mapping
778 Part III - Debug drivers use of the DMA-API
779 -------------------------------------------
781 The DMA-API as described above has some constraints. DMA addresses must be
785 result in data corruption up to destroyed filesystems.
787 To debug drivers and find bugs in the usage of the DMA-API checking code can
790 debugging of DMA-API usage" option in your kernel configuration. Enabling this
798 WARNING: at /data2/repos/linux-2.6-iommu/lib/dma-debug.c:448
801 forcedeth 0000:00:08.0: DMA-API: device driver frees DMA memory with wrong
805 Pid: 0, comm: swapper Tainted: G W 2.6.28-dmatest-09289-g8bb99c0 #1
826 <EOI> <4>---[ end trace f6435a98e2a38c0e ]---
829 of the DMA-API call which caused this warning.
837 The debugfs directory for the DMA-API debugging code is called dma-api/. In
841 dma-api/all_errors This file contains a numeric value. If this
847 dma-api/disabled This read-only file contains the character 'Y'
852 dma-api/dump This read-only file contains current DMA
855 dma-api/error_count This file is read-only and shows the total
858 dma-api/num_errors The number in this file shows how many
864 dma-api/min_free_entries This read-only file can be read to get the
870 dma-api/num_free_entries The current number of free dma_debug_entries
873 dma-api/nr_total_entries The total number of dma_debug_entries in the
876 dma-api/driver_filter You can write a name of a driver into this file
885 'dma_debug=off' as a boot parameter. This will disable DMA-API debugging.
895 out of dma_debug_entries and was unable to allocate more on-demand. 65536
896 entries are preallocated at boot - if this is too low for you boot with
910 dma-debug interface debug_dma_mapping_error() to debug drivers that fail
911 to check DMA mapping errors on addresses returned by dma_map_single() and
917 routines to enable DMA mapping error check debugging.