Re: [PATCH] Add io-mapping functions to dynamically map largedevice apertures

From: Ingo Molnar
Date: Fri Oct 31 2008 - 05:21:46 EST



* Eric Anholt <eric@xxxxxxxxxx> wrote:

> From: Keith Packard <keithp@xxxxxxxxxx>
>
> Graphics devices have large PCI apertures which would consume a significant
> fraction of a 32-bit address space if mapped during driver initialization.
> Using ioremap at runtime is impractical as it is too slow. This new set of
> interfaces uses atomic mappings on 32-bit processors and a large static
> mapping on 64-bit processors to provide reasonable 32-bit performance and
> optimal 64-bit performance.
>
> The current implementation sits atop the io_map_atomic fixmap-based mechanism
> for 32-bit processors.
>
> This includes some editorial suggestions from Randy Dunlap for
> Documentation/io-mapping.txt
>
> Signed-off-by: Keith Packard <keithp@xxxxxxxxxx>
> Signed-off-by: Eric Anholt <eric@xxxxxxxxxx>
> ---
> Documentation/io-mapping.txt | 76 +++++++++++++++++++++++++++
> include/linux/io-mapping.h | 118 ++++++++++++++++++++++++++++++++++++++++++

I've applied your three patches to tip/core/resources for testing,
thanks!

One small detail:

> +++ b/include/linux/io-mapping.h

> +#ifdef CONFIG_X86_64

it's ugly and inflexible to put x86 dependencies into generic headers.
(even though with a high likelyhood 32-bit x86 will be the only arch
to ever implement the iomap_atomic() APIs)

Instead please add a HAVE_ATOMIC_IOMAP define to arch/x86/Kconfig:

config HAVE_ATOMIC_IOMAP
def_bool y
depends on X86_32

... and use #ifndef HAVE_ATOMIC_IOMAP in include/linux/io-mapping.h
instead of #ifdef CONFIG_X86_64.

( Other 32-bit architectures which need an atomic iomap implementation
for address space reasons can then implement the iomap_atomic*()
APIs too and set this same flag, to gain the same generic io_mapping
implementation. )

Please send this cleanup as a delta patch, ontop of your three
patches.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/