Merge tag 'dma-mapping-5.10' of git://git.infradead.org/users/hch/dma-mapping
Pull dma-mapping updates from Christoph Hellwig:
- rework the non-coherent DMA allocator
- move private definitions out of <linux/dma-mapping.h>
- lower CMA_ALIGNMENT (Paul Cercueil)
- remove the omap1 dma address translation in favor of the common code
- make dma-direct aware of multiple dma offset ranges (Jim Quinlan)
- support per-node DMA CMA areas (Barry Song)
- increase the default seg boundary limit (Nicolin Chen)
- misc fixes (Robin Murphy, Thomas Tai, Xu Wang)
- various cleanups
* tag 'dma-mapping-5.10' of git://git.infradead.org/users/hch/dma-mapping: (63 commits)
ARM/ixp4xx: add a missing include of dma-map-ops.h
dma-direct: simplify the DMA_ATTR_NO_KERNEL_MAPPING handling
dma-direct: factor out a dma_direct_alloc_from_pool helper
dma-direct check for highmem pages in dma_direct_alloc_pages
dma-mapping: merge <linux/dma-noncoherent.h> into <linux/dma-map-ops.h>
dma-mapping: move large parts of <linux/dma-direct.h> to kernel/dma
dma-mapping: move dma-debug.h to kernel/dma/
dma-mapping: remove <asm/dma-contiguous.h>
dma-mapping: merge <linux/dma-contiguous.h> into <linux/dma-map-ops.h>
dma-contiguous: remove dma_contiguous_set_default
dma-contiguous: remove dev_set_cma_area
dma-contiguous: remove dma_declare_contiguous
dma-mapping: split <linux/dma-mapping.h>
cma: decrease CMA_ALIGNMENT lower limit to 2
firewire-ohci: use dma_alloc_pages
dma-iommu: implement ->alloc_noncoherent
dma-mapping: add new {alloc,free}_noncoherent dma_map_ops methods
dma-mapping: add a new dma_alloc_pages API
dma-mapping: remove dma_cache_sync
53c700: convert to dma_alloc_noncoherent
...
This commit is contained in:
@@ -138,4 +138,6 @@ const struct dma_map_ops dma_iommu_ops = {
|
||||
.get_required_mask = dma_iommu_get_required_mask,
|
||||
.mmap = dma_common_mmap,
|
||||
.get_sgtable = dma_common_get_sgtable,
|
||||
.alloc_pages = dma_common_alloc_pages,
|
||||
.free_pages = dma_common_free_pages,
|
||||
};
|
||||
|
||||
@@ -172,7 +172,6 @@ static unsigned long iommu_range_alloc(struct device *dev,
|
||||
int largealloc = npages > 15;
|
||||
int pass = 0;
|
||||
unsigned long align_mask;
|
||||
unsigned long boundary_size;
|
||||
unsigned long flags;
|
||||
unsigned int pool_nr;
|
||||
struct iommu_pool *pool;
|
||||
@@ -236,15 +235,9 @@ again:
|
||||
}
|
||||
}
|
||||
|
||||
if (dev)
|
||||
boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,
|
||||
1 << tbl->it_page_shift);
|
||||
else
|
||||
boundary_size = ALIGN(1UL << 32, 1 << tbl->it_page_shift);
|
||||
/* 4GB boundary for iseries_hv_alloc and iseries_hv_map */
|
||||
|
||||
n = iommu_area_alloc(tbl->it_map, limit, start, npages, tbl->it_offset,
|
||||
boundary_size >> tbl->it_page_shift, align_mask);
|
||||
dma_get_seg_boundary_nr_pages(dev, tbl->it_page_shift),
|
||||
align_mask);
|
||||
if (n == -1) {
|
||||
if (likely(pass == 0)) {
|
||||
/* First try the pool from the start */
|
||||
|
||||
Reference in New Issue
Block a user