linux/arch/arm
FUJITA Tomonori 8d8bb39b9e dma-mapping: add the device argument to dma_mapping_error()
Add per-device dma_mapping_ops support for CONFIG_X86_64 as POWER
architecture does:

This enables us to cleanly fix the Calgary IOMMU issue that some devices
are not behind the IOMMU (http://lkml.org/lkml/2008/5/8/423).

I think that per-device dma_mapping_ops support would be also helpful for
KVM people to support PCI passthrough but Andi thinks that this makes it
difficult to support the PCI passthrough (see the above thread).  So I
CC'ed this to KVM camp.  Comments are appreciated.

A pointer to dma_mapping_ops to struct dev_archdata is added.  If the
pointer is non NULL, DMA operations in asm/dma-mapping.h use it.  If it's
NULL, the system-wide dma_ops pointer is used as before.

If it's useful for KVM people, I plan to implement a mechanism to register
a hook called when a new pci (or dma capable) device is created (it works
with hot plugging).  It enables IOMMUs to set up an appropriate
dma_mapping_ops per device.

The major obstacle is that dma_mapping_error doesn't take a pointer to the
device unlike other DMA operations.  So x86 can't have dma_mapping_ops per
device.  Note all the POWER IOMMUs use the same dma_mapping_error function
so this is not a problem for POWER but x86 IOMMUs use different
dma_mapping_error functions.

The first patch adds the device argument to dma_mapping_error.  The patch
is trivial but large since it touches lots of drivers and dma-mapping.h in
all the architecture.

This patch:

dma_mapping_error() doesn't take a pointer to the device unlike other DMA
operations.  So we can't have dma_mapping_ops per device.

Note that POWER already has dma_mapping_ops per device but all the POWER
IOMMUs use the same dma_mapping_error function.  x86 IOMMUs use device
argument.

[akpm@linux-foundation.org: fix sge]
[akpm@linux-foundation.org: fix svc_rdma]
[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: fix bnx2x]
[akpm@linux-foundation.org: fix s2io]
[akpm@linux-foundation.org: fix pasemi_mac]
[akpm@linux-foundation.org: fix sdhci]
[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: fix sparc]
[akpm@linux-foundation.org: fix ibmvscsi]
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-26 12:00:03 -07:00
..
boot inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
common dma-mapping: add the device argument to dma_mapping_error() 2008-07-26 12:00:03 -07:00
configs [ARM] Merge most of the PXA work for initial merge 2008-07-14 23:34:46 +01:00
kernel kprobes: improve kretprobe scalability with hashed locking 2008-07-25 10:53:30 -07:00
lib [ARM] cache align memset and memzero 2008-06-22 22:44:39 +02:00
mach-aaec2000 arch: Remove unnecessary inclusions of asm/semaphore.h 2008-04-18 22:14:49 -04:00
mach-at91 Merge branches 'at91', 'dyntick', 'ep93xx', 'iop', 'ixp', 'misc', 'orion', 'omap-reviewed', 'rpc', 'rtc' and 's3c' into devel 2008-07-10 16:38:50 +01:00
mach-clps711x [ARM] Add initial sparsemem support 2008-04-19 11:36:48 +01:00
mach-clps7500 [ARM] Fix timer damage from d3d74453c3 2008-01-28 10:17:12 +00:00
mach-davinci arm: use non-racy method for /proc/davinci_clocks creation 2008-04-29 08:06:21 -07:00
mach-ebsa110 [ARM] Fix timer damage from d3d74453c3 2008-01-28 10:17:12 +00:00
mach-ep93xx [ARM] 5171/1: ep93xx: fix compilation of modules using clocks 2008-07-10 14:50:21 +01:00
mach-footbridge [ARM] 5015/1: arm: remove ARCH_CO285 2008-05-02 23:44:57 +01:00
mach-h720x [ARM] replace remaining __FUNCTION__ occurrences 2008-03-06 12:18:18 +00:00
mach-imx Merge branch 'imx' into devel 2008-07-10 16:41:50 +01:00
mach-integrator arm: bus_id -> dev_name() and dev_set_name() conversions 2008-07-21 21:55:03 -07:00
mach-iop13xx [ARM] replace remaining __FUNCTION__ occurrences 2008-03-06 12:18:18 +00:00
mach-iop32x leds: Add pca9532 platform data for Thecus N2100 2008-07-23 09:49:56 +01:00
mach-iop33x iop: unconditionally initialize the ATU on platforms known to be 'hosts' 2008-03-26 12:33:41 -07:00
mach-ixp4xx [ARM] Merge most of the PXA work for initial merge 2008-07-14 23:34:46 +01:00
mach-ixp23xx [ARM] remove duplicate includes 2008-01-26 14:50:07 +00:00
mach-ixp2000 [ARM] Fix timer damage from d3d74453c3 2008-01-28 10:17:12 +00:00
mach-kirkwood [ARM] Kirkwood: use chip_delay 2008-06-30 16:04:46 -04:00
mach-ks8695 [ARM] 4981/1: [KS8695] Simple LED driver 2008-04-17 15:58:25 +01:00
mach-l7200 [ARM] Remove compatibility layer for ARM irqs 2006-11-30 12:24:47 +00:00
mach-lh7a40x [ARM] fix lh7a40x/kev7a400 build 2008-04-20 16:40:47 +01:00
mach-loki [ARM] add Marvell Loki (88RC8480) SoC support 2008-06-22 22:45:02 +02:00
mach-msm [ARM] msm: dma support for MSM7X00A 2008-01-26 14:39:14 +00:00
mach-mv78xx0 [ARM] add Marvell 78xx0 ARM SoC support 2008-06-22 22:45:10 +02:00
mach-mx2 i.MX27 family: Add the Phytec PCM970 evaluation board 2008-07-05 10:03:01 +02:00
mach-mx3 MX3: Adapt mx31lite to new timer init style 2008-07-05 10:02:53 +02:00
mach-netx [ARM] replace remaining __FUNCTION__ occurrences 2008-03-06 12:18:18 +00:00
mach-ns9xxx Remove use of asm/semaphore.h 2008-07-24 08:31:00 -04:00
mach-omap1 Merge branches 'at91', 'dyntick', 'ep93xx', 'iop', 'ixp', 'misc', 'orion', 'omap-reviewed', 'rpc', 'rtc' and 's3c' into devel 2008-07-10 16:38:50 +01:00
mach-omap2 Merge branches 'at91', 'dyntick', 'ep93xx', 'iop', 'ixp', 'misc', 'orion', 'omap-reviewed', 'rpc', 'rtc' and 's3c' into devel 2008-07-10 16:38:50 +01:00
mach-orion5x [ARM] Orion: LED support for HP mv2120 2008-07-07 18:38:24 -04:00
mach-pnx4008 arch: Remove unnecessary inclusions of asm/semaphore.h 2008-04-18 22:14:49 -04:00
mach-pxa [ARM] Merge most of the PXA work for initial merge 2008-07-14 23:34:46 +01:00
mach-realview [ARM] 5121/1: Annotate platform_secondary_init with trace_hardirqs_off 2008-07-03 16:39:56 +01:00
mach-rpc Rename: linux/pata_platform.h to linux/ata_platform.h 2008-02-06 06:54:17 -05:00
mach-s3c2400 [ARM] 4157/2: S3C24XX: move arch/arch/mach-s3c2410 into cpu components 2007-02-11 17:36:09 +00:00
mach-s3c2410 [ARM] Acer n30: Minor style and indentation fixes. 2008-07-07 18:13:05 +01:00
mach-s3c2412 [ARM] S3C2412: Correct parents for EREFCLK and UREFCLK 2008-07-03 16:51:30 +01:00
mach-s3c2440 [ARM] AT2440EVB: Add DM9000A network controller support. 2008-07-07 18:13:01 +01:00
mach-s3c2442 [ARM] 4794/1: S3C24XX: Comonise S3C2440 and S3C2442 clock code 2008-01-28 13:20:52 +00:00
mach-s3c2443 [ARM] S3C2443: Add prediv clk and fix setting of h and p clocks 2008-07-07 18:13:02 +01:00
mach-sa1100 Merge branches 'pxa-ian' and 'pxa-xm270' into pxa 2008-07-12 21:42:04 +01:00
mach-shark [ARM] Fix timer damage from d3d74453c3 2008-01-28 10:17:12 +00:00
mach-versatile arch: Remove unnecessary inclusions of asm/semaphore.h 2008-04-18 22:14:49 -04:00
mm mm: drop unneeded pgdat argument from free_area_init_node() 2008-07-24 10:47:16 -07:00
nwfpe Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
oprofile smp_call_function: get rid of the unused nonatomic/retry argument 2008-06-26 11:24:35 +02:00
plat-iop [ARM] 5160/1: IOP3XX: gpio/gpiolib support 2008-07-09 23:31:42 +01:00
plat-mxc i.MX2 family: Add basic mach support 2008-07-05 10:03:02 +02:00
plat-omap gpio: sysfs interface 2008-07-25 10:53:30 -07:00
plat-orion [ARM] Orion: PCIe x4/x1 detection support 2008-06-22 22:45:09 +02:00
plat-s3c [ARM] 4518/1: S3C: Rename watchdog configuration options 2007-07-22 16:44:38 +01:00
plat-s3c24xx [ARM] S3C24XX: PWM API support. 2008-07-03 16:51:30 +01:00
tools [ARM] Update mach-types 2008-07-13 12:05:21 +01:00
vfp smp_call_function: get rid of the unused nonatomic/retry argument 2008-06-26 11:24:35 +02:00
Kconfig gpiolib: allow user-selection 2008-07-25 10:53:30 -07:00
Kconfig-nommu [ARM] 4532/1: allow configuration of processor ID 2007-10-12 23:43:02 +01:00
Kconfig.debug [ARM] CONFIG_DEBUG_STACK_USAGE 2008-01-26 14:50:06 +00:00
Makefile Merge branch 'imx' into devel 2008-07-10 16:41:50 +01:00