[PATCH v2 0/6] fix dma memory allocations, add dma_alloc/dma_free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



on ARM using dfu mode we've seen problems with dma memory allocations.
Some drivers use dma_inv_range on allocated buffers, which corrupts memory
around the buffer, it it's not aligned to cache lines. This series
introduces: dma_alloc() and dma_free() that allocate memory aligned to
cache lines. This is 64 bytes on ARM (just to be sure) and
DCACHE_LINE_SIZE on nios2. All other arch do a transparent xmalloc.

Feel free to add the appropriate alignment for your architecture to
"include/asm/dma.h". If you do so add a

    #define dma_alloc dma_alloc
    #define dma_free dma_free

to your "asm/dma.h" so that the generic funtion won't be used.

changes since v1:
- align size to cache line size, too (tnx Sascha)
- provide a generic "include/dma.h" which implements generic fallbacks
  using ifndef dma_{alloc,free} magic.
- add includes to arm and nions implementations

regards, Marc


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux