From: Ming Lei <tom.leiming@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: joerg.roedel@amd.com, fujita.tomonori@lab.ntt.co.jp,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH 0/3] dma-mapping:remove CONFIG_HAVE_DMA_ATTRS
Date: Sun, 5 Jul 2009 21:37:16 +0800 [thread overview]
Message-ID: <d82e647a0907050637l532d40e8u4b67ecefa303415e@mail.gmail.com> (raw)
In-Reply-To: <20090705204418.44fc38c1@linux-lm>
2009/7/5 Ming Lei <tom.leiming@gmail.com>:
> 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
>
>
I have another idea to fix the possible compile failure. Does the
following patch
work?
diff --git a/include/asm-generic/dma-mapping-common.h
b/include/asm-generic/dma-mapping-common.h
index 5406a60..39e2ec5 100644
--- a/include/asm-generic/dma-mapping-common.h
+++ b/include/asm-generic/dma-mapping-common.h
@@ -6,6 +6,8 @@
#include <linux/dma-debug.h>
#include <linux/dma-attrs.h>
+#define ARCH_USE_DMA_MAPPING_COMMON
+
static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
size_t size,
enum dma_data_direction dir,
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 07dfd46..4be1121 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -219,6 +219,7 @@ static inline void
dmam_release_declared_memory(struct device *dev)
}
#endif /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */
+#ifndef ARCH_USE_DMA_MAPPING_COMMON
#ifndef CONFIG_HAVE_DMA_ATTRS
struct dma_attrs;
@@ -235,5 +236,7 @@ struct dma_attrs;
dma_unmap_sg(dev, sgl, nents, dir)
#endif /* CONFIG_HAVE_DMA_ATTRS */
+#endif /* ARCH_USE_DMA_MAPPING_COMMON */
+
#endif
--
Lei Ming
next prev parent reply other threads:[~2009-07-05 13:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-04 2:34 tom.leiming
2009-07-04 2:34 ` [PATCH 1/3] " tom.leiming
2009-07-04 2:34 ` [PATCH 2/3] dma-mapping:X86:remove CONFIG_HAVE_DMA_ATTRS tom.leiming
2009-07-04 2:34 ` [PATCH 3/3] dma-mapping:IA64:remove CONFIG_HAVE_DMA_ATTRS tom.leiming
2009-07-05 11:19 ` [PATCH 0/3] dma-mapping:remove CONFIG_HAVE_DMA_ATTRS Arnd Bergmann
2009-07-05 12:44 ` Ming Lei
2009-07-05 13:37 ` Ming Lei [this message]
2009-07-05 19:17 ` Arnd Bergmann
2009-07-06 2:28 ` FUJITA Tomonori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d82e647a0907050637l532d40e8u4b67ecefa303415e@mail.gmail.com \
--to=tom.leiming@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=joerg.roedel@amd.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®