Skip to content

Commit 85e28c7

Browse files
committed
Merge branch 'fixes-for-v3.8-rc7' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping
Pull DMA mapping fixes from Marek Szyprowski: "This pull request contains important bugfix patches for 9 architectures, which finally fixes broken allmodconfig builds introduced in v3.8-rc1. Those architectures don't use dma_map_ops based implementation and require manual update or additional dummy implementations of the missing new dma-mapping api functions: dma_mmap_coherent and dma_get_sgtable." * 'fixes-for-v3.8-rc7' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping: xtensa: Provide dummy dma_mmap_coherent() and dma_get_sgtable() parisc: Provide dummy dma_mmap_coherent() and dma_get_sgtable() mn10300: Provide dummy dma_mmap_coherent() and dma_get_sgtable() m68k: Provide dma_mmap_coherent() and dma_get_sgtable() frv: Provide dummy dma_mmap_coherent() and dma_get_sgtable() cris: Provide dma_mmap_coherent() and dma_get_sgtable() c6x: Provide dummy dma_mmap_coherent() and dma_get_sgtable() blackfin: Provide dma_mmap_coherent() and dma_get_sgtable() avr32: Provide dma_mmap_coherent() and dma_get_sgtable()
2 parents fe547d7 + da57b93 commit 85e28c7

File tree

9 files changed

+115
-0
lines changed

9 files changed

+115
-0
lines changed

arch/avr32/include/asm/dma-mapping.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,4 +336,14 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
336336
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
337337
#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
338338

339+
/* drivers/base/dma-mapping.c */
340+
extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
341+
void *cpu_addr, dma_addr_t dma_addr, size_t size);
342+
extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
343+
void *cpu_addr, dma_addr_t dma_addr,
344+
size_t size);
345+
346+
#define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s)
347+
#define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s)
348+
339349
#endif /* __ASM_AVR32_DMA_MAPPING_H */

arch/blackfin/include/asm/dma-mapping.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,14 @@ dma_cache_sync(struct device *dev, void *vaddr, size_t size,
154154
_dma_sync((dma_addr_t)vaddr, size, dir);
155155
}
156156

157+
/* drivers/base/dma-mapping.c */
158+
extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
159+
void *cpu_addr, dma_addr_t dma_addr, size_t size);
160+
extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
161+
void *cpu_addr, dma_addr_t dma_addr,
162+
size_t size);
163+
164+
#define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s)
165+
#define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s)
166+
157167
#endif /* _BLACKFIN_DMA_MAPPING_H */

arch/c6x/include/asm/dma-mapping.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,19 @@ extern void dma_free_coherent(struct device *, size_t, void *, dma_addr_t);
8989
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent((d), (s), (h), (f))
9090
#define dma_free_noncoherent(d, s, v, h) dma_free_coherent((d), (s), (v), (h))
9191

92+
/* Not supported for now */
93+
static inline int dma_mmap_coherent(struct device *dev,
94+
struct vm_area_struct *vma, void *cpu_addr,
95+
dma_addr_t dma_addr, size_t size)
96+
{
97+
return -EINVAL;
98+
}
99+
100+
static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt,
101+
void *cpu_addr, dma_addr_t dma_addr,
102+
size_t size)
103+
{
104+
return -EINVAL;
105+
}
106+
92107
#endif /* _ASM_C6X_DMA_MAPPING_H */

arch/cris/include/asm/dma-mapping.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,15 @@ dma_cache_sync(struct device *dev, void *vaddr, size_t size,
158158
{
159159
}
160160

161+
/* drivers/base/dma-mapping.c */
162+
extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
163+
void *cpu_addr, dma_addr_t dma_addr, size_t size);
164+
extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
165+
void *cpu_addr, dma_addr_t dma_addr,
166+
size_t size);
167+
168+
#define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s)
169+
#define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s)
170+
161171

162172
#endif

arch/frv/include/asm/dma-mapping.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,19 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
132132
flush_write_buffers();
133133
}
134134

135+
/* Not supported for now */
136+
static inline int dma_mmap_coherent(struct device *dev,
137+
struct vm_area_struct *vma, void *cpu_addr,
138+
dma_addr_t dma_addr, size_t size)
139+
{
140+
return -EINVAL;
141+
}
142+
143+
static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt,
144+
void *cpu_addr, dma_addr_t dma_addr,
145+
size_t size)
146+
{
147+
return -EINVAL;
148+
}
149+
135150
#endif /* _ASM_DMA_MAPPING_H */

arch/m68k/include/asm/dma-mapping.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,14 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t handle)
115115
#include <asm-generic/dma-mapping-broken.h>
116116
#endif
117117

118+
/* drivers/base/dma-mapping.c */
119+
extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
120+
void *cpu_addr, dma_addr_t dma_addr, size_t size);
121+
extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
122+
void *cpu_addr, dma_addr_t dma_addr,
123+
size_t size);
124+
125+
#define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s)
126+
#define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s)
127+
118128
#endif /* _M68K_DMA_MAPPING_H */

arch/mn10300/include/asm/dma-mapping.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,19 @@ void dma_cache_sync(void *vaddr, size_t size,
168168
mn10300_dcache_flush_inv();
169169
}
170170

171+
/* Not supported for now */
172+
static inline int dma_mmap_coherent(struct device *dev,
173+
struct vm_area_struct *vma, void *cpu_addr,
174+
dma_addr_t dma_addr, size_t size)
175+
{
176+
return -EINVAL;
177+
}
178+
179+
static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt,
180+
void *cpu_addr, dma_addr_t dma_addr,
181+
size_t size)
182+
{
183+
return -EINVAL;
184+
}
185+
171186
#endif

arch/parisc/include/asm/dma-mapping.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,19 @@ void * sba_get_iommu(struct parisc_device *dev);
238238
/* At the moment, we panic on error for IOMMU resource exaustion */
239239
#define dma_mapping_error(dev, x) 0
240240

241+
/* This API cannot be supported on PA-RISC */
242+
static inline int dma_mmap_coherent(struct device *dev,
243+
struct vm_area_struct *vma, void *cpu_addr,
244+
dma_addr_t dma_addr, size_t size)
245+
{
246+
return -EINVAL;
247+
}
248+
249+
static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt,
250+
void *cpu_addr, dma_addr_t dma_addr,
251+
size_t size)
252+
{
253+
return -EINVAL;
254+
}
255+
241256
#endif

arch/xtensa/include/asm/dma-mapping.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,19 @@ dma_cache_sync(struct device *dev, void *vaddr, size_t size,
170170
consistent_sync(vaddr, size, direction);
171171
}
172172

173+
/* Not supported for now */
174+
static inline int dma_mmap_coherent(struct device *dev,
175+
struct vm_area_struct *vma, void *cpu_addr,
176+
dma_addr_t dma_addr, size_t size)
177+
{
178+
return -EINVAL;
179+
}
180+
181+
static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt,
182+
void *cpu_addr, dma_addr_t dma_addr,
183+
size_t size)
184+
{
185+
return -EINVAL;
186+
}
187+
173188
#endif /* _XTENSA_DMA_MAPPING_H */

0 commit comments

Comments
 (0)