[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1198272341.6737.12.camel@pasglop>
Date: Sat, 22 Dec 2007 08:25:41 +1100
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: Russell King <rmk+lkml@....linux.org.uk>
Cc: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>, rdreier@...co.com,
linux-scsi@...r.kernel.org, davem@...emloft.net,
james.bottomley@...eleye.com, ralf@...ux-mips.org
Subject: Re: [PATCH 1/2] DMA buffer alignment annotations
On Fri, 2007-12-21 at 09:39 +0000, 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 __dma_buffer_line(__LINE__)
> > +#define __dma_buffer_line(line) __dma_aligned;\
> > + char __dma_pad_##line[0] __dma_aligned
>
> You introduce __dma_buffer_line() if ARCH_MIN_DMA_ALIGNMENT is set but
> not if it isn't...
Yup, it's not meant to be used outside of __dma_buffer...
.../...
> > +then dev->buffer will be safe for DMA on all architectures. On a
> > +cache-coherent architecture the members of dev will be aligned exactly
> > +as they would have been without __dma_buffer; on a non-cache-coherent
> > +architecture buffer and field2 will be aligned so that buffer does not
> > +share a cache line with any other data.
> > +
>
> ... but it's not described. What's the purpose of it, and why would it
> only be used on CPUs with ARCH_MIN_DMA_ALIGNMENT set?
Hrm, I'm not the best at writing exlanations, care to send a patch ? :-)
Cheers,
Ben
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists