|
@@ -558,7 +558,7 @@ static void *__iommu_alloc_attrs(struct device *dev, size_t size,
|
|
|
unsigned long attrs)
|
|
|
{
|
|
|
bool coherent = is_device_dma_coherent(dev);
|
|
|
- int ioprot = dma_direction_to_prot(DMA_BIDIRECTIONAL, coherent);
|
|
|
+ int ioprot = dma_info_to_prot(DMA_BIDIRECTIONAL, coherent, attrs);
|
|
|
size_t iosize = size;
|
|
|
void *addr;
|
|
|
|
|
@@ -712,7 +712,7 @@ static dma_addr_t __iommu_map_page(struct device *dev, struct page *page,
|
|
|
unsigned long attrs)
|
|
|
{
|
|
|
bool coherent = is_device_dma_coherent(dev);
|
|
|
- int prot = dma_direction_to_prot(dir, coherent);
|
|
|
+ int prot = dma_info_to_prot(dir, coherent, attrs);
|
|
|
dma_addr_t dev_addr = iommu_dma_map_page(dev, page, offset, size, prot);
|
|
|
|
|
|
if (!iommu_dma_mapping_error(dev, dev_addr) &&
|
|
@@ -770,7 +770,7 @@ static int __iommu_map_sg_attrs(struct device *dev, struct scatterlist *sgl,
|
|
|
__iommu_sync_sg_for_device(dev, sgl, nelems, dir);
|
|
|
|
|
|
return iommu_dma_map_sg(dev, sgl, nelems,
|
|
|
- dma_direction_to_prot(dir, coherent));
|
|
|
+ dma_info_to_prot(dir, coherent, attrs));
|
|
|
}
|
|
|
|
|
|
static void __iommu_unmap_sg_attrs(struct device *dev,
|