All of lore.kernel.org
 help / color / mirror / Atom feed
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To: arnd@arndb.de
Cc: jgarzik@pobox.com, hancockrwd@gmail.com, htejun@gmail.com,
	fujita.tomonori@lab.ntt.co.jp, alan@lxorguk.ukuu.org.uk,
	flar@allandria.com, schmitz@biophys.uni-duesseldorf.de,
	linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
	takata@linux-m32r.org, geert@linux-m68k.org,
	linux-m68k@vger.kernel.org, ysato@users.sourceforge.jp
Subject: Re: [PATCH] asm-generic: add a dma-mapping.h file
Date: Mon, 18 May 2009 19:45:04 +0900	[thread overview]
Message-ID: <20090518194443R.fujita.tomonori@lab.ntt.co.jp> (raw)
In-Reply-To: <200905172245.23774.arnd@arndb.de>

On Sun, 17 May 2009 22:45:21 +0000
Arnd Bergmann <arnd@arndb.de> wrote:

> h8300 and m32r currently do not provide a DMA mapping API
> and therefore cannot use the ATA drivers. This adds a
> generic version of dma-mapping.h for architectures that
> have none or very minimal actual support for DMA in hardware
> and makes the two architectures use it.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> On Sunday 17 May 2009 20:05:54 Jeff Garzik wrote:
> 
> > That's what needs to happen.  We provide no-op functions for e.g. PCI 
> > and x86 DMI, for platforms where this support does not exist.
> > 
> > Pretty much all architectures support some form of ATA.  m68k, m32r, 
> > h8300 and microblaze all have IDE interface, which means that libata 
> > needs to work on that platform.
> > 
> > The only !ATA arch in the entire kernel is s390, AFAICT.
> 
> m68k only defines NO_DMA for Sun3 and Dragonball. Sun3 does
> not have ATA, Dragonball could probably just enable HAS_DMA.
> 
> ---
>  arch/h8300/Kconfig                   |    2 +-
>  arch/h8300/include/asm/dma-mapping.h |    1 +
>  arch/m32r/Kconfig                    |    2 +-
>  arch/m32r/include/asm/dma-mapping.h  |    1 +
>  include/asm-generic/dma-mapping.h    |  399 ++++++++++++++++++++++++++++++++++
>  5 files changed, 403 insertions(+), 2 deletions(-)
>  create mode 100644 arch/h8300/include/asm/dma-mapping.h
>  create mode 100644 arch/m32r/include/asm/dma-mapping.h
>  create mode 100644 include/asm-generic/dma-mapping.h
> 
> diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
> index 9420648..36a037d 100644
> --- a/arch/h8300/Kconfig
> +++ b/arch/h8300/Kconfig
> @@ -74,7 +74,7 @@ config NO_IOPORT
>  	def_bool y
>  
>  config NO_DMA
> -	def_bool y
> +	def_bool n
>  
>  config ISA
>  	bool
> diff --git a/arch/h8300/include/asm/dma-mapping.h b/arch/h8300/include/asm/dma-mapping.h
> new file mode 100644
> index 0000000..e7e1690
> --- /dev/null
> +++ b/arch/h8300/include/asm/dma-mapping.h
> @@ -0,0 +1 @@
> +#include <asm-generic/dma-mapping.h>
> diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
> index cabba33..57ad603 100644
> --- a/arch/m32r/Kconfig
> +++ b/arch/m32r/Kconfig
> @@ -35,7 +35,7 @@ config NO_IOPORT
>  	def_bool y
>  
>  config NO_DMA
> -	def_bool y
> +	def_bool n
>  
>  config HZ
>  	int
> diff --git a/arch/m32r/include/asm/dma-mapping.h b/arch/m32r/include/asm/dma-mapping.h
> new file mode 100644
> index 0000000..e7e1690
> --- /dev/null
> +++ b/arch/m32r/include/asm/dma-mapping.h
> @@ -0,0 +1 @@
> +#include <asm-generic/dma-mapping.h>
> diff --git a/include/asm-generic/dma-mapping.h b/include/asm-generic/dma-mapping.h
> new file mode 100644
> index 0000000..5a14fed
> --- /dev/null
> +++ b/include/asm-generic/dma-mapping.h
> @@ -0,0 +1,399 @@
> +#ifndef _ASM_GENERIC_DMA_MAPPING_H
> +#define _ASM_GENERIC_DMA_MAPPING_H
> +/*
> + * This provides a no-op variant of the DMA mapping API,
> + * for use by architectures that do not actually support
> + * DMA, or that are fully consistent and linear-mapped
> + * in their DMA implementation.
> + */
> +
> +#include <asm/scatterlist.h>
> +
> +/*
> + * If any driver asks for DMA, it's not supported.
> + */
> +#ifndef dma_supported
> +static inline int
> +dma_supported(struct device *dev, u64 mask)
> +{
> +	return 0;
> +}
> +#endif

NACK'ed, sorry.

- these idndef tricks are really ugly and wrong.

- these functions are not generic at all.

- it's confusing to have two ways to handle this issue;
dma-mapping-broken.h and dma-mapping.h.

  parent reply	other threads:[~2009-05-18 10:46 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090511222702.352192505@arndb.de>
2009-05-11 22:37 ` [PATCH] mb862xxfb: use CONFIG_OF instead of CONFIG_PPC_OF Arnd Bergmann
2009-05-13 12:25   ` Anatolij Gustschin
2009-05-11 22:38 ` [PATCH] ata: libata depends on HAS_DMA Arnd Bergmann
2009-05-12  0:58   ` Jeff Garzik
2009-05-12 12:40     ` Arnd Bergmann
2009-05-12 13:05       ` Arnd Bergmann
2009-05-12 13:05         ` Arnd Bergmann
2009-05-12  8:06   ` Alan Cox
2009-05-12  9:23     ` Arnd Bergmann
2009-05-12  9:23       ` Arnd Bergmann
2009-05-13  3:30       ` Brad Boyer
2009-05-13  3:30         ` Brad Boyer
2009-05-13  4:12         ` Michael Schmitz
2009-05-13  4:12         ` Michael Schmitz
2009-05-13  4:12           ` Michael Schmitz
2009-05-13  4:34           ` Brad Boyer
2009-05-13  4:34             ` Brad Boyer
2009-05-13  8:51             ` Alan Cox
2009-05-13  8:55               ` Geert Uytterhoeven
2009-05-13 23:57               ` Robert Hancock
2009-05-14  0:18                 ` FUJITA Tomonori
2009-05-15  5:31                   ` Tejun Heo
2009-05-15 11:16                     ` Arnd Bergmann
2009-05-15 11:16                       ` Arnd Bergmann
2009-05-15 11:21                       ` Tejun Heo
2009-05-15 11:55                         ` Arnd Bergmann
2009-05-17  9:00                           ` Robert Hancock
2009-05-17 19:38                             ` Arnd Bergmann
2009-05-17 20:05                               ` Jeff Garzik
2009-05-17 22:45                                 ` [PATCH] asm-generic: add a dma-mapping.h file Arnd Bergmann
2009-05-18  6:03                                   ` Geert Uytterhoeven
2009-05-18  6:03                                     ` Geert Uytterhoeven
2009-05-18  8:28                                     ` Arnd Bergmann
2009-05-18 10:45                                   ` FUJITA Tomonori [this message]
2009-05-18 14:45                                     ` Arnd Bergmann
2009-05-18 22:44                                       ` FUJITA Tomonori
2009-05-19 16:22                                         ` Arnd Bergmann
2009-05-19 17:01                                           ` Grant Grundler
2009-05-19 17:40                                             ` Arnd Bergmann
2009-05-19 18:08                                               ` Grant Grundler
2009-05-19 18:08                                                 ` Grant Grundler
2009-05-22 12:12                                           ` FUJITA Tomonori
2009-05-22 14:07                                             ` Arnd Bergmann
2009-05-22 14:38                                               ` FUJITA Tomonori
2009-05-22 15:05                                                 ` Arnd Bergmann
2009-05-26  4:36                                                   ` FUJITA Tomonori
2009-05-26 12:35                                                     ` Arnd Bergmann
2009-05-27  3:58                                                       ` FUJITA Tomonori
2009-05-18 22:54                                   ` Jeff Garzik
2009-05-18 23:22                                     ` FUJITA Tomonori
2009-05-18 10:45                       ` [PATCH] ata: libata depends on HAS_DMA FUJITA Tomonori
2009-05-13 10:39         ` Arnd Bergmann
2009-05-13 10:39           ` Arnd Bergmann
2009-05-13 10:39         ` Arnd Bergmann
2009-05-11 22:40 ` [PATCH] scsi: libsas " Arnd Bergmann
2009-05-11 22:50   ` James Bottomley
2009-05-11 22:59     ` James Bottomley
2009-05-11 23:16       ` Arnd Bergmann
2009-05-11 22:43 ` [PATCH] arm: rename CLOCK_TICK_RATE to ARM_TICK_RATE Arnd Bergmann
2009-05-11 23:11   ` [PATCH v2] " Arnd Bergmann
2009-05-13 17:11   ` [PATCH] " Arnd Bergmann
2009-05-11 22:50 ` [PATCH] x86: use PIT_TICK_RATE consistently Arnd Bergmann
2009-05-11 23:05   ` Arnd Bergmann
2009-05-11 22:55 ` [PATCH] move PIT_TICK_RATE to linux/timex.h Arnd Bergmann
2009-05-11 22:55   ` Arnd Bergmann
2009-05-12  0:01   ` Andrew Morton
2009-05-12  0:36     ` Arnd Bergmann
2009-05-11 22:57 ` [PATCH] mips: use PIT_TICK_RATE in i8253 Arnd Bergmann
2009-05-11 22:58 ` [PATCH] input: use PIT_TICK_RATE in vt beep ioctl Arnd Bergmann
2009-05-12  9:31   ` Alan Cox
2009-05-11 22:59 ` [PATCH] x86: fix ktermios-termio conversion Arnd Bergmann
2009-05-11 23:19   ` [PATCH v2] " Arnd Bergmann
2009-05-12  7:55     ` Ingo Molnar
2009-05-12  9:04       ` Arnd Bergmann
2009-05-12  9:10         ` Ingo Molnar
2009-05-12  9:21           ` Alan Cox
2009-05-12  9:26             ` Ingo Molnar
2009-05-12 10:05               ` Alan Cox
2009-05-12 10:15                 ` Ingo Molnar
2009-05-12 11:33                 ` [PATCH v3] " Arnd Bergmann
2009-05-12 11:42           ` [PATCH v2] " Arnd Bergmann
2009-05-12  9:17         ` Alan Cox
2009-05-11 23:02 ` [PATCH] ipc: use __ARCH_WANT_IPC_PARSE_VERSION in ipc/util.h Arnd Bergmann
2009-05-12  0:19   ` Serge E. Hallyn
2009-05-11 23:03 ` [PATCH] syscalls.h add the missing sys_pipe2 declaration Arnd Bergmann
2009-05-11 23:08   ` Arnd Bergmann

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=20090518194443R.fujita.tomonori@lab.ntt.co.jp \
    --to=fujita.tomonori@lab.ntt.co.jp \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arnd@arndb.de \
    --cc=flar@allandria.com \
    --cc=geert@linux-m68k.org \
    --cc=hancockrwd@gmail.com \
    --cc=htejun@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=schmitz@biophys.uni-duesseldorf.de \
    --cc=takata@linux-m32r.org \
    --cc=ysato@users.sourceforge.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.