linux/include/asm-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
..
arch-aaec2000 Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
arch-at91 mmc: at91_mci: avoid timeouts 2008-07-15 14:14:42 +02:00
arch-cl7500 [ARM] Use new get_irqnr_preamble 2007-05-12 15:25:50 +01:00
arch-clps711x [ARM] 4185/2: entry: introduce get_irqnr_preamble and arch_ret_to_user 2007-02-17 15:04:29 +00:00
arch-davinci [ARM] 4634/1: DaVinci GPIO header build fix 2007-10-31 15:21:52 +00:00
arch-ebsa110 [ARM] Use new get_irqnr_preamble 2007-05-12 15:25:50 +01:00
arch-ebsa285 [ARM] 5015/1: arm: remove ARCH_CO285 2008-05-02 23:44:57 +01:00
arch-ep93xx [ARM] 4988/1: Add GPIO lib support to the EP93xx 2008-04-19 14:01:43 +01:00
arch-h720x [ARM] 4185/2: entry: introduce get_irqnr_preamble and arch_ret_to_user 2007-02-17 15:04:29 +00:00
arch-imx Merge branch 'imx' into devel 2008-07-10 16:41:50 +01:00
arch-integrator [ARM] Remove Integrator/CP SMP platform support 2007-05-16 15:35:26 +01:00
arch-iop13xx Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx 2008-07-23 12:03:18 -07:00
arch-iop32x [ARM] 5160/1: IOP3XX: gpio/gpiolib support 2008-07-09 23:31:42 +01:00
arch-iop33x [ARM] 5160/1: IOP3XX: gpio/gpiolib support 2008-07-09 23:31:42 +01:00
arch-ixp4xx [ARM] 4874/2: ixp4xx: Add support for the Freecom FSG-3 board 2008-04-04 10:03:59 +01:00
arch-ixp23xx [ARM] 4680/1: parentheses around NR_IRQS definition 2007-11-29 20:56:57 +00:00
arch-ixp2000 [ARM] 4185/2: entry: introduce get_irqnr_preamble and arch_ret_to_user 2007-02-17 15:04:29 +00:00
arch-kirkwood [ARM] Kirkwood: support L2 writeback mode 2008-06-30 14:25:24 -04:00
arch-ks8695 [ARM] 4981/1: [KS8695] Simple LED driver 2008-04-17 15:58:25 +01:00
arch-l7200 [ARM] 4185/2: entry: introduce get_irqnr_preamble and arch_ret_to_user 2007-02-17 15:04:29 +00:00
arch-lh7a40x [ARM] 4248/1: lh7a40x: fix missing definitions for get_irqnr_preamble 2007-03-08 13:33:57 +00:00
arch-loki [ARM] add Marvell Loki (88RC8480) SoC support 2008-06-22 22:45:02 +02:00
arch-msm [ARM] fix header guards 2008-07-03 16:39:56 +01:00
arch-mv78xx0 [ARM] add Marvell 78xx0 ARM SoC support 2008-06-22 22:45:10 +02:00
arch-mxc i.MX27 family: Add the Phytec PCM970 evaluation board 2008-07-05 10:03:01 +02:00
arch-netx [ARM] 4329/1: fix position of NETX_SYSTEM_REG 2007-05-03 20:22:49 +01:00
arch-ns9xxx ns9xxx: fix assembler version of __REG2 to be consistent with the C version 2008-05-30 10:46:11 +02:00
arch-omap ARM: OMAP2: Clock: New OMAP2/3 DPLL rate rounding algorithm 2008-07-03 12:24:46 +03:00
arch-orion5x [ARM] Orion: add a separate BRIDGE_INT_TIMER1_CLR define 2008-06-22 22:45:01 +02:00
arch-pnx4008 [ARM] 4185/2: entry: introduce get_irqnr_preamble and arch_ret_to_user 2007-02-17 15:04:29 +00:00
arch-pxa [ARM] Merge most of the PXA work for initial merge 2008-07-14 23:34:46 +01:00
arch-realview RealView: Add uncompressing support for PB1176 2008-04-18 22:43:16 +01:00
arch-rpc [ARM] rpc: deprecate __ioaddr() and __ioaddrc() helpers 2008-07-03 14:25:58 +01:00
arch-s3c2400 [ARM] 4522/1: S3C: split include/asm-arm/arch/memory.h 2007-07-22 17:06:04 +01:00
arch-s3c2410 MMC: S3C24XX MMC/SD driver. 2008-07-15 14:14:46 +02:00
arch-sa1100 pm: remove remaining obsolete definitions from pm.h 2008-07-24 10:47:22 -07:00
arch-shark [ARM] 4185/2: entry: introduce get_irqnr_preamble and arch_ret_to_user 2007-02-17 15:04:29 +00:00
arch-versatile fix typo 'the same the\>' 2008-02-03 14:59:11 +02:00
hardware Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx 2008-07-23 12:03:18 -07:00
mach Merge branch 'pxa' into devel 2008-07-13 12:05:49 +01:00
plat-orion Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx 2008-07-23 12:03:18 -07:00
plat-s3c [ARM] S3C24XX: Add PWM timer MUX defines 2008-07-03 16:51:23 +01:00
plat-s3c24xx MMC: S3C24XX: Add media presence test to request handling. 2008-07-15 14:14:48 +02:00
.gitignore [ARM] 4216/1: add .gitignore entries for ARM specific files 2007-02-17 11:26:41 +00:00
a.out-core.h aout: suppress A.OUT library support if !CONFIG_ARCH_SUPPORTS_AOUT 2008-02-08 09:22:30 -08:00
a.out.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
assembler.h [ARM] cache align destination pointer when copying memory for some processors 2008-06-22 22:44:38 +02:00
atomic.h atomic.h: atomic_add_unless as inline. Remove system.h atomic.h circular dependency 2007-05-08 11:15:20 -07:00
auxvec.h [PATCH] auxiliary vector cleanups 2005-09-07 16:57:21 -07:00
bitops.h ext4: Add ext4_find_next_bit() 2008-01-28 23:58:27 -05:00
bug.h [ARM] 3983/2: remove unused argument to __bug() 2006-12-07 22:38:09 +00:00
bugs.h [ARM] nommu: adjust headers for !MMU ARM systems 2006-06-28 17:59:45 +01:00
byteorder.h [ARM] Fix byte order macros for Thumb 2006-06-19 15:35:36 +01:00
cache.h [PATCH] Kill L1_CACHE_SHIFT_MAX 2006-01-08 20:13:39 -08:00
cacheflush.h 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
checksum.h [ARM] Improve csum_fold, cleanup csum_tcpudp_magic() 2007-02-06 16:46:46 +00:00
cnt32_to_63.h [ARM] 3978/1: macro to provide a 63-bit value from a 32-bit hardware counter 2006-12-07 16:06:45 +00:00
cpu-multi32.h Add a prefetch abort handler 2008-04-18 22:43:07 +01:00
cpu-single.h [ARM] Unuse another Linux PTE bit 2006-12-13 14:34:43 +00:00
cpu.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
cputime.h
current.h
delay.h [ARM] 3346/1: Fix udelay() for HZ values different from 100 2006-03-21 22:06:07 +00:00
device.h [ARM] Add a reference from struct device to the dma bounce info 2007-02-12 10:28:24 +00:00
div64.h rename div64_64 to div64_u64 2008-05-01 08:03:58 -07:00
dma-mapping.h dma-mapping: add the device argument to dma_mapping_error() 2008-07-26 12:00:03 -07:00
dma.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
domain.h [ARM] 4127/1: Flush the prefetch buffer after changing the DACR 2007-02-08 14:49:18 +00:00
ecard.h [ARM] rpc: ecard: remove deprecated ecard_address() and relatives 2008-07-03 14:25:58 +01:00
elf.h Cleanup asm/{elf,page,user}.h: #ifdef __KERNEL__ is no longer needed 2008-02-07 08:42:30 -08:00
emergency-restart.h [PATCH] Add emergency_restart() 2005-07-26 14:35:41 -07:00
errno.h
fb.h fbdev: detect primary display device 2007-07-17 10:23:11 -07:00
fcntl.h [PATCH] Clean up struct flock64 definitions 2005-09-07 16:57:38 -07:00
fiq.h
flat.h [ARM] nommu: fix breakage caused by f9720205d1 2007-10-31 15:21:42 +00:00
floppy.h cleanup floppy.h 2007-10-17 08:42:55 -07:00
fpstate.h [ARM] 4583/1: ARMv7: Add VFPv3 support 2008-01-26 14:41:28 +00:00
ftrace.h ftrace: store mcount address in rec->ip 2008-06-23 22:10:56 +02:00
futex.h [PATCH] consolidate asm/futex.h 2006-01-08 20:13:39 -08:00
glue.h Add a prefetch abort handler 2008-04-18 22:43:07 +01:00
gpio.h [PATCH] GPIO core 2007-02-12 09:48:34 -08:00
hardirq.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
hardware.h
hw_irq.h [ARM] dyntick: Remove obsolete and unused ARM dyntick support 2008-05-12 17:39:14 +01:00
hwcap.h ARMv7: Add support for the ThumbEE state saving/restoring 2008-04-18 22:43:06 +01:00
ide.h ide: define MAX_HWIFS in <linux/ide.h> 2008-07-24 22:53:30 +02:00
io.h endianness annotations in arm io.h 2007-10-14 12:41:52 -07:00
ioctl.h [PATCH] Generic ioctl.h 2006-01-10 08:01:34 -08:00
ioctls.h [ARM] enable arbitary speed tty ioctls and split input/output speed 2007-05-28 23:07:34 +01:00
ipcbuf.h
irq_regs.h Initial blind fixup for arm for irq changes 2006-10-06 10:59:54 -07:00
irq.h [ARM] 4073/1: Prevent s3c24xx drivers from including asm/arch/hardware.h and asm/arch/irqs.h 2006-12-30 17:05:07 +00:00
irqflags.h [ARM] Add ARM irqtrace support 2006-09-20 14:58:35 +01:00
Kbuild [ARM] 4473/2: Take the HWCAP definitions out of the elf.h file 2007-07-12 16:20:15 +01:00
kdebug.h move die notifier handling to common code 2007-05-08 11:15:04 -07:00
kexec.h There is no need to have BOOT_PARAMS_SIZE known outside of atags.c 2008-05-30 10:30:05 +02:00
kgdb.h kgdb: support for ARCH=arm 2008-07-23 11:30:15 -05:00
kmap_types.h
kprobes.h ftrace: export kretprobe_trampoline for function tracer 2008-06-02 13:32:10 +02:00
leds.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
limits.h
linkage.h [ARM] VFP: fix section mismatch error 2007-06-10 12:22:20 +01:00
local.h
locks.h [ARM] 3019/1: fix wrong comments 2005-10-18 07:51:34 +01:00
mc146818rtc.h
memory.h [ARM] Add initial sparsemem support 2008-04-19 11:36:48 +01:00
mman.h [PATCH] add asm-generic/mman.h 2006-02-15 15:32:22 -08:00
mmu_context.h [ARM] 5092/1: Fix the I-cache invalidation on ARMv6 and later CPUs 2008-07-03 16:39:57 +01:00
mmu.h [ARM] ARMv6: add CPU_HAS_ASID configuration 2007-05-17 10:19:23 +01:00
mmzone.h
module.h
msgbuf.h
mtd-xip.h
mutex.h misc: removal of final callers using fastcall 2008-02-08 09:22:31 -08:00
namei.h
nwflash.h
page-nommu.h PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
page.h PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
param.h [ARM] Move HZ definition into Kconfig 2006-03-21 22:05:45 +00:00
parport.h
pci.h [ARM] 4577/1: ITE 8152 PCI bridge support 2007-10-15 18:53:59 +01:00
percpu.h
pgalloc.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
pgtable-hwdef.h [ARM] Set bit 4 on section mappings correctly depending on CPU 2006-06-29 18:24:21 +01:00
pgtable-nommu.h [ARM] 5060/1: remove unnecessary include of asm/io.h 2008-06-01 11:22:25 +01:00
pgtable.h mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
poll.h Consolidate asm/poll.h 2007-05-11 08:29:34 -07:00
posix_types.h asm-*/posix_types.h: scrub __GLIBC__ 2008-02-08 09:22:34 -08:00
proc-fns.h [ARM] include/asm-arm - use angle brackets for includes 2008-03-06 12:18:18 +00:00
processor.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
procinfo.h [ARM] Move HWCAP_* definitions to asm/elf.h 2006-11-30 12:24:46 +00:00
ptrace.h include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
resource.h
scatterlist.h Add CONFIG_DEBUG_SG sg validation 2007-10-22 21:20:03 +02:00
sections.h
segment.h
sembuf.h
serial.h
setup.h [ARM] use __used attribute 2007-05-30 13:15:06 +01:00
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h [PATCH] ARM: fixup irqflags breakage after ARM genirq merge 2006-07-02 17:29:22 -07:00
sizes.h [ARM] 4372/1: Define byte sizes in asm-arm/sizes.h 2007-05-11 21:07:58 +01:00
smp.h arm: convert to generic helpers for IPI function calls 2008-06-26 11:22:57 +02:00
socket.h [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
sockios.h [NET]: Introduce SIOCGSTAMPNS ioctl to get timestamps with nanosec resolution 2007-04-25 22:24:04 -07:00
sparsemem.h [ARM] Add initial sparsemem support 2008-04-19 11:36:48 +01:00
spinlock_types.h [PATCH] spinlock consolidation 2005-09-10 10:06:21 -07:00
spinlock.h [ARM] 5067/1: _raw_write_can_lock macro bugfix 2008-06-02 13:44:17 +01:00
stat.h [ARM] 3106/2: ARM EABI: some syscall adjustments 2006-01-14 16:32:12 +00:00
statfs.h [ARM] 3108/2: old ABI compat: statfs64 and fstatfs64 2006-01-14 16:35:03 +00:00
string.h
suspend.h
system.h [ARM] 5053/1: define before use of processor_id 2008-05-23 13:50:08 +01:00
termbits.h [ARM] enable arbitary speed tty ioctls and split input/output speed 2007-05-28 23:07:34 +01:00
termios.h [ARM] enable arbitary speed tty ioctls and split input/output speed 2007-05-28 23:07:34 +01:00
therm.h
thread_info.h clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
thread_notify.h [ARM] Add thread_notify infrastructure 2006-06-22 10:24:18 +01:00
timex.h
tlb.h add mm argument to pte/pmd/pud/pgd_free 2008-02-05 09:44:18 -08:00
tlbflush.h [ARM] Feroceon: L2 cache support 2008-06-22 22:45:04 +02:00
topology.h
traps.h kgdb: support for ARCH=arm 2008-07-23 11:30:15 -05:00
types.h arm: types: use <asm-generic/int-*.h> for the arm architecture 2008-05-02 16:18:20 -07:00
uaccess.h Storage class should be before const qualifier 2007-02-17 20:11:19 +01:00
ucontext.h [ARM] 3664/1: crunch: add signal frame save/restore 2006-06-28 17:54:59 +01:00
unaligned.h kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
unistd.h [ARM] 4852/1: Add timerfd_create, timerfd_settime and timerfd_gettime syscall entries 2008-04-19 11:28:06 +01:00
user.h Sanitize the type of struct user.u_ar0 2008-02-07 08:42:30 -08:00
vfp.h [ARM] 4583/1: ARMv7: Add VFPv3 support 2008-01-26 14:41:28 +00:00
vfpmacros.h [ARM] 4583/1: ARMv7: Add VFPv3 support 2008-01-26 14:41:28 +00:00
vga.h [PATCH] vgacon: make VGA_MAP_MEM take size, remove extra use 2006-06-22 15:05:58 -07:00
xor.h