_global_coherent(get_order(size),
> -cpu_addr);
> -
> - WARN_ON_ONCE(ret == 0);
> - }
> + int ret = dma_release_from_global_coherent(get_order(size), cpu_addr);
>
> - return;
> + WA
ges(page, page_order);
> + page = NULL;
> +
> + if (dev->coherent_dma_mask < DMA_BIT_MASK(32) &&
> + !(gfp & GFP_DMA)) {
> + gfp = (gfp & ~GFP_DMA32) | GFP_DMA;
> + got
On 10/01/18 08:00, Christoph Hellwig wrote:
> index 9110988b92a1..f00833acb626 100644
> --- a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
> +++ b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
> @@ -61,6 +61,14 @@ static inline void plat_post_dma_flush(struct device *dev)
>
ze_t
> size,
> return page_address(page);
> }
>
> -static void dma_direct_free(struct device *dev, size_t size, void *cpu_addr,
> +void dma_direct_free(struct device *dev, size_t size, void *cpu_addr,
> dma_addr_t dma_addr, unsigned long attrs)
> {
> unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT;
>
Reviewed-by: Vladimir Murzin
Thanks
Vladimir
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
On 29/12/17 08:18, Christoph Hellwig wrote:
> If we got back an allocation that wasn't inside the support coherent mask,
> retry the allocation using GFP_DMA.
>
> Based on the x86 code.
>
> Signed-off-by: Christoph Hellwig
> ---
> lib/dma-direct.c | 25 -
> 1 file change
g));
> - va = sg_virt(sg);
> - sg_dma_address(sg) = (dma_addr_t)virt_to_phys(va) - offset;
> +
> + sg_dma_address(sg) = phys_to_dma(dev, sg_phys(sg));
> sg_dma_len(sg) = sg->length;
> }
>
>
>From ARM NO
tion dir, unsigned long attrs)
> {
> int i;
> struct scatterlist *sg;
> @@ -58,12 +54,11 @@ static int dma_noop_map_sg(struct device *dev, struct
> scatterlist *sgl, int nent
> return nents;
> }
>
> -const struct dma_map_ops dma_noop_ops = {
> - .alloc = dma_noop_alloc,
> - .free = dma_noop_free,
> - .map_page = dma_noop_map_page,
> - .map_sg = dma_noop_map_sg,
> +const struct dma_map_ops dma_direct_ops = {
> + .alloc = dma_direct_alloc,
> + .free = dma_direct_free,
> + .map_page = dma_direct_map_page,
> + .map_sg = dma_direct_map_sg,
> .is_phys= true,
> };
> -
> -EXPORT_SYMBOL(dma_noop_ops);
> +EXPORT_SYMBOL(dma_direct_ops);
>
>From ARM NOMMU perspective
Reviewed-by: Vladimir Murzin
Thanks
Vladimir
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
On 29/12/17 08:18, Christoph Hellwig wrote:
> Almost every architecture supports a direct dma mapping implementation,
> where no iommu is used and the device dma address is a 1:1 mapping to
> the physical address or has a simple linear offset. Currently the
> code for this implementation is most d