linux-stable/arch/powerpc/platforms/iseries
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
..
call_hpt.h [POWERPC] Kill typedef-ed structs for hash PTEs and BATs 2007-06-14 22:30:16 +10:00
call_pci.h [PATCH] powerpc: reintroduce HvCallPci_configLoad32 2006-05-24 16:08:56 +10:00
call_sm.h
dt.c [POWERPC] iSeries: Move viodasd probing 2007-10-11 20:40:48 +10:00
exception.h [POWERPC] Exception numbers are not relevant to iSeries 2007-08-22 16:48:36 +10:00
exception.S [POWERPC] Make iSeries spin on __secondary_hold_spinloop, like pSeries 2008-04-24 20:58:03 +10:00
htab.c [POWERPC] Fix iSeries_hpte_insert prototype 2007-10-17 22:30:08 +10:00
hvcall.S
hvlog.c
hvlpconfig.c [POWERPC] iseries: Move ItLpNaca into platforms/iseries 2006-07-13 18:42:52 +10:00
iommu.c powerpc/pseries: iommu enablement for CMO 2008-07-25 15:44:43 +10:00
ipl_parms.h [POWERPC] iSeries: Localise and constify some iSeries data 2008-04-15 21:21:25 +10:00
irq.c [POWERPC] Invert null match behaviour for irq_hosts 2007-09-14 01:33:20 +10:00
irq.h [POWERPC] iSeries_init_IRQ non-PCI tidy 2007-11-08 14:15:33 +11:00
it_exp_vpd_panel.h [POWERPC] iseries: Make ItExtVpdPanel private to iSeries 2006-07-13 18:42:29 +10:00
it_lp_naca.h [POWERPC] Typo fixes interrrupt -> interrupt 2007-08-17 11:01:51 +10:00
Kconfig powerpc: pci config cleanup 2008-07-16 17:57:34 -05:00
ksyms.c [POWERPC] Lazy interrupt disabling for 64-bit machines 2006-10-16 16:31:36 +10:00
lpardata.c [POWERPC] iSeries: Localise and constify some iSeries data 2008-04-15 21:21:25 +10:00
lpevents.c powerpc: use non-racy method for proc entries creation 2008-04-29 08:06:22 -07:00
main_store.h [POWERPC] iseries: remove some gcc 4.1 warnings 2006-08-25 13:27:35 +10:00
Makefile [POWERPC] iSeries: Merge vpdinfo.c into pci.c 2007-12-11 13:46:11 +11:00
mf.c dma-mapping: add the device argument to dma_mapping_error() 2008-07-26 12:00:03 -07:00
misc.S [POWERPC] Lazy interrupt disabling for 64-bit machines 2006-10-16 16:31:36 +10:00
naca.h [POWERPC] iSeries: Localise and constify some iSeries data 2008-04-15 21:21:25 +10:00
pci.c [POWERPC] arch/powerpc/platforms/iseries/pci.c: Use time_* macros 2008-03-26 08:44:05 +11:00
pci.h [POWERPC] fix iSeries PCI resource management 2007-12-20 16:18:10 +11:00
proc.c powerpc: use non-racy method for proc entries creation 2008-04-29 08:06:22 -07:00
processor_vpd.h
release_data.h [POWERPC] iSeries: Localise and constify some iSeries data 2008-04-15 21:21:25 +10:00
setup.c nohz: prevent tick stop outside of the idle loop 2008-07-18 18:10:28 +02:00
setup.h [POWERPC] iSeries: Fix sparse warnings in setup.c 2007-12-03 13:56:27 +11:00
smp.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
smp.h [POWERPC] Fix iseries/smp.c for irq breakage 2006-10-07 10:10:30 +10:00
spcomm_area.h [POWERPC] iSeries: Localise and constify some iSeries data 2008-04-15 21:21:25 +10:00
vio.c [POWERPC] free_property() must not be __init 2008-02-14 22:11:02 +11:00
viopath.c powerpc: use non-racy method for proc entries creation 2008-04-29 08:06:22 -07:00
vpd_areas.h [POWERPC] iSeries: Localise and constify some iSeries data 2008-04-15 21:21:25 +10:00