Re: xtensa build failures in -next due to DMA API changes

From: Max Filippov
Date: Wed Aug 26 2015 - 03:53:31 EST


On Tue, Aug 25, 2015 at 11:24 PM, Christoph Hellwig <hch@xxxxxx> wrote:
> On Tue, Aug 25, 2015 at 01:21:40PM -0700, Guenter Roeck wrote:
>> I also see
>>
>> arch/xtensa/include/asm/dma-mapping.h:#include <asm-generic/dma-mapping-common.h>
>>
>> It looks like there is a conflict with "xtensa: reimplement DMA API using common
>> helpers" by Max Filippov, which added the include. This patch is in -next.
>
> Oh. That one clashes badly with my whole series, basically each
> of my patches will need the same work done for the other architectures
> applied to xtensa as well.
>
> In terms of effort it might be a better idea to rebase the patch from
> Max on top of the series, as it will become a lot simpler that way.

Looks like I just need to remove now redundant function definitions from
xtensa/include/asm/dma-mapping.h. A patch that removes these
functions is attached, but I'm not sure where it should go. To the Andrew's
tree? Or should the xtensa tree merge Christoph's series and apply it on
top?

--
Thanks.
-- Max
From 8707a6bd9f9bb4e40dc981be104e2eaa7b6355a6 Mon Sep 17 00:00:00 2001
From: Max Filippov <jcmvbkbc@xxxxxxxxx>
Date: Wed, 26 Aug 2015 08:42:18 +0300
Subject: [PATCH] xtensa: remove duplicate definitions from dma-mapping.h

DMA API reimplementation for xtensa conflicts with dma-mapping
consolidation series from Christoph Hellwig: now both xtensa
dma-mapping.h and dma-mapping-common.h define many dma_* functions.

Remove extra definitions from xtensa-specific dma-mapping.h

Signed-off-by: Max Filippov <jcmvbkbc@xxxxxxxxx>
---
arch/xtensa/include/asm/dma-mapping.h | 60 -----------------------------------
1 file changed, 60 deletions(-)

diff --git a/arch/xtensa/include/asm/dma-mapping.h b/arch/xtensa/include/asm/dma-mapping.h
index f01cb30..4427f38 100644
--- a/arch/xtensa/include/asm/dma-mapping.h
+++ b/arch/xtensa/include/asm/dma-mapping.h
@@ -32,66 +32,6 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)

#include <asm-generic/dma-mapping-common.h>

-#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_attrs(d, s, h, f, NULL)
-#define dma_free_noncoherent(d, s, v, h) dma_free_attrs(d, s, v, h, NULL)
-#define dma_alloc_coherent(d, s, h, f) dma_alloc_attrs(d, s, h, f, NULL)
-#define dma_free_coherent(d, s, c, h) dma_free_attrs(d, s, c, h, NULL)
-
-static inline void *dma_alloc_attrs(struct device *dev, size_t size,
- dma_addr_t *dma_handle, gfp_t gfp,
- struct dma_attrs *attrs)
-{
- void *ret;
- struct dma_map_ops *ops = get_dma_ops(dev);
-
- if (dma_alloc_from_coherent(dev, size, dma_handle, &ret))
- return ret;
-
- ret = ops->alloc(dev, size, dma_handle, gfp, attrs);
- debug_dma_alloc_coherent(dev, size, *dma_handle, ret);
-
- return ret;
-}
-
-static inline void dma_free_attrs(struct device *dev, size_t size,
- void *vaddr, dma_addr_t dma_handle,
- struct dma_attrs *attrs)
-{
- struct dma_map_ops *ops = get_dma_ops(dev);
-
- if (dma_release_from_coherent(dev, get_order(size), vaddr))
- return;
-
- ops->free(dev, size, vaddr, dma_handle, attrs);
- debug_dma_free_coherent(dev, size, vaddr, dma_handle);
-}
-
-static inline int
-dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
-{
- struct dma_map_ops *ops = get_dma_ops(dev);
-
- debug_dma_mapping_error(dev, dma_addr);
- return ops->mapping_error(dev, dma_addr);
-}
-
-static inline int
-dma_supported(struct device *dev, u64 mask)
-{
- return 1;
-}
-
-static inline int
-dma_set_mask(struct device *dev, u64 mask)
-{
- if(!dev->dma_mask || !dma_supported(dev, mask))
- return -EIO;
-
- *dev->dma_mask = mask;
-
- return 0;
-}
-
void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
enum dma_data_direction direction);

--
1.8.1.4