Commit f67637ee4b5d90d41160d755b9a8cca18c394586
Committed by
Linus Torvalds
1 parent
83b7b44e1c
Exists in
master
and in
39 other branches
[PATCH] Add struct dev pointer to dma_is_consistent()
dma_is_consistent() is ill-designed in that it does not have a struct device pointer argument which makes proper support for systems that consist of a mix of coherent and non-coherent DMA devices hard. Change dma_is_consistent to take a struct device pointer as first argument and fix the sole caller to pass it. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 22 changed files with 25 additions and 25 deletions Side-by-side Diff
- Documentation/DMA-API.txt
- arch/mips/mm/dma-coherent.c
- arch/mips/mm/dma-ip27.c
- arch/mips/mm/dma-ip32.c
- arch/mips/mm/dma-noncoherent.c
- drivers/scsi/53c700.c
- include/asm-alpha/dma-mapping.h
- include/asm-arm/dma-mapping.h
- include/asm-avr32/dma-mapping.h
- include/asm-cris/dma-mapping.h
- include/asm-frv/dma-mapping.h
- include/asm-generic/dma-mapping.h
- include/asm-i386/dma-mapping.h
- include/asm-ia64/dma-mapping.h
- include/asm-m68k/dma-mapping.h
- include/asm-mips/dma-mapping.h
- include/asm-parisc/dma-mapping.h
- include/asm-powerpc/dma-mapping.h
- include/asm-sparc64/dma-mapping.h
- include/asm-um/dma-mapping.h
- include/asm-x86_64/dma-mapping.h
- include/asm-xtensa/dma-mapping.h
Documentation/DMA-API.txt
... | ... | @@ -431,10 +431,10 @@ |
431 | 431 | dma_alloc_noncoherent()). |
432 | 432 | |
433 | 433 | int |
434 | -dma_is_consistent(dma_addr_t dma_handle) | |
434 | +dma_is_consistent(struct device *dev, dma_addr_t dma_handle) | |
435 | 435 | |
436 | -returns true if the memory pointed to by the dma_handle is actually | |
437 | -consistent. | |
436 | +returns true if the device dev is performing consistent DMA on the memory | |
437 | +area pointed to by the dma_handle. | |
438 | 438 | |
439 | 439 | int |
440 | 440 | dma_get_cache_alignment(void) |
arch/mips/mm/dma-coherent.c
arch/mips/mm/dma-ip27.c
arch/mips/mm/dma-ip32.c
arch/mips/mm/dma-noncoherent.c
drivers/scsi/53c700.c
... | ... | @@ -313,7 +313,7 @@ |
313 | 313 | hostdata->status = memory + STATUS_OFFSET; |
314 | 314 | /* all of these offsets are L1_CACHE_BYTES separated. It is fatal |
315 | 315 | * if this isn't sufficient separation to avoid dma flushing issues */ |
316 | - BUG_ON(!dma_is_consistent(pScript) && L1_CACHE_BYTES < dma_get_cache_alignment()); | |
316 | + BUG_ON(!dma_is_consistent(hostdata->dev, pScript) && L1_CACHE_BYTES < dma_get_cache_alignment()); | |
317 | 317 | hostdata->slots = (struct NCR_700_command_slot *)(memory + SLOTS_OFFSET); |
318 | 318 | hostdata->dev = dev; |
319 | 319 |
include/asm-alpha/dma-mapping.h
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 | |
52 | 52 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
53 | 53 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
54 | -#define dma_is_consistent(dev) (1) | |
54 | +#define dma_is_consistent(d, h) (1) | |
55 | 55 | |
56 | 56 | int dma_set_mask(struct device *dev, u64 mask); |
57 | 57 |
include/asm-arm/dma-mapping.h
include/asm-avr32/dma-mapping.h
... | ... | @@ -307,7 +307,7 @@ |
307 | 307 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
308 | 308 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
309 | 309 | |
310 | -static inline int dma_is_consistent(dma_addr_t dma_addr) | |
310 | +static inline int dma_is_consistent(struct device *dev, dma_addr_t dma_addr) | |
311 | 311 | { |
312 | 312 | return 1; |
313 | 313 | } |
include/asm-cris/dma-mapping.h
include/asm-frv/dma-mapping.h
include/asm-generic/dma-mapping.h
... | ... | @@ -266,7 +266,7 @@ |
266 | 266 | |
267 | 267 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
268 | 268 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
269 | -#define dma_is_consistent(d) (1) | |
269 | +#define dma_is_consistent(d, h) (1) | |
270 | 270 | |
271 | 271 | static inline int |
272 | 272 | dma_get_cache_alignment(void) |
include/asm-i386/dma-mapping.h
include/asm-ia64/dma-mapping.h
include/asm-m68k/dma-mapping.h
include/asm-mips/dma-mapping.h
include/asm-parisc/dma-mapping.h
include/asm-powerpc/dma-mapping.h
... | ... | @@ -342,9 +342,9 @@ |
342 | 342 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
343 | 343 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
344 | 344 | #ifdef CONFIG_NOT_COHERENT_CACHE |
345 | -#define dma_is_consistent(d) (0) | |
345 | +#define dma_is_consistent(d, h) (0) | |
346 | 346 | #else |
347 | -#define dma_is_consistent(d) (1) | |
347 | +#define dma_is_consistent(d, h) (1) | |
348 | 348 | #endif |
349 | 349 | |
350 | 350 | static inline int dma_get_cache_alignment(void) |
include/asm-sparc64/dma-mapping.h
... | ... | @@ -181,7 +181,7 @@ |
181 | 181 | |
182 | 182 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
183 | 183 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
184 | -#define dma_is_consistent(d) (1) | |
184 | +#define dma_is_consistent(d, h) (1) | |
185 | 185 | |
186 | 186 | static inline int |
187 | 187 | dma_get_cache_alignment(void) |
include/asm-um/dma-mapping.h
... | ... | @@ -94,7 +94,7 @@ |
94 | 94 | |
95 | 95 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
96 | 96 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
97 | -#define dma_is_consistent(d) (1) | |
97 | +#define dma_is_consistent(d, h) (1) | |
98 | 98 | |
99 | 99 | static inline int |
100 | 100 | dma_get_cache_alignment(void) |
include/asm-x86_64/dma-mapping.h
include/asm-xtensa/dma-mapping.h