From 64bbf9106a386021d71642c6a80982f66f77f5c4 Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Mon, 13 Feb 2012 10:31:31 +0100 Subject: [PATCH] --- yaml --- r: 298623 b: refs/heads/master c: 77345520c465ccb85e4ed2c8ba352a159f60c2e4 h: refs/heads/master i: 298621: 5abd2f7116f10a999b78c3c27c9439f959de3f40 298619: ef14a346323fb0c7171501f922d021fe21f8cb67 298615: 6ab9066d2416ef7d10fa3bd4dabf53be4c410c42 298607: ded9ecf5d6e261fa7f03c847fb39bade8eddfb47 298591: 2c228a283d41415aa84f8e06e7d72518720f0a29 298559: da326033f0402eba88dd8cae18f91b761f55b14f 298495: 68b29a18d9dfc1388252fefb15ebcb6b59487ce4 v: v3 --- [refs] | 2 +- trunk/arch/hexagon/include/asm/dma-mapping.h | 18 ++++++++++++------ trunk/arch/hexagon/kernel/dma.c | 9 +++++---- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 77a97c21416f..361b08b2ffc7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ffc4a3faf74f00b568393b83e08104c70f33869c +refs/heads/master: 77345520c465ccb85e4ed2c8ba352a159f60c2e4 diff --git a/trunk/arch/hexagon/include/asm/dma-mapping.h b/trunk/arch/hexagon/include/asm/dma-mapping.h index 448b224ba4ef..233ed3d2d25e 100644 --- a/trunk/arch/hexagon/include/asm/dma-mapping.h +++ b/trunk/arch/hexagon/include/asm/dma-mapping.h @@ -71,29 +71,35 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) return (dma_addr == bad_dma_address); } -static inline void *dma_alloc_coherent(struct device *dev, size_t size, - dma_addr_t *dma_handle, gfp_t flag) +#define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) + +static inline void *dma_alloc_attrs(struct device *dev, size_t size, + dma_addr_t *dma_handle, gfp_t flag, + struct dma_attrs *attrs) { void *ret; struct dma_map_ops *ops = get_dma_ops(dev); BUG_ON(!dma_ops); - ret = ops->alloc_coherent(dev, size, dma_handle, flag); + ret = ops->alloc(dev, size, dma_handle, flag, attrs); debug_dma_alloc_coherent(dev, size, *dma_handle, ret); return ret; } -static inline void dma_free_coherent(struct device *dev, size_t size, - void *cpu_addr, dma_addr_t dma_handle) +#define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) + +static inline void dma_free_attrs(struct device *dev, size_t size, + void *cpu_addr, dma_addr_t dma_handle, + struct dma_attrs *attrs) { struct dma_map_ops *dma_ops = get_dma_ops(dev); BUG_ON(!dma_ops); - dma_ops->free_coherent(dev, size, cpu_addr, dma_handle); + dma_ops->free(dev, size, cpu_addr, dma_handle, attrs); debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); } diff --git a/trunk/arch/hexagon/kernel/dma.c b/trunk/arch/hexagon/kernel/dma.c index e711ace62fdf..37302218ca4a 100644 --- a/trunk/arch/hexagon/kernel/dma.c +++ b/trunk/arch/hexagon/kernel/dma.c @@ -54,7 +54,8 @@ static struct gen_pool *coherent_pool; /* Allocates from a pool of uncached memory that was reserved at boot time */ void *hexagon_dma_alloc_coherent(struct device *dev, size_t size, - dma_addr_t *dma_addr, gfp_t flag) + dma_addr_t *dma_addr, gfp_t flag, + struct dma_attrs *attrs) { void *ret; @@ -81,7 +82,7 @@ void *hexagon_dma_alloc_coherent(struct device *dev, size_t size, } static void hexagon_free_coherent(struct device *dev, size_t size, void *vaddr, - dma_addr_t dma_addr) + dma_addr_t dma_addr, struct dma_attrs *attrs) { gen_pool_free(coherent_pool, (unsigned long) vaddr, size); } @@ -202,8 +203,8 @@ static void hexagon_sync_single_for_device(struct device *dev, } struct dma_map_ops hexagon_dma_ops = { - .alloc_coherent = hexagon_dma_alloc_coherent, - .free_coherent = hexagon_free_coherent, + .alloc = hexagon_dma_alloc_coherent, + .free = hexagon_free_coherent, .map_sg = hexagon_map_sg, .map_page = hexagon_map_page, .sync_single_for_cpu = hexagon_sync_single_for_cpu,