- 15 Jan, 2018 35 commits
-
-
Christoph Hellwig authored
These already include the GFP_DMA/GFP_DMA32 usage, and will use CMA memory if enabled, thus avoiding the GFP_NORETRY hack. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com>
-
Christoph Hellwig authored
nlm_swiotlb_dma_ops is unused code, so the whole swiotlb support is dead. If it gets resurrected at some point it should use the generic swiotlb_dma_ops instead. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com>
-
Christoph Hellwig authored
These are identical to the tile ops, and would also support CMA if enabled on tile. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com>
-
Christoph Hellwig authored
tile uses ZONE_DMA for allocations below 32-bits. These days we name the zone for that ZONE_DMA32, which will allow to use the dma-direct and generic swiotlb code as-is, so rename it. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com>
-
Christoph Hellwig authored
These are identical to the unicore32 ops, and would also support CMA if enabled on unicore32. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com>
-
Christoph Hellwig authored
The file is only compiled if CONFIG_INTEL_IOMMU is set to start with. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com>
-
Christoph Hellwig authored
Move the few remaining bits of swiotlb glue towards their callers, and remove the pointless on ia64 swiotlb variable. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com>
-
Christoph Hellwig authored
These are identical to the ia64 ops, and would also support CMA if enabled on ia64. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com>
-
Christoph Hellwig authored
ia64 uses ZONE_DMA for allocations below 32-bits. These days we name the zone for that ZONE_DMA32, which will allow to use the dma-direct and generic swiotlb code as-is, so rename it. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com>
-
Christoph Hellwig authored
All these symbols are only used by arch dma_ops implementations or xen-swiotlb. None of which can be modular. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com>
-
Christoph Hellwig authored
Factor out a new swiotlb_alloc_buffer helper that allocates DMA coherent memory from the swiotlb bounce buffer. This allows to simplify the swiotlb_alloc implemenation that uses dma_direct_alloc to try to allocate a reachable buffer first. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com>
-
Christoph Hellwig authored
Factor out a new swiotlb_free_buffer helper that checks if an address is allocated from the swiotlb bounce buffer, and if yes frees it. This allows to simplify the swiotlb_free implemenation that uses dma_direct_free to free the non-bounce buffer allocations. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com>
-
Christoph Hellwig authored
To properly reject too small DMA masks based on the addressability of the bounce buffer. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com>
-
Christoph Hellwig authored
Currently all architectures that want to use swiotlb have to implement their own dma_map_ops instances. Provide a generic one based on the x86 implementation which first calls into dma_direct to try a full blown direct mapping implementation (including e.g. CMA) before falling back allocating from the swiotlb buffer. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com>
-
Christoph Hellwig authored
Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com> Reviewed-by:
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-
Christoph Hellwig authored
We'll need that name for a generic implementation soon. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com> Reviewed-by:
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-
Christoph Hellwig authored
We'll need that name for a generic implementation soon. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com> Reviewed-by:
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-
Christoph Hellwig authored
We'll need that name for a generic implementation soon. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com> Reviewed-by:
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-
Christoph Hellwig authored
We'll need that name for a generic implementation soon. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Christian König <christian.koenig@amd.com> Reviewed-by:
Robin Murphy <robin.murphy@arm.com>
-
Christian König authored
TTM tries to allocate coherent memory in chunks of 2MB first to improve TLB efficiency and falls back to allocating 4K pages if that fails. Suppress the warning when the 2MB allocations fails since there is a valid fall back path. Signed-off-by:
Christian König <christian.koenig@amd.com> Reported-by:
Mike Galbraith <efault@gmx.de> Acked-by:
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104082 CC: stable@vger.kernel.org Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Christoph Hellwig authored
Replace the bare-bones h8300 direct dma mapping implementation with the fully featured generic dma-direct one. Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Christoph Hellwig authored
cris currently has an incomplete direct mapping dma_map_ops implementation if PCI support is enabled. Replace it with the fully feature generic dma-direct implementation. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Jesper Nilsson <jesper.nilsson@axis.com>
-
Christoph Hellwig authored
Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Robin Murphy <robin.murphy@arm.com>
-
Christoph Hellwig authored
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>
-
Christoph Hellwig authored
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>
-
Christoph Hellwig authored
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>
-
Christoph Hellwig authored
To preserve the x86 behavior. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Robin Murphy <robin.murphy@arm.com>
-
Christoph Hellwig authored
Try the CMA allocator for coherent allocations if supported. Roughly modelled after the x86 code. Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Christoph Hellwig authored
Roughly based on the x86 pci-nommu implementation. Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Christoph Hellwig authored
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>
-
Christoph Hellwig authored
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>
-
Christoph Hellwig authored
For architectures that just use the generic dma_noop_ops we can provide a generic version of dma-mapping.h. Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Christoph Hellwig authored
To implement the x86 forbid_dac and iommu_sac_force we want an arch hook so that it can apply the global options across all dma_map_ops implementations. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-
Christoph Hellwig authored
Lift the code from x86 so that we behave consistently. In the future we should probably warn if any of these is set. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Jesper Nilsson <jesper.nilsson@axis.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k]
-
Christoph Hellwig authored
These days all devices should have a DMA coherent mask, and most dma_ops implementations rely on that fact. But just to be sure add an assert to ring the warning bell if that is not the case. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Vladimir Murzin <vladimir.murzin@arm.com> Reviewed-by:
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-
- 10 Jan, 2018 5 commits
-
-
Christoph Hellwig authored
This is not needed in drivers, so move it to a private header. Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Christoph Hellwig authored
Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Christoph Hellwig authored
Always returning 1 is the same behavior as not supplying a method at all. Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Christoph Hellwig authored
This frees the dma_direct_* namespace for a generic implementation. Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Christoph Hellwig authored
We want to use the dma_direct_ namespace for a generic implementation, so rename powerpc to the second best choice: dma_nommu_. Signed-off-by:
Christoph Hellwig <hch@lst.de>
-