Re: [PATCH 1/2] DMA buffer alignment annotations

2007-12-21 Thread Benjamin Herrenschmidt
On Fri, 2007-12-21 at 09:39 +, Russell King wrote: > > +#ifndef ARCH_MIN_DMA_ALIGNMENT > > +#define __dma_aligned > > +#define __dma_buffer > > +#else > > +#define __dma_aligned > > __attribute__((aligned(ARCH_MIN_DMA_ALIGNMENT))) > > +#define __dma_buffer

Re: [PATCH 1/2] DMA buffer alignment annotations

2007-12-21 Thread Roland Dreier
> > +#define __dma_aligned > > __attribute__((aligned(ARCH_MIN_DMA_ALIGNMENT))) > > +#define __dma_buffer __dma_buffer_line(__LINE__) > > +#define __dma_buffer_line(line) __dma_aligned;\ > > + char __dma_pad_##line[0] __dma_aligned > You

Re: [PATCH 1/2] DMA buffer alignment annotations

2007-12-21 Thread Russell King
On Fri, Dec 21, 2007 at 01:30:07PM +1100, Benjamin Herrenschmidt wrote: > The current patch only enables such alignment for some PowerPC > platforms that do not have coherent caches. Other platforms such > as ARM, MIPS, etc... can define ARCH_MIN_DMA_ALIGNMENT if they > want to benefit from this,

Re: [PATCH 1/2] DMA buffer alignment annotations

2007-12-21 Thread Russell King
On Fri, Dec 21, 2007 at 01:30:07PM +1100, Benjamin Herrenschmidt wrote: The current patch only enables such alignment for some PowerPC platforms that do not have coherent caches. Other platforms such as ARM, MIPS, etc... can define ARCH_MIN_DMA_ALIGNMENT if they want to benefit from this, I

Re: [PATCH 1/2] DMA buffer alignment annotations

2007-12-21 Thread Roland Dreier
+#define __dma_aligned __attribute__((aligned(ARCH_MIN_DMA_ALIGNMENT))) +#define __dma_buffer __dma_buffer_line(__LINE__) +#define __dma_buffer_line(line) __dma_aligned;\ + char __dma_pad_##line[0] __dma_aligned You introduce

Re: [PATCH 1/2] DMA buffer alignment annotations

2007-12-21 Thread Benjamin Herrenschmidt
On Fri, 2007-12-21 at 09:39 +, Russell King wrote: +#ifndef ARCH_MIN_DMA_ALIGNMENT +#define __dma_aligned +#define __dma_buffer +#else +#define __dma_aligned __attribute__((aligned(ARCH_MIN_DMA_ALIGNMENT))) +#define __dma_buffer

[PATCH 1/2] DMA buffer alignment annotations

2007-12-20 Thread Benjamin Herrenschmidt
This patch based on some earlier work by Roland Dreier introduces a pair of annotations that can be used to enforce alignment of objects that can be DMA'ed into, and to enforce that an DMA'able object within a structure isn't sharing a cache line with some other object. Such sharing of a data

[PATCH 1/2] DMA buffer alignment annotations

2007-12-20 Thread Benjamin Herrenschmidt
This patch based on some earlier work by Roland Dreier introduces a pair of annotations that can be used to enforce alignment of objects that can be DMA'ed into, and to enforce that an DMA'able object within a structure isn't sharing a cache line with some other object. Such sharing of a data