Subject: Re: [PATCH] powerpc: Fix swiotlb ops for ppc64

From: Benjamin Herrenschmidt <[email-masked]>
Date: Thu, 08 Dec 2011 14:23:20 +1100

On Wed, 2011-12-07 at 11:19 -0600, Kumar Gala wrote:

>  struct dma_map_ops swiotlb_dma_ops = {
> +#ifdef CONFIG_PPC64
> +	.alloc_coherent = swiotlb_alloc_coherent,
> +	.free_coherent = swiotlb_free_coherent,
> +#else
>  	.alloc_coherent = dma_direct_alloc_coherent,
>  	.free_coherent = dma_direct_free_coherent,
> +#endif
>  	.map_sg = swiotlb_map_sg_attrs,
>  	.unmap_sg = swiotlb_unmap_sg_attrs,
>  	.dma_supported = swiotlb_dma_supported,

Do we really need the ifdef ? What happens if we use
swiotlb_alloc_coherent() on ppc32 ? Won't it allocate lowmem, realize
that it doesn't need bouncing and be happy ?

Cheers,
Ben.