lkml.org 
[lkml]   [2019]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/9] iommu/dma-iommu: Add iommu_dma_map_page_coherent
> @@ -693,7 +694,19 @@ dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page,
> unsigned long offset, size_t size, int prot)
> {
> return __iommu_dma_map(dev, page_to_phys(page) + offset, size, prot,
> - iommu_get_dma_domain(dev));
> + iommu_get_dma_domain(dev), dma_get_mask(dev));
> +}
> +
> +dma_addr_t iommu_dma_map_page_coherent(struct device *dev, struct page *page,
> + unsigned long offset, size_t size, int prot)
> +{

Note that my tree pointed to above removes the iommu_dma_map_page
wrapper. I think for the coherent mappign we should also just
call __iommu_dma_map directly and not introduce another wrapper.

> + dma_addr_t dma_mask = dev->coherent_dma_mask;
> +
> + if (!dma_mask)
> + dma_mask = dma_get_mask(dev);
> +
> + return __iommu_dma_map(dev, page_to_phys(page) + offset, size, prot,
> + iommu_get_dma_domain(dev), dma_mask);
> }

In the DMA API there is no fallback when the coherent_dma_mask is not
set. While various bits of legacy code do that we should not copy it
to new code.

\
 
 \ /
  Last update: 2019-04-15 08:34    [W:0.110 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site