summaryrefslogtreecommitdiffstats
path: root/lib/dma-direct.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* dma-direct: reject too small dma masksChristoph Hellwig2018-01-151-0/+19
| | | | | Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
* dma-direct: make dma_direct_{alloc,free} available to other implementationsChristoph Hellwig2018-01-151-3/+3
| | | | | | | So that they don't need to indirect through the operation vector. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
* dma-direct: retry allocations using GFP_DMA for small masksChristoph Hellwig2018-01-151-1/+24
| | | | | | | | | | | If an attempt to allocate memory succeeded, but isn't inside the supported DMA mask, retry the allocation with GFP_DMA set as a last resort. Based on the x86 code, but an off by one error in what is now dma_coherent_ok has been fixed vs the x86 code. Signed-off-by: Christoph Hellwig <hch@lst.de>
* dma-direct: add support for allocation from ZONE_DMA and ZONE_DMA32Christoph Hellwig2018-01-151-0/+14
| | | | | | | | | | | | This allows to dip into zones for lower memory if they are available. If one of the zones is not available the corresponding GFP_* flag will evaluate to 0 so they won't change anything. We provide an arch tunable for those architectures that do not use GFP_DMA for the lowest 24-bits, given that there are a few. Roughly based on the x86 code. Signed-off-by: Christoph Hellwig <hch@lst.de>
* dma-direct: use node local allocations for coherent memoryChristoph Hellwig2018-01-151-1/+1
| | | | | | | To preserve the x86 behavior. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
* dma-direct: add support for CMA allocationChristoph Hellwig2018-01-151-6/+18
| | | | | | | | Try the CMA allocator for coherent allocations if supported. Roughly modelled after the x86 code. Signed-off-by: Christoph Hellwig <hch@lst.de>
* dma-direct: add dma address sanity checksChristoph Hellwig2018-01-151-1/+30
| | | | | | Roughly based on the x86 pci-nommu implementation. Signed-off-by: Christoph Hellwig <hch@lst.de>
* dma-direct: use phys_to_dmaChristoph Hellwig2018-01-151-11/+7
| | | | | | | | This means it uses whatever linear remapping scheme that the architecture provides is used in the generic dma_direct ops. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
* dma-direct: rename dma_noop to dma_directChristoph Hellwig2018-01-151-0/+63
The trivial direct mapping implementation already does a virtual to physical translation which isn't strictly a noop, and will soon learn to do non-direct but linear physical to dma translations through the device offset and a few small tricks. Rename it to a better fitting name. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>