Fix dma mapping when the cache is coherent
Subsystems (2)
v6 cover Fix dma mapping when the cache is coherent
Hi,
These two patches fixes the dma mapping functions when the system is cache coherent. The first one allows to fix an issue we have on Armada 375/38x with the PL310 that's why it is tagged for stable too.
I didn't got any feedback on the fifth version 5 monthsago, and then I forgot to submit it to Russell patch system. In the meantime, there was many changes in the arch/arm/mm/dma-mapping.c file. So I had to rework the patch that's why I removed the reviewed flag from Catalin.
The last version was posted here:
http://thread.gmane.org/gmane.linux.ports.arm.kernel/446603
Thanks,
Gregory
Changelog
v5 -> v6:
- Rebased on v4.6-rc1
v4 -> v5
- Keep the dmac_* function outside the !is_coherent case.
v3 -> v4:
- Rebased on v4.3-rc1
- Fix conflict with commit "21caf3a765b0 ARM: 8398/1: arm DMA: Fix allocation from CMA for coherent DMA"
v2 -> v3:
- Fix comments in patch 1 as suggested by Catalin.
- Fix build issues in patch 2 (by using the multi_v7_defconfig + CONFIG_ROCKCHIP_IOMMU).
- Add the arm_coherent_iommu_mmap_attrs function.
Gregory CLEMENT (2):
ARM: dma-mapping: Don't use outer_flush_range when the L2C is coherent
ARM: dma-mapping: Fix the coherent case when iommu is used
arch/arm/mm/dma-mapping.c | 144 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 101 insertions(+), 43 deletions(-)
Signature · 1 line
2.5.0
PATCH v6 1/2 ARM: dma-mapping: Don't use outer_flush_range when the L2C is coherent
When a L2 cache controller is used in a system that provides hardware coherency, the entire outer cache operations are useless, and can be skipped. Moreover, on some systems, it is harmful as it causes deadlocks between the Marvell coherency mechanism, the Marvell PCIe controller and the Cortex-A9.
In the current kernel implementation, the outer cache flush range operation is triggered by the dma_alloc function.
This operation can be take place during runtime and in some circumstances may lead to the PCIe/PL310 deadlock on Armada 375/38x SoCs.
This patch extends the __dma_clear_buffer() function to receive a boolean argument related to the coherency of the system. The same things is done for the calling functions.
--- arch/arm/mm/dma-mapping.c | 63 +++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 24 deletions(-)
arch/arm/mm/dma-mapping.c +39 -24
@@ -61,7 +61,7 @@ struct arm_dma_free_args {struct arm_dma_allocator {void *(*alloc)(struct arm_dma_alloc_args *args, -struct page **ret_page); +struct page **ret_page,bool is_coherent);void (*free)(struct arm_dma_free_args *args); };
@@ -274,7 +274,7 @@ static u64 get_coherent_dma_mask(struct device *dev)return mask; } -static void __dma_clear_buffer (struct page *page,size_t size) +static void __dma_clear_buffer (struct page *page,size_t size,bool is_coherent) {/* * Ensure that the allocated pages are zeroed, and that any data
@@ -291,12 +291,14 @@ static void __dma_clear_buffer(struct page *page, size_t size) page++; size -=PAGE_SIZE ; } -outer_flush_range (base, end); +if (!is_coherent) +outer_flush_range (base, end); }else {void *ptr =page_address (page);memset (ptr,0 , size);dmac_flush_range (ptr, ptr + size); -outer_flush_range (__pa (ptr),__pa (ptr) + size); +if (!is_coherent) +outer_flush_range (__pa (ptr),__pa (ptr) + size); } }
@@ -304,7 +306,8 @@ static void __dma_clear_buffer(struct page *page, size_t size)* Allocate a DMA buffer for 'dev' of size 'size' using the * specified gfp mask. Note that 'size' must be page aligned. */ -static struct page *__dma_alloc_buffer (struct device *dev,size_t size,gfp_t gfp) +static struct page *__dma_alloc_buffer (struct device *dev,size_t size, +gfp_t gfp,bool is_coherent) {unsigned long order =get_order (size);struct page *page, *p, *e;
@@ -320,7 +323,7 @@ static struct page *__dma_alloc_buffer(struct device *dev, size_t size, gfp_t gffor (p = page + (size >>PAGE_SHIFT ), e = page + (1 << order); p < e; p++)__free_page (p); -__dma_clear_buffer (page, size); +__dma_clear_buffer (page, size, is_coherent);return page; }
@@ -342,7 +345,8 @@ static void __dma_free_buffer(struct page *page, size_t size)static void *__alloc_from_contiguous (struct device *dev,size_t size,pgprot_t prot,struct page **ret_page, -const void *caller,bool want_vaddr); +const void *caller,bool want_vaddr, +bool is_coherent); static void *__alloc_remap_buffer(struct device *dev, size_t size, gfp_t gfp, pgprot_t prot, struct page **ret_page,
@@ -407,10 +411,13 @@ static int __init atomic_pool_init(void) atomic_pool =gen_pool_create (PAGE_SHIFT ,-1 );if (!atomic_pool) goto out; - +/* +* The atomic pool is only used for non-coherent allocations +* so we must pass false for is_coherent. +*/ if (dev_get_cma_area (NULL )) ptr =__alloc_from_contiguous (NULL , atomic_pool_size, prot, - &page, atomic_pool_init, true); + &page, atomic_pool_init, true, false);else ptr =__alloc_remap_buffer (NULL , atomic_pool_size, gfp, prot, &page, atomic_pool_init, true);
@@ -524,7 +531,11 @@ static void *__alloc_remap_buffer(struct device *dev, size_t size, gfp_t gfp, {struct page *page;void *ptr =NULL ; - page =__dma_alloc_buffer (dev, size, gfp); +/* +* __alloc_remap_buffer is only called when the device is +* non-coherent +*/ + page =__dma_alloc_buffer (dev, size, gfp, false);if (!page)return NULL ;if (!want_vaddr)
@@ -579,7 +590,8 @@ static int __free_from_pool(void *start, size_t size)static void *__alloc_from_contiguous (struct device *dev,size_t size,pgprot_t prot,struct page **ret_page, -const void *caller,bool want_vaddr) +const void *caller,bool want_vaddr, +bool is_coherent) {unsigned long order =get_order (size);size_t count = size >>PAGE_SHIFT ;
@@ -590,7 +602,7 @@ static void *__alloc_from_contiguous(struct device *dev, size_t size,if (!page)return NULL ; -__dma_clear_buffer (page, size); +__dma_clear_buffer (page, size, is_coherent);if (!want_vaddr) goto out;
@@ -640,7 +652,7 @@ static inline pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot)#define __get_dma_pgprot (attrs, prot) __pgprot(0)#define __alloc_remap_buffer (dev, size, gfp, prot, ret, c, wv) NULL#define __alloc_from_pool (size, ret_page) NULL -#define __alloc_from_contiguous (dev, size, prot, ret, c, wv) NULL +#define __alloc_from_contiguous (dev, size, prot, ret, c, wv, is_coherent) NULL#define __free_from_pool (cpu_addr, size) do { } while (0)#define __free_from_contiguous (dev, page, cpu_addr, size, wv) do { } while (0)#define __dma_free_remap (cpu_addr, size) do { } while (0)
@@ -651,7 +663,8 @@ static void *__alloc_simple_buffer(struct device *dev, size_t size, gfp_t gfp, struct page **ret_page) {struct page *page; - page =__dma_alloc_buffer (dev, size, gfp); +/* __alloc_simple_buffer is only called when the device is coherent */ + page =__dma_alloc_buffer (dev, size, gfp, true);if (!page)return NULL ;
@@ -660,7 +673,7 @@ static void *__alloc_simple_buffer(struct device *dev, size_t size, gfp_t gfp, }static void *simple_allocator_alloc (struct arm_dma_alloc_args *args, -struct page **ret_page) +struct page **ret_page,bool is_coherent) {return __alloc_simple_buffer (args->dev, args->size, args->gfp, ret_page);
@@ -677,11 +690,11 @@ static struct arm_dma_allocator simple_allocator = { };static void *cma_allocator_alloc (struct arm_dma_alloc_args *args, -struct page **ret_page) +struct page **ret_page,bool is_coherent) {return __alloc_from_contiguous (args->dev, args->size, args->prot, ret_page, args->caller, - args->want_vaddr); + args->want_vaddr, is_coherent); }static void cma_allocator_free (struct arm_dma_free_args *args)
@@ -696,7 +709,7 @@ static struct arm_dma_allocator cma_allocator = { };static void *pool_allocator_alloc (struct arm_dma_alloc_args *args, -struct page **ret_page) +struct page **ret_page,bool is_coherent) {return __alloc_from_pool (args->size, ret_page); }
@@ -712,7 +725,7 @@ static struct arm_dma_allocator pool_allocator = { };static void *remap_allocator_alloc (struct arm_dma_alloc_args *args, -struct page **ret_page) +struct page **ret_page,bool is_coherent) { return __alloc_remap_buffer(args->dev, args->size, args->gfp, args->prot, ret_page, args->caller,
@@ -792,7 +805,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,else buf->allocator = &pool_allocator; - addr = buf->allocator->alloc (&args, &page); + addr = buf->allocator->alloc (&args, &page, is_coherent);if (page) {unsigned long flags;
@@ -1264,7 +1277,8 @@ static inline void __free_iova(struct dma_iommu_mapping *mapping,static const int iommu_order_array[] = {9 ,8 ,4 ,0 };static struct page **__iommu_alloc_buffer (struct device *dev,size_t size, -gfp_t gfp,struct dma_attrs *attrs) +gfp_t gfp,struct dma_attrs *attrs, +bool is_coherent) {struct page **pages;int count = size >>PAGE_SHIFT ;
@@ -1288,7 +1302,7 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size,if (!page) goto error; -__dma_clear_buffer (page, size); +__dma_clear_buffer (page, size, is_coherent);for (i =0 ; i < count; i++) pages[i] = page + i;
@@ -1338,7 +1352,7 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size, pages[i + j] = pages[i] + j; } -__dma_clear_buffer (pages[i],PAGE_SIZE << order); +__dma_clear_buffer (pages[i],PAGE_SIZE << order, is_coherent); i +=1 << order; count -=1 << order; }
@@ -1516,7 +1530,8 @@ static void *arm_iommu_alloc_attrs(struct device *dev, size_t size,*/ gfp &= ~(__GFP_COMP); - pages =__iommu_alloc_buffer (dev, size, gfp, attrs); +/* For now always consider we are in a non-coherent case */ + pages =__iommu_alloc_buffer (dev, size, gfp, attrs, false);if (!pages)return NULL ;
Signature · 1 line
2.5.0
PATCH v6 1/2 ARM: dma-mapping: Don't use outer_flush_range when the L2C is coherent
arch/arm/mm/dma-mapping.c struct arm_dma_free_args { · line 64
Quoted 10 lines · Gregory CLEMENT
arch/arm/mm/dma-mapping.c +1
-1@@ -61,7 +61,7 @@ struct arm_dma_free_args {struct arm_dma_allocator {void *(*alloc)(struct arm_dma_alloc_args *args, -struct page **ret_page); +struct page **ret_page,bool is_coherent);
This should be named "l2_coherent" because it controls whether L2 cache flushing is done: L1 cache flushing calls are still present.
Signature · 3 lines
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.
PATCH v6 1/2 ARM: dma-mapping: Don't use outer_flush_range when the L2C is coherent
Hi Russell King,
Quoted 7 lines · Russell King - ARM Linux
Quoted 6 lines · Gregory CLEMENT
arch/arm/mm/dma-mapping.c +0
-0@@ -61,7 +61,7 @@ struct arm_dma_free_args {
Quoted 7 lines
arch/arm/mm/dma-mapping.c struct arm_dma_free_args { · line 64
Quoted 4 lines
arch/arm/mm/dma-mapping.c +1
-1struct arm_dma_allocator {void *(*alloc)(struct arm_dma_alloc_args *args, -struct page **ret_page); +struct page **ret_page,bool is_coherent);This should be named "
l2_coherent" because it controls whether L2 cache flushing is done: L1 cache flushing calls are still present.
I've just sent a new version taking into account your remark.
Thanks,
Gregory
Quoted 5 lines
Signature · 4 lines
-- RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.
Signature · 4 lines
Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v6 1/2 ARM: dma-mapping: Don't use outer_flush_range when the L2C is coherent
In reply to Gregory CLEMENTarch/arm/mm/dma-mapping.c struct arm_dma_free_args { · line 66
Quoted 12 lines · Gregory CLEMENT
arch/arm/mm/dma-mapping.c +1
-1@@ -61,7 +61,7 @@ struct arm_dma_free_args {struct arm_dma_allocator {void *(*alloc)(struct arm_dma_alloc_args *args, -struct page **ret_page); +struct page **ret_page,bool is_coherent);void (*free)(struct arm_dma_free_args *args); };
Could you please add this parameter to the arm_dma_alloc_args structure instead? As you see from the code, that's where all the other various parameters needed by the allocators are grouped.
PATCH v6 1/2 ARM: dma-mapping: Don't use outer_flush_range when the L2C is coherent
Hi Rabin,
Quoted 7 lines · Rabin Vincent
Quoted 6 lines · Gregory CLEMENT
arch/arm/mm/dma-mapping.c +0
-0@@ -61,7 +61,7 @@ struct arm_dma_free_args {
Quoted 10 lines
arch/arm/mm/dma-mapping.c struct arm_dma_free_args { · line 66
Quoted 6 lines
arch/arm/mm/dma-mapping.c +1
-1struct arm_dma_allocator {void *(*alloc)(struct arm_dma_alloc_args *args, -struct page **ret_page); +struct page **ret_page,bool is_coherent);void (*free)(struct arm_dma_free_args *args); };Could you please add this parameter to the
arm_dma_alloc_argsstructure instead? As you see from the code, that's where all the other various parameters needed by the allocators are grouped.
I will do it inthe 8th version, it indeed simplify a little the patch.
Thanks,
Gregory
Signature · 4 lines
Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v6 2/2 ARM: dma-mapping: Fix the coherent case when iommu is used
In reply to Gregory CLEMENTWhen doing dma allocation with IOMMU the __iommu_alloc_atomic() was used even when the system was coherent. However, this function allocates from a non-cacheable pool, which is fine when the device is not cache coherent but won't work as expected in the device is cache coherent. Indeed, the CPU and device must access the memory using the same cacheability attributes.
Moreover when the devices are coherent, the mmap call must not change the pg_prot flags in the vma struct. The arm_coherent_iommu_mmap_attrs has been updated in the same way that it was done for the arm_dma_mmap in commit 55af8a91640d ("ARM: 8387/1: arm/mm/dma-mapping.c: Add arm_coherent_dma_mmap").
--- arch/arm/mm/dma-mapping.c | 85 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 64 insertions(+), 21 deletions(-)
arch/arm/mm/dma-mapping.c +64 -21
@@ -1480,13 +1480,16 @@ static struct page **__iommu_get_pages(void *cpu_addr, struct dma_attrs *attrs)return NULL ; } -static void *__iommu_alloc_atomic (struct device *dev,size_t size, -dma_addr_t *handle) +static void *__iommu_alloc_simple (struct device *dev,size_t size,gfp_t gfp, +dma_addr_t *handle,bool is_coherent) {struct page *page;void *addr; - addr =__alloc_from_pool (size, &page); +if (is_coherent) + addr =__alloc_simple_buffer (dev, size, gfp, &page); +else + addr =__alloc_from_pool (size, &page);if (!addr)return NULL ;
@@ -1502,14 +1505,18 @@ err_mapping: }static void __iommu_free_atomic (struct device *dev,void *cpu_addr, -dma_addr_t handle,size_t size) +dma_addr_t handle,size_t size,bool is_coherent) {__iommu_remove_mapping (dev, handle, size); -__free_from_pool (cpu_addr, size); +if (!is_coherent) +__dma_free_buffer (virt_to_page (cpu_addr), size); +else +__free_from_pool (cpu_addr, size); } -static void *arm_iommu_alloc_attrs (struct device *dev,size_t size, -dma_addr_t *handle,gfp_t gfp,struct dma_attrs *attrs) +static void *__arm_iommu_alloc_attrs (struct device *dev,size_t size, +dma_addr_t *handle,gfp_t gfp,struct dma_attrs *attrs, +bool is_coherent) {pgprot_t prot =__get_dma_pgprot (attrs,PAGE_KERNEL );struct page **pages;
@@ -1518,8 +1525,8 @@ static void *arm_iommu_alloc_attrs(struct device *dev, size_t size, *handle =DMA_ERROR_CODE ; size =PAGE_ALIGN (size); -if (!gfpflags_allow_blocking (gfp)) -return __iommu_alloc_atomic (dev, size, handle); +if (is_coherent || !gfpflags_allow_blocking (gfp)) +return __iommu_alloc_simple (dev, size, gfp, handle, is_coherent);/* * Following is a work-around (a.k.a. hack) to prevent pages
@@ -1530,8 +1537,7 @@ static void *arm_iommu_alloc_attrs(struct device *dev, size_t size,*/ gfp &= ~(__GFP_COMP); -/* For now always consider we are in a non-coherent case */ - pages =__iommu_alloc_buffer (dev, size, gfp, attrs, false); + pages =__iommu_alloc_buffer (dev, size, gfp, attrs, is_coherent);if (!pages)return NULL ;
@@ -1556,7 +1562,19 @@ err_buffer:return NULL ; } -static int arm_iommu_mmap_attrs (struct device *dev,struct vm_area_struct *vma, +static void *arm_iommu_alloc_attrs (struct device *dev,size_t size, +dma_addr_t *handle,gfp_t gfp,struct dma_attrs *attrs) +{ +return __arm_iommu_alloc_attrs (dev, size, handle, gfp, attrs, false); +} + +static void *arm_coherent_iommu_alloc_attrs (struct device *dev,size_t size, +dma_addr_t *handle,gfp_t gfp,struct dma_attrs *attrs) +{ +return __arm_iommu_alloc_attrs (dev, size, handle, gfp, attrs, true); +} + +static int __arm_iommu_mmap_attrs (struct device *dev,struct vm_area_struct *vma,void *cpu_addr,dma_addr_t dma_addr,size_t size,struct dma_attrs *attrs) {
@@ -1566,8 +1584,6 @@ static int arm_iommu_mmap_attrs(struct device *dev, struct vm_area_struct *vma,unsigned long nr_pages =PAGE_ALIGN (size) >>PAGE_SHIFT ;unsigned long off = vma->vm_pgoff; - vma->vm_page_prot =__get_dma_pgprot (attrs, vma->vm_page_prot); -if (!pages)return -ENXIO ;
@@ -1588,19 +1604,34 @@ static int arm_iommu_mmap_attrs(struct device *dev, struct vm_area_struct *vma,return 0 ; } +static int arm_iommu_mmap_attrs (struct device *dev, +struct vm_area_struct *vma,void *cpu_addr, +dma_addr_t dma_addr,size_t size,struct dma_attrs *attrs) +{ + vma->vm_page_prot =__get_dma_pgprot (attrs, vma->vm_page_prot); + +return __arm_iommu_mmap_attrs (dev, vma, cpu_addr, dma_addr, size, attrs); +} + +static int arm_coherent_iommu_mmap_attrs (struct device *dev, +struct vm_area_struct *vma,void *cpu_addr, +dma_addr_t dma_addr,size_t size,struct dma_attrs *attrs) +{ +return __arm_iommu_mmap_attrs (dev, vma, cpu_addr, dma_addr, size, attrs); +}/* * free a page as defined by the above mapping. * Must not be called with IRQs disabled. */ -void arm_iommu_free_attrs (struct device *dev,size_t size,void *cpu_addr, -dma_addr_t handle,struct dma_attrs *attrs) +void __arm_iommu_free_attrs (struct device *dev,size_t size,void *cpu_addr, +dma_addr_t handle,struct dma_attrs *attrs,bool is_coherent) {struct page **pages; size =PAGE_ALIGN (size); -if (__in_atomic_pool (cpu_addr, size)) { -__iommu_free_atomic (dev, cpu_addr, handle, size); +if (is_coherent ||__in_atomic_pool (cpu_addr, size)) { +__iommu_free_atomic (dev, cpu_addr, handle, size, is_coherent);return ; }
@@ -1619,6 +1650,18 @@ void arm_iommu_free_attrs(struct device *dev, size_t size, void *cpu_addr,__iommu_free_buffer (dev, pages, size, attrs); } +void arm_iommu_free_attrs (struct device *dev,size_t size, +void *cpu_addr,dma_addr_t handle,struct dma_attrs *attrs) +{ +__arm_iommu_free_attrs (dev, size, cpu_addr, handle, attrs, false); +} + +void arm_coherent_iommu_free_attrs (struct device *dev,size_t size, +void *cpu_addr,dma_addr_t handle,struct dma_attrs *attrs) +{ +__arm_iommu_free_attrs (dev, size, cpu_addr, handle, attrs, true); +} +static int arm_iommu_get_sgtable (struct device *dev,struct sg_table *sgt,void *cpu_addr,dma_addr_t dma_addr,size_t size,struct dma_attrs *attrs)
@@ -2025,9 +2068,9 @@ struct dma_map_ops iommu_ops = { };struct dma_map_ops iommu_coherent_ops = { - .alloc = arm_iommu_alloc_attrs, - .free = arm_iommu_free_attrs, - .mmap = arm_iommu_mmap_attrs, + .alloc = arm_coherent_iommu_alloc_attrs, + .free = arm_coherent_iommu_free_attrs, + .mmap = arm_coherent_iommu_mmap_attrs, .get_sgtable = arm_iommu_get_sgtable, .map_page = arm_coherent_iommu_map_page,
Signature · 1 line
2.5.0
v6 cover Fix dma mapping when the cache is coherent
In reply to Gregory CLEMENTHi Gregory,
With the patches an issue with SoC hang in under-stress MTU change test of network is no longer a problem. If you wish you can add:
Best regards,
Marcin
2016-03-31 11:09 GMT+02:00 Gregory CLEMENT <[email protected]>:
Quoted 46 lines
Hi,
These two patches fixes the dma mapping functions when the system is cache coherent. The first one allows to fix an issue we have on Armada 375/38x with the PL310 that's why it is tagged for stable too.
I didn't got any feedback on the fifth version 5 monthsago, and then I forgot to submit it to Russell patch system. In the meantime, there was many changes in the
arch/arm/mm/dma-mapping.cfile. So I had to rework the patch that's why I removed the reviewed flag from Catalin.The last version was posted here:
http://thread.gmane.org/gmane.linux.ports.arm.kernel/446603Thanks,
Gregory
Changelog
v5 -> v6:
- Rebased on v4.6-rc1v4 -> v5
- Keep the dmac_* function outside the !is_coherent case.v3 -> v4:
- Rebased on v4.3-rc1
- Fix conflict with commit "21caf3a765b0ARM: 8398/1: arm DMA: Fix allocation from CMA for coherent DMA"v2 -> v3:
- Fix comments in patch 1 as suggested by Catalin.
- Fix build issues in patch 2 (by using themulti_v7_defconfig+CONFIG_ROCKCHIP_IOMMU).
- Add thearm_coherent_iommu_mmap_attrsfunction.
Gregory CLEMENT (2):
ARM: dma-mapping: Don't useouter_flush_rangewhen the L2C is coherent
ARM: dma-mapping: Fix the coherent case when iommu is usedarch/arm/mm/dma-mapping.c | 144 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 101 insertions(+), 43 deletions(-)--
2.5.0
v6 cover Fix dma mapping when the cache is coherent
Hi,
Quoted 6 lines · Marcin Wojtas
Hi Gregory,
With the patches an issue with SoC hang in under-stress MTU change test of network is no longer a problem. If you wish you can add:
Tested-by Marcin Wojtas <[email protected]>
I submitted both patches to Russell King's Patch Tracking System.
Thanks,
Gregory
Quoted 51 lines
Best regards,
Marcin2016-03-31 11:09 GMT+02:00 Gregory CLEMENT <[email protected]>:
Quoted 46 lines
Hi,
These two patches fixes the dma mapping functions when the system is cache coherent. The first one allows to fix an issue we have on Armada 375/38x with the PL310 that's why it is tagged for stable too.
I didn't got any feedback on the fifth version 5 monthsago, and then I forgot to submit it to Russell patch system. In the meantime, there was many changes in the
arch/arm/mm/dma-mapping.cfile. So I had to rework the patch that's why I removed the reviewed flag from Catalin.The last version was posted here:
http://thread.gmane.org/gmane.linux.ports.arm.kernel/446603Thanks,
Gregory
Changelog
v5 -> v6:
- Rebased on v4.6-rc1v4 -> v5
- Keep the dmac_* function outside the !is_coherent case.v3 -> v4:
- Rebased on v4.3-rc1
- Fix conflict with commit "21caf3a765b0ARM: 8398/1: arm DMA: Fix allocation from CMA for coherent DMA"v2 -> v3:
- Fix comments in patch 1 as suggested by Catalin.
- Fix build issues in patch 2 (by using themulti_v7_defconfig+CONFIG_ROCKCHIP_IOMMU).
- Add thearm_coherent_iommu_mmap_attrsfunction.
Gregory CLEMENT (2):
ARM: dma-mapping: Don't useouter_flush_rangewhen the L2C is coherent
ARM: dma-mapping: Fix the coherent case when iommu is usedarch/arm/mm/dma-mapping.c | 144 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 101 insertions(+), 43 deletions(-)--
2.5.0
Signature · 4 lines
Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com