linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To: jpk@sgi.com
Cc: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ia64: SN specific version of dma_get_required_mask()
Date: Wed, 19 Nov 2008 13:07:47 +0900	[thread overview]
Message-ID: <20081119130841E.fujita.tomonori@lab.ntt.co.jp> (raw)
In-Reply-To: <20081117162454.169426.74531.sendpatchset@attica.americas.sgi.com>

On Mon, 17 Nov 2008 10:24:54 -0600
John Keller <jpk@sgi.com> wrote:

> Create a platform specific version of dma_get_required_mask()
> for ia64 SN Altix. All SN Altix platforms support 64 bit DMA
> addressing regardless of the size of system memory.
> Create a ia64 machvec for dma_get_required_mask, with the
> SN version unconditionally returning DMA_64BIT_MASK.
> 
> 
> Signed-off-by: John Keller <jpk@sgi.com>
> ---
> 
>  Documentation/DMA-API.txt            |    9 ++++-----
>  arch/ia64/include/asm/dma-mapping.h  |    3 +++
>  arch/ia64/include/asm/machvec.h      |    7 +++++++
>  arch/ia64/include/asm/machvec_init.h |    1 +
>  arch/ia64/include/asm/machvec_sn2.h  |    2 ++
>  arch/ia64/pci/pci.c                  |   21 +++++++++++++++++++++
>  arch/ia64/sn/pci/pci_dma.c           |    6 ++++++
>  include/linux/dma-mapping.h          |    2 ++
>  8 files changed, 46 insertions(+), 5 deletions(-)

(snip)

>  static int __init pcibios_init(void)
>  {
>  	set_pci_cacheline_size();
> Index: linux-2.6/include/linux/dma-mapping.h
> ===================================================================
> --- linux-2.6.orig/include/linux/dma-mapping.h	2008-11-17 08:38:07.740451313 -0600
> +++ linux-2.6/include/linux/dma-mapping.h	2008-11-17 08:39:50.573284674 -0600
> @@ -70,7 +70,9 @@ static inline u64 dma_get_mask(struct de
>  	return DMA_32BIT_MASK;
>  }
>  
> +#ifndef CONFIG_IA64
>  extern u64 dma_get_required_mask(struct device *dev);
> +#endif

I think that adding CONFIG_IA64 to include/linux/dma-mapping.h is
wrong. I also think that you don't need to ifndef this extern.

If you need this trick with only CONFIG_IA64_SGI_SN2, how about
something like this? It's simple and we can avoid duplicate the
generic dma_get_required_mask in arch/ia64/pci/pci.c


diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h
index bbab7e2..4ffbd18 100644
--- a/arch/ia64/include/asm/dma-mapping.h
+++ b/arch/ia64/include/asm/dma-mapping.h
@@ -144,6 +144,13 @@ static inline struct dma_mapping_ops *get_dma_ops(struct device *dev)
 	return dma_ops;
 }
 
-
+#ifdef CONFIG_IA64_SGI_SN2
+#define ARCH_HAS_DMA_GET_REQUIRED_MASK
+static inline u64 dma_get_required_mask(struct device *dev)
+{
+	return DMA_64BIT_MASK;
+}
+EXPORT_SYMBOL_GPL(dma_get_required_mask);
+#endif
 
 #endif /* _ASM_IA64_DMA_MAPPING_H */

  parent reply	other threads:[~2008-11-19  4:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-17 16:24 [PATCH] ia64: SN specific version of dma_get_required_mask() John Keller
2008-11-17 16:39 ` Bernhard Walle
2008-11-18 14:08   ` John Keller
2008-11-18 15:35     ` Luck, Tony
2008-11-18 15:53       ` John Keller
2008-11-23 13:37     ` Bernhard Walle
2008-11-25 20:50       ` John Keller
2008-11-19  4:07 ` FUJITA Tomonori [this message]
2008-11-19 16:12 John Keller
2008-11-20  4:49 ` FUJITA Tomonori
2008-11-20 22:57   ` John Keller
2008-11-21  5:11     ` 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=20081119130841E.fujita.tomonori@lab.ntt.co.jp \
    --to=fujita.tomonori@lab.ntt.co.jp \
    --cc=jpk@sgi.com \
    --cc=linux-ia64@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).