Re: [PATCH] arm64: dma-mapping: fix dma_to_phys API for IOMMU attached devices

2016-03-19 Thread Sinan Kaya
On 3/17/2016 12:14 PM, Arnd Bergmann wrote: > On Thursday 17 March 2016 12:07:26 Sinan Kaya wrote: >> On 3/17/2016 11:57 AM, Robin Murphy wrote: >> >> Let me know which direction I should go. >> >> 1. Fix phys_to_dma and keep dma_to_phys as in the patch. >> 2. Remove both of the API from header

Re: [PATCH] arm64: dma-mapping: fix dma_to_phys API for IOMMU attached devices

2016-03-19 Thread Sinan Kaya
On 3/17/2016 12:14 PM, Arnd Bergmann wrote: > On Thursday 17 March 2016 12:07:26 Sinan Kaya wrote: >> On 3/17/2016 11:57 AM, Robin Murphy wrote: >> >> Let me know which direction I should go. >> >> 1. Fix phys_to_dma and keep dma_to_phys as in the patch. >> 2. Remove both of the API from header

[PATCH] arm64: dma-mapping: fix dma_to_phys API for IOMMU attached devices

2016-03-19 Thread Sinan Kaya
This patch modifies dma_to_phys to call iommu_iova_to_phys to perform dma to phys conversions for IOMMU attached devices where dma and physical addresses often have distinct values. Signed-off-by: Nate Watterson Signed-off-by: Sinan Kaya ---

[PATCH] arm64: dma-mapping: fix dma_to_phys API for IOMMU attached devices

2016-03-19 Thread Sinan Kaya
This patch modifies dma_to_phys to call iommu_iova_to_phys to perform dma to phys conversions for IOMMU attached devices where dma and physical addresses often have distinct values. Signed-off-by: Nate Watterson Signed-off-by: Sinan Kaya --- arch/arm64/include/asm/dma-mapping.h | 5 +

Re: [PATCH] arm64: dma-mapping: fix dma_to_phys API for IOMMU attached devices

2016-03-19 Thread Arnd Bergmann
On Thursday 17 March 2016 12:07:26 Sinan Kaya wrote: > On 3/17/2016 11:57 AM, Robin Murphy wrote: > > Let me know which direction I should go. > > 1. Fix phys_to_dma and keep dma_to_phys as in the patch. > 2. Remove both of the API from header file, move it to where it is needed. > Rename them

Re: [PATCH] arm64: dma-mapping: fix dma_to_phys API for IOMMU attached devices

2016-03-19 Thread Arnd Bergmann
On Thursday 17 March 2016 12:07:26 Sinan Kaya wrote: > On 3/17/2016 11:57 AM, Robin Murphy wrote: > > Let me know which direction I should go. > > 1. Fix phys_to_dma and keep dma_to_phys as in the patch. > 2. Remove both of the API from header file, move it to where it is needed. > Rename them

Re: [PATCH] arm64: dma-mapping: fix dma_to_phys API for IOMMU attached devices

2016-03-19 Thread Robin Murphy
On 17/03/16 15:50, Sinan Kaya wrote: This patch modifies dma_to_phys to call iommu_iova_to_phys to perform dma to phys conversions for IOMMU attached devices where dma and physical addresses often have distinct values. What's this for? dma_to_phys() is only used by SWIOTLB, and that's

Re: [PATCH] arm64: dma-mapping: fix dma_to_phys API for IOMMU attached devices

2016-03-19 Thread Robin Murphy
On 17/03/16 15:50, Sinan Kaya wrote: This patch modifies dma_to_phys to call iommu_iova_to_phys to perform dma to phys conversions for IOMMU attached devices where dma and physical addresses often have distinct values. What's this for? dma_to_phys() is only used by SWIOTLB, and that's

Re: [PATCH] arm64: dma-mapping: fix dma_to_phys API for IOMMU attached devices

2016-03-19 Thread Sinan Kaya
On 3/17/2016 11:57 AM, Robin Murphy wrote: >> This patch modifies dma_to_phys to call iommu_iova_to_phys to perform dma >> to phys conversions for IOMMU attached devices where dma and physical >> addresses often have distinct values. > > What's this for? dma_to_phys() is only used by SWIOTLB, and

Re: [PATCH] arm64: dma-mapping: fix dma_to_phys API for IOMMU attached devices

2016-03-19 Thread Sinan Kaya
On 3/17/2016 11:57 AM, Robin Murphy wrote: >> This patch modifies dma_to_phys to call iommu_iova_to_phys to perform dma >> to phys conversions for IOMMU attached devices where dma and physical >> addresses often have distinct values. > > What's this for? dma_to_phys() is only used by SWIOTLB, and

Re: [PATCH] arm64: dma-mapping: fix dma_to_phys API for IOMMU attached devices

2016-03-18 Thread Arnd Bergmann
On Thursday 17 March 2016 12:36:28 Sinan Kaya wrote: > > The first solution that comes to my mind is to implement a weak function in > swiotlb.c with these contents > > dma_addr_t __weak swio_phys_to_dma(struct device *dev, phys_addr_t paddr) > { > return paddr; > } > > > phys_addr_t

Re: [PATCH] arm64: dma-mapping: fix dma_to_phys API for IOMMU attached devices

2016-03-18 Thread Arnd Bergmann
On Thursday 17 March 2016 12:36:28 Sinan Kaya wrote: > > The first solution that comes to my mind is to implement a weak function in > swiotlb.c with these contents > > dma_addr_t __weak swio_phys_to_dma(struct device *dev, phys_addr_t paddr) > { > return paddr; > } > > > phys_addr_t