xtensa: fix build failure
cover xtensa: fix build failure
While building with allmodconfig the build failed with different dma related errors. It turned out that the dma functions were moved to asm-generic/dma-mapping-common.h() and as a result we were getting the errors of "redefinition".
This patch series will move the functions as required and at the end of the series, allmodconfig builds.
Only build tested with allmodconfig, common_defconfig, iss_defconfig on next-20150908.
Sudip Mukherjee (4):
xtensa: fix error with dma_{alloc,free}_{attrs,coherent}
xtensa: fix error with dma_supported
xtensa: fix errors with dma_supported
xtensa: fix error with dma_set_mask
arch/xtensa/include/asm/dma-mapping.h | 57 +++-------------------------------- 1 file changed, 4 insertions(+), 53 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/4 xtensa: fix error with dma_{alloc,free}_{attrs,coherent}
commit 59b5f4726434 ("dma-mapping: consolidate dma_{alloc,free}_{attrs,coherent}") has removed dma_{alloc,free}_{attrs,coherent} functions from arch specific files to asm-generic/dma-mapping-common.h. But they were not removed for xtensa architecture and as a result we are getting errors like:
error: redefinition of 'dma_alloc_attrs'
error: redefinition of 'dma_free_attrs'
while building with allmodconfig.
--- arch/xtensa/include/asm/dma-mapping.h | 31 ------------------------------- 1 file changed, 31 deletions(-)
arch/xtensa/include/asm/dma-mapping.h +0 -31
@@ -34,37 +34,6 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)#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)
Signature · 1 line
1.9.1
PATCH 2/4 xtensa: fix error with dma_supported
In reply to Sudip Mukherjeecommit 11bd9421d0ad ("dma-mapping: cosolidate dma_mapping_error") has removed dma_mapping_error() from arch specific file to asm-generic/dma-mapping-common.h but it was not removed from xtensa architecture and as a result we were getting error like:
error: redefinition of 'dma_mapping_error'
while building with allmodconfig.
--- arch/xtensa/include/asm/dma-mapping.h | 9 --------- 1 file changed, 9 deletions(-)
arch/xtensa/include/asm/dma-mapping.h +0 -9
@@ -36,15 +36,6 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)#define dma_free_noncoherent (d, s, v, h) dma_free_attrs(d, s, v, h, NULL)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 ;
Signature · 1 line
1.9.1
PATCH 3/4 xtensa: fix errors with dma_supported
In reply to Sudip Mukherjeecommit eec17ba9f049 ("dma-mapping: consolidate dma_supported") has removed dma_supported() from individual arch files to asm-generic/dma-mapping-common.h or if arch has its own implementation then we need to set the flag HAVE_ARCH_DMA_SUPPORTED. Otherwise we were getting error like:
error: redefinition of 'dma_supported'
while building with allmodconfig.
--- arch/xtensa/include/asm/dma-mapping.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
arch/xtensa/include/asm/dma-mapping.h +6 -4
@@ -30,10 +30,7 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)return &xtensa_dma_map_ops; } -#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 HAVE_ARCH_DMA_SUPPORTED 1static inline int dma_supported (struct device *dev,u64 mask)
@@ -41,6 +38,11 @@ dma_supported(struct device *dev, u64 mask)return 1 ; } +#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) +static inline int dma_set_mask (struct device *dev,u64 mask) {
Signature · 1 line
1.9.1
PATCH 4/4 xtensa: fix error with dma_set_mask
In reply to Sudip Mukherjeecommit 13bad70fb5ba ("dma-mapping: consolidate dma_set_mask") has removed dma_set_mask() from individual arch files to asm-generic/dma-mapping-common.h. But it was not removed for xtensa architecture and as a result we were getting errors like:
error: redefinition of 'dma_set_mask'
while building with allmodconfig.
--- arch/xtensa/include/asm/dma-mapping.h | 11 ----------- 1 file changed, 11 deletions(-)
arch/xtensa/include/asm/dma-mapping.h +0 -11
@@ -43,17 +43,6 @@ dma_supported(struct device *dev, u64 mask)#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) -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);
Signature · 1 line
1.9.1
Max Filippov
maintainerSudip,
Quoted 6 lines · Sudip Mukherjee
While building with allmodconfig the build failed with different dma related errors. It turned out that the dma functions were moved to asm-generic/dma-mapping-common.h() and as a result we were getting the errors of "redefinition".
This patch series will move the functions as required and at the end of the series, allmodconfig builds.
I believe it's fixed in the -mm tree and will be merged soon, see the thread at https://lkml.org/lkml/2015/8/26/118
Signature · 2 lines
Thanks. -- Max
Quoted 11 lines · Max Filippov
Sudip,
Quoted 6 lines · Sudip Mukherjee
While building with allmodconfig the build failed with different dma related errors. It turned out that the dma functions were moved to asm-generic/dma-mapping-common.h() and as a result we were getting the errors of "redefinition".
This patch series will move the functions as required and at the end of the series, allmodconfig builds.
Quoted 2 lines
I believe it's fixed in the -mm tree and will be merged soon, see the thread at https://lkml.org/lkml/2015/8/26/118
I guess its already merged in Linus tree now. I tested in the morning with Linus tree and allmodconfig worked. But next-20150909 still failed. BTW, yesterday when I was testing few of the defconfigs were not working. Are they also being fixed?
regards
sudip
Max Filippov
maintainerQuoted 12 lines · Sudip Mukherjee
Quoted 11 lines · Max Filippov
Sudip,
Quoted 6 lines · Sudip Mukherjee
While building with allmodconfig the build failed with different dma related errors. It turned out that the dma functions were moved to asm-generic/dma-mapping-common.h() and as a result we were getting the errors of "redefinition".
This patch series will move the functions as required and at the end of the series, allmodconfig builds.
Quoted 5 lines
Quoted 2 lines
I believe it's fixed in the -mm tree and will be merged soon, see the thread at https://lkml.org/lkml/2015/8/26/118
I guess its already merged in Linus tree now. I tested in the morning with Linus tree and allmodconfig worked. But next-20150909 still failed.
AFAICS it's not merged yet: arch/xtensa/include/dma-mapping.h still has all functions deleted by patch in the mentioned thread.
Quoted 2 lines
BTW, yesterday when I was testing few of the defconfigs were not working. Are they also being fixed?
There are many ways they can possibly fail, but mostly build errors are caused by using wrong compiler. For more details please refer to
http://wiki.linux-xtensa.org/index.php/Linux_Kernel#Configuring_and_building_the_kernel
Signature · 2 lines
Thanks. -- Max
Quoted 14 lines · Max Filippov
Quoted 12 lines · Sudip Mukherjee
Quoted 11 lines · Max Filippov
Sudip,
Quoted 6 lines · Sudip Mukherjee
While building with allmodconfig the build failed with different dma related errors. It turned out that the dma functions were moved to asm-generic/dma-mapping-common.h() and as a result we were getting the errors of "redefinition".
This patch series will move the functions as required and at the end of the series, allmodconfig builds.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
I believe it's fixed in the -mm tree and will be merged soon, see the thread at https://lkml.org/lkml/2015/8/26/118
I guess its already merged in Linus tree now. I tested in the morning with Linus tree and allmodconfig worked. But next-20150909 still failed.
AFAICS it's not merged yet:
arch/xtensa/include/dma-mapping.hstill has all functions deleted by patch in the mentioned thread.
Ohhh.. I didn't notice it in the morning. I saw Linus tree is building and I thought it may have been merged. Now on checking I see that the series by Christoph Hellwig which removes the arch specific functions is still not in Linus tree and thats why I didnot get any error.
regards
sudip