powerpc/dma: Use the struct dma_attrs in iommu code
Update iommu_alloc() to take the struct dma_attrs and pass them on to tce_build(). This change propagates down to the tce_build functions of all the platforms. Signed-off-by: Mark Nelson <markn@au1.ibm.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:

committed by
Benjamin Herrenschmidt

parent
4795b7801b
commit
4f3dd8a062
@@ -186,7 +186,8 @@ static unsigned long iommu_range_alloc(struct device *dev,
|
||||
static dma_addr_t iommu_alloc(struct device *dev, struct iommu_table *tbl,
|
||||
void *page, unsigned int npages,
|
||||
enum dma_data_direction direction,
|
||||
unsigned long mask, unsigned int align_order)
|
||||
unsigned long mask, unsigned int align_order,
|
||||
struct dma_attrs *attrs)
|
||||
{
|
||||
unsigned long entry, flags;
|
||||
dma_addr_t ret = DMA_ERROR_CODE;
|
||||
@@ -205,7 +206,7 @@ static dma_addr_t iommu_alloc(struct device *dev, struct iommu_table *tbl,
|
||||
|
||||
/* Put the TCEs in the HW table */
|
||||
ppc_md.tce_build(tbl, entry, npages, (unsigned long)page & IOMMU_PAGE_MASK,
|
||||
direction);
|
||||
direction, attrs);
|
||||
|
||||
|
||||
/* Flush/invalidate TLB caches if necessary */
|
||||
@@ -336,7 +337,8 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
|
||||
npages, entry, dma_addr);
|
||||
|
||||
/* Insert into HW table */
|
||||
ppc_md.tce_build(tbl, entry, npages, vaddr & IOMMU_PAGE_MASK, direction);
|
||||
ppc_md.tce_build(tbl, entry, npages, vaddr & IOMMU_PAGE_MASK,
|
||||
direction, attrs);
|
||||
|
||||
/* If we are in an open segment, try merging */
|
||||
if (segstart != s) {
|
||||
@@ -573,7 +575,8 @@ dma_addr_t iommu_map_single(struct device *dev, struct iommu_table *tbl,
|
||||
align = PAGE_SHIFT - IOMMU_PAGE_SHIFT;
|
||||
|
||||
dma_handle = iommu_alloc(dev, tbl, vaddr, npages, direction,
|
||||
mask >> IOMMU_PAGE_SHIFT, align);
|
||||
mask >> IOMMU_PAGE_SHIFT, align,
|
||||
attrs);
|
||||
if (dma_handle == DMA_ERROR_CODE) {
|
||||
if (printk_ratelimit()) {
|
||||
printk(KERN_INFO "iommu_alloc failed, "
|
||||
@@ -642,7 +645,7 @@ void *iommu_alloc_coherent(struct device *dev, struct iommu_table *tbl,
|
||||
nio_pages = size >> IOMMU_PAGE_SHIFT;
|
||||
io_order = get_iommu_order(size);
|
||||
mapping = iommu_alloc(dev, tbl, ret, nio_pages, DMA_BIDIRECTIONAL,
|
||||
mask >> IOMMU_PAGE_SHIFT, io_order);
|
||||
mask >> IOMMU_PAGE_SHIFT, io_order, NULL);
|
||||
if (mapping == DMA_ERROR_CODE) {
|
||||
free_pages((unsigned long)ret, order);
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user