lkml.org 
[lkml]   [2009]   [Jul]   [5]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSun, 5 Jul 2009 20:44:18 +0800
FromMing Lei <>
SubjectRe: [PATCH 0/3] dma-mapping:remove CONFIG_HAVE_DMA_ATTRS
On Sun, 5 Jul 2009 13:19:36 +0200
Arnd Bergmann <arnd@arndb.de> wrote:

> On Saturday 04 July 2009, tom.leiming@gmail.com wrote:
> > 2,Disabling CONFIG_HAVE_DMA_ATTRS may lead to a compile failure;
>
> I'm not sure I understand this point. CONFIG_HAVE_DMA_ATTRS tells
> the common code whether the architecture understands dma attributes.

If a new arch does not define CONFIG_HAVE_DMA_ATTRS but uses
dma-mapping-common.h, it will lead to a compile failure.

include/asm-generic/dma-mapping-common.h

#define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a,
s, r, NULL)
...

include/linux/dma-mapping.h

#ifndef CONFIG_HAVE_DMA_ATTRS
struct dma_attrs;

#define dma_map_single_attrs(dev, cpu_addr, size, dir, attrs) \
dma_map_single(dev, cpu_addr, size, dir)
...
#endif


> If you enable it on all architectures, you will get new compile
> failures on all those that don't understand them, while the current
> code correctly falls back on the standard functions.

You are right, the patch will lead to new compile failure for the
ARCHs, on which disables CONFIG_HAVE_DMA_ATTRS and doesn't use
dma-mapping-common.h. So the patch is not mature.

>
> I think it makes sense to combine CONFIG_HAVE_DMA_ATTRS with the
> use of dma-mapping-common.h, but the majority of the architectures
> just uses a static mapping, where attributes make no sense.
>
> You also missed powerpc64, which selects CONFIG_HAVE_DMA_ATTRS
> but does not (yet) use dma-mapping-common.h.

ppc64 doesn't use dma-mapping-common.h, so the patch doesn't consider
it.

--
Lei Ming


\
 
 \ /
  Last update: 2009-07-05 14:47    [from the cache]
©2003-2009