linux/include/asm-parisc
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
..
a.out.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
agp.h x86: remove flush_agp_mappings() 2008-01-30 13:34:07 +01:00
asmregs.h
assembly.h parisc: use conditional macro for 64-bit wide ops 2008-05-15 11:03:43 -04:00
atomic.h Add cmpxchg_local to parisc 2008-02-07 08:42:32 -08:00
auxvec.h
bitops.h generic: implement __fls on all 64-bit archs 2008-04-26 19:21:16 +02:00
bug.h Fix WARN_ON() on bitfield ops for all other archs 2007-08-01 20:45:38 -07:00
bugs.h
byteorder.h
cache.h [PARISC] Clean up the cache and tlb headers 2007-02-17 00:41:30 -05:00
cacheflush.h [PARISC] Add prototypes for flush_user_dcache_range and flush_user_icache_range 2007-02-17 00:43:51 -05:00
checksum.h parisc: fix miscompilation of ip_fast_csum with gcc >= 4.3 2008-06-13 10:49:56 -04:00
compat_rt_sigframe.h
compat_signal.h
compat_ucontext.h [PARISC] Arch-specific compat signals 2006-01-22 20:57:42 -05:00
compat.h asm-*/compat.h: fix typo in comment 2008-02-03 16:32:51 +02:00
cputime.h
current.h
delay.h
device.h Driver core: add dev_archdata to struct device 2006-12-01 14:52:01 -08:00
div64.h
dma-mapping.h dma-mapping: add the device argument to dma_mapping_error() 2008-07-26 12:00:03 -07:00
dma.h Fix misc .c/.h comment typos 2006-11-30 05:24:39 +01:00
eisa_bus.h
eisa_eeprom.h
elf.h [PARISC] clean up include/asm-parisc/elf.h 2008-03-15 19:12:10 -07:00
emergency-restart.h
errno.h [PARISC] Add ECANCELED to errno.h 2005-10-21 22:53:43 -04:00
fb.h fbdev: detect primary display device 2007-07-17 10:23:11 -07:00
fcntl.h Introduce O_CLOEXEC 2007-07-16 09:05:45 -07:00
fixmap.h [PARISC] move VMALLOC_* definitions to fixmap.h 2008-03-15 19:11:49 -07:00
floppy.h cleanup floppy.h 2007-10-17 08:42:55 -07:00
futex.h asm-*/futex.h should include linux/uaccess.h 2008-04-30 08:29:52 -07:00
grfioctl.h [PARISC] Use kzalloc and other janitor-style cleanups 2006-01-22 20:26:31 -05:00
hardirq.h
hardware.h [PARISC] fix section mismatches in arch/parisc/kernel 2007-05-27 13:36:27 -04:00
hw_irq.h [PATCH] genirq: add ->retrigger() irq op to consolidate hw_irq_resend() 2006-06-29 10:26:23 -07:00
ide.h ide: define MAX_HWIFS in <linux/ide.h> 2008-07-24 22:53:30 +02:00
io.h [PARISC] parisc: "extern inline" -> "static inline" 2007-10-18 00:58:41 -07:00
ioctl.h parisc: Remove ioctl.h content picked up from <asm-generic/ioctl.h>. 2008-05-15 11:03:34 -04:00
ioctls.h parisc: new termios definitions 2008-05-15 10:38:54 -04:00
ipcbuf.h
irq_regs.h Build fixes for struct pt_regs removal 2006-10-06 20:47:23 -06:00
irq.h [PARISC] Allow nested interrupts 2006-10-04 06:48:57 -06:00
Kbuild [PARISC] Export pdc.h for palo 2007-10-18 00:58:29 -07:00
kdebug.h move die notifier handling to common code 2007-05-08 11:15:04 -07:00
kmap_types.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
led.h [PARISC] Convert soft power switch driver to kthread 2007-02-17 01:03:43 -05:00
linkage.h include/asm-parisc/: Spelling fixes 2008-02-03 17:00:11 +02:00
local.h local_t: parisc cleanup 2007-05-08 11:15:20 -07:00
machdep.h
mc146818rtc.h
mckinley.h [PARISC] Add asm-parisc/mckinley.h bus header 2006-10-04 06:45:48 -06:00
mman.h [PATCH] Remove final references to deprecated "MAP_ANON" page protection flag 2007-02-11 10:51:17 -08:00
mmu_context.h Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
mmu.h
mmzone.h [PARISC] convert to use CONFIG_64BIT instead of __LP64__ 2007-02-17 01:17:13 -05:00
module.h [PARISC] convert to use CONFIG_64BIT instead of __LP64__ 2007-02-17 01:17:13 -05:00
msgbuf.h [PARISC] convert to use CONFIG_64BIT instead of __LP64__ 2007-02-17 01:17:13 -05:00
mutex.h [PATCH] mutex subsystem, add default include/asm-*/mutex.h files 2006-01-09 15:59:19 -08:00
namei.h
page.h PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
param.h [PARISC] Use CONFIG_HZ to determine interval timer rate (aka clock ticks) 2006-10-04 06:47:46 -06:00
parisc-device.h [PARISC] convert to use CONFIG_64BIT instead of __LP64__ 2007-02-17 01:17:13 -05:00
parport.h
pci.h [PARISC] parisc: "extern inline" -> "static inline" 2007-10-18 00:58:41 -07:00
pdc_chassis.h [PARISC] Clarify pdc_stable license terms 2006-03-30 17:48:41 +00:00
pdc.h [PARISC] pdc_console: fix bizarre panic on boot 2008-03-15 19:12:03 -07:00
pdcpat.h [PARISC] Remove duplicate PDC_PAT_CELL defines 2006-12-08 00:34:47 -05:00
percpu.h
perf.h
pgalloc.h [PARISC] unbreak pgalloc.h 2008-03-15 19:11:52 -07: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
prefetch.h [PARISC] parisc: "extern inline" -> "static inline" 2007-10-18 00:58:41 -07:00
processor.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
psw.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
ptrace.h include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
real.h
resource.h
ropes.h Fix misc .c/.h comment typos 2006-11-30 05:24:39 +01:00
rt_sigframe.h [PARISC] Arch-specific compat signals 2006-01-22 20:57:42 -05:00
rtc.h [PARISC] fix uninitialized variable warning in asm/rtc.h 2007-10-20 13:23:00 -07:00
runway.h
scatterlist.h parisc: fix sg_page() fallout 2007-10-23 09:49:31 +02:00
sections.h
segment.h
sembuf.h [PARISC] convert to use CONFIG_64BIT instead of __LP64__ 2007-02-17 01:17:13 -05:00
serial.h [PARISC] Clean up asm-parisc/serial.h 2006-10-04 06:47:03 -06:00
setup.h
shmbuf.h [PARISC] convert to use CONFIG_64BIT instead of __LP64__ 2007-02-17 01:17:13 -05:00
shmparam.h
sigcontext.h
siginfo.h
signal.h [PARISC] convert to use CONFIG_64BIT instead of __LP64__ 2007-02-17 01:17:13 -05:00
smp.h parisc: convert to generic helpers for IPI function calls 2008-06-26 11:22:57 +02:00
socket.h flag parameters: paccept 2008-07-24 10:47:27 -07:00
sockios.h [NET]: Introduce SIOCGSTAMPNS ioctl to get timestamps with nanosec resolution 2007-04-25 22:24:04 -07:00
spinlock_types.h [PARISC] "Fix" circular includes 2007-02-17 00:43:10 -05:00
spinlock.h [PARISC] Enable interrupts while spinning 2006-10-04 06:48:17 -06:00
stat.h
statfs.h [PATCH] use __u64 rather than u64 in parisc statfs structs 2007-02-08 18:56:57 -05:00
string.h
superio.h
system.h [PATCH] sched: sched_cacheflush is now unused 2007-07-19 21:28:35 +02:00
termbits.h parisc: new termios definitions 2008-05-15 10:38:54 -04:00
termios.h parisc: new termios definitions 2008-05-15 10:38:54 -04:00
thread_info.h clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
timex.h
tlb.h add mm argument to pte/pmd/pud/pgd_free 2008-02-05 09:44:18 -08:00
tlbflush.h remove unused flush_tlb_pgtables 2007-10-19 11:53:34 -07:00
topology.h
traps.h
types.h parisc: types: use <asm-generic/int-*.h> for the parisc architecture 2008-05-02 16:18:32 -07:00
uaccess.h [PARISC] add ASM_EXCEPTIONTABLE_ENTRY() macro 2007-02-17 01:16:26 -05:00
ucontext.h
unaligned.h kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
unistd.h [PARISC] bump __NR_syscalls 2008-03-15 19:11:54 -07:00
unwind.h
user.h
vga.h vga.h: Fix prepocessor warning 2008-02-03 15:59:02 +02:00
xor.h