--- v9
+++ v5
@@ -13,8 +13,7 @@
This removes tce_xxx_rm handlers from ppc_md but does not add
them to iommu_table_ops as this will be done later if we decide to
-support TCE hypercalls in real mode. This removes _vm callbacks as
-only virtual mode is supported by now so this also removes @rm parameter.
+support TCE hypercalls in real mode.
For pSeries, this always uses tce_buildmulti_pSeriesLP/
tce_buildmulti_pSeriesLP. This changes multi callback to fall back to
@@ -24,41 +23,27 @@
all IOMMU tables in the system and replace "multi" callbacks with single
ones.
-For powernv, this defines _ops per PHB type which are P5IOC2/IODA1/IODA2.
-This makes the callbacks for them public. Later patches will extend
-callbacks for IODA1/2.
-
-No change in behaviour is expected.
-
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
-Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
----
-Changes:
-v9:
-* pnv_tce_build/pnv_tce_free/pnv_tce_get have been made public and lost
-"rm" parameters to make following patches simpler (realmode is not
-supported here anyway)
-* got rid of _vm versions of callbacks
---
arch/powerpc/include/asm/iommu.h | 17 +++++++++++
- arch/powerpc/include/asm/machdep.h | 25 ---------------
- arch/powerpc/kernel/iommu.c | 46 ++++++++++++++--------------
- arch/powerpc/kernel/vio.c | 5 +++
+ arch/powerpc/include/asm/machdep.h | 25 ----------------
+ arch/powerpc/kernel/iommu.c | 46 +++++++++++++++--------------
+ arch/powerpc/kernel/vio.c | 5 ++++
arch/powerpc/platforms/cell/iommu.c | 8 +++--
arch/powerpc/platforms/pasemi/iommu.c | 7 +++--
- arch/powerpc/platforms/powernv/pci-ioda.c | 14 +++++++++
- arch/powerpc/platforms/powernv/pci-p5ioc2.c | 7 +++++
- arch/powerpc/platforms/powernv/pci.c | 47 +++++------------------------
- arch/powerpc/platforms/powernv/pci.h | 5 +++
- arch/powerpc/platforms/pseries/iommu.c | 34 ++++++++++++---------
- arch/powerpc/sysdev/dart_iommu.c | 12 +++++---
- 12 files changed, 116 insertions(+), 111 deletions(-)
+ arch/powerpc/platforms/powernv/pci-ioda.c | 2 ++
+ arch/powerpc/platforms/powernv/pci-p5ioc2.c | 1 +
+ arch/powerpc/platforms/powernv/pci.c | 23 ++++-----------
+ arch/powerpc/platforms/powernv/pci.h | 1 +
+ arch/powerpc/platforms/pseries/iommu.c | 34 +++++++++++----------
+ arch/powerpc/sysdev/dart_iommu.c | 12 ++++----
+ 12 files changed, 93 insertions(+), 88 deletions(-)
diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h
-index 5eb6e76..f0cab49 100644
+index 2af2d70..d909e2a 100644
--- a/arch/powerpc/include/asm/iommu.h
+++ b/arch/powerpc/include/asm/iommu.h
-@@ -44,6 +44,22 @@
+@@ -43,6 +43,22 @@
extern int iommu_is_off;
extern int iommu_force_on;
@@ -81,7 +66,7 @@
/*
* IOMAP_MAX_ORDER defines the largest contiguous block
* of dma space we can get. IOMAP_MAX_ORDER = 13
-@@ -78,6 +94,7 @@ struct iommu_table {
+@@ -77,6 +93,7 @@ struct iommu_table {
#ifdef CONFIG_IOMMU_API
struct iommu_group *it_group;
#endif
@@ -90,7 +75,7 @@
};
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
-index ef889943..ab721b4 100644
+index c8175a3..2abe744 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -65,31 +65,6 @@ struct machdep_calls {
@@ -126,7 +111,7 @@
unsigned long flags, void *caller);
void (*iounmap)(volatile void __iomem *token);
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
-index e0e94c7..e289f91 100644
+index 865beef..57cb615 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -322,11 +322,11 @@ static dma_addr_t iommu_alloc(struct device *dev, struct iommu_table *tbl,
@@ -235,7 +220,7 @@
/* number of bytes needed for the bitmap */
sz = BITS_TO_LONGS(tbl->it_size) * sizeof(unsigned long);
-@@ -944,8 +946,8 @@ EXPORT_SYMBOL_GPL(iommu_tce_direction);
+@@ -934,8 +936,8 @@ EXPORT_SYMBOL_GPL(iommu_direction_to_tce_perm);
void iommu_flush_tce(struct iommu_table *tbl)
{
/* Flush/invalidate TLB caches if necessary */
@@ -246,7 +231,7 @@
/* Make sure updates are seen by hardware */
mb();
-@@ -956,7 +958,7 @@ int iommu_tce_clear_param_check(struct iommu_table *tbl,
+@@ -946,7 +948,7 @@ int iommu_tce_clear_param_check(struct iommu_table *tbl,
unsigned long ioba, unsigned long tce_value,
unsigned long npages)
{
@@ -255,7 +240,7 @@
if (tce_value)
return -EINVAL;
-@@ -1004,9 +1006,9 @@ unsigned long iommu_clear_tce(struct iommu_table *tbl, unsigned long entry)
+@@ -994,9 +996,9 @@ unsigned long iommu_clear_tce(struct iommu_table *tbl, unsigned long entry)
spin_lock(&(pool->lock));
@@ -267,7 +252,7 @@
else
oldtce = 0;
-@@ -1029,10 +1031,10 @@ int iommu_tce_build(struct iommu_table *tbl, unsigned long entry,
+@@ -1019,10 +1021,10 @@ int iommu_tce_build(struct iommu_table *tbl, unsigned long entry,
spin_lock(&(pool->lock));
@@ -297,10 +282,10 @@
}
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
-index 21b5023..14a582b 100644
+index c7c8720..72763a8 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
-@@ -466,6 +466,11 @@ static inline u32 cell_iommu_get_ioid(struct device_node *np)
+@@ -465,6 +465,11 @@ static inline u32 cell_iommu_get_ioid(struct device_node *np)
return *ioid;
}
@@ -312,7 +297,7 @@
static struct iommu_window * __init
cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np,
unsigned long offset, unsigned long size,
-@@ -492,6 +497,7 @@ cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np,
+@@ -491,6 +496,7 @@ cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np,
window->table.it_offset =
(offset >> window->table.it_page_shift) + pte_offset;
window->table.it_size = size >> window->table.it_page_shift;
@@ -320,9 +305,9 @@
iommu_init_table(&window->table, iommu->nid);
-@@ -1201,8 +1207,6 @@ static int __init cell_iommu_init(void)
- /* Setup various callbacks */
- cell_pci_controller_ops.dma_dev_setup = cell_pci_dma_dev_setup;
+@@ -1200,8 +1206,6 @@ static int __init cell_iommu_init(void)
+ /* Setup various ppc_md. callbacks */
+ ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup;
ppc_md.dma_get_required_mask = cell_dma_get_required_mask;
- ppc_md.tce_build = tce_build_cell;
- ppc_md.tce_free = tce_free_cell;
@@ -330,10 +315,10 @@
if (!iommu_fixed_disabled && cell_iommu_fixed_mapping_init() == 0)
goto bail;
diff --git a/arch/powerpc/platforms/pasemi/iommu.c b/arch/powerpc/platforms/pasemi/iommu.c
-index b8f567b..c929644 100644
+index 2e576f2..b7245b2 100644
--- a/arch/powerpc/platforms/pasemi/iommu.c
+++ b/arch/powerpc/platforms/pasemi/iommu.c
-@@ -134,6 +134,10 @@ static void iobmap_free(struct iommu_table *tbl, long index,
+@@ -132,6 +132,10 @@ static void iobmap_free(struct iommu_table *tbl, long index,
}
}
@@ -344,7 +329,7 @@
static void iommu_table_iobmap_setup(void)
{
-@@ -153,6 +157,7 @@ static void iommu_table_iobmap_setup(void)
+@@ -151,6 +155,7 @@ static void iommu_table_iobmap_setup(void)
* Should probably be 8 (64 bytes)
*/
iommu_table_iobmap.it_blocksize = 4;
@@ -352,141 +337,52 @@
iommu_init_table(&iommu_table_iobmap, 0);
pr_debug(" <- %s\n", __func__);
}
-@@ -252,8 +257,6 @@ void __init iommu_init_early_pasemi(void)
-
- pasemi_pci_controller_ops.dma_dev_setup = pci_dma_dev_setup_pasemi;
- pasemi_pci_controller_ops.dma_bus_setup = pci_dma_bus_setup_pasemi;
+@@ -250,8 +255,6 @@ void __init iommu_init_early_pasemi(void)
+
+ ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_pasemi;
+ ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_pasemi;
- ppc_md.tce_build = iobmap_build;
- ppc_md.tce_free = iobmap_free;
set_pci_dma_ops(&dma_iommu_ops);
}
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
-index eff26ed..7a9137a 100644
+index 304c020..6297093 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
-@@ -1710,6 +1710,12 @@ static void pnv_pci_ioda1_tce_invalidate(struct pnv_ioda_pe *pe,
- */
- }
-
-+static struct iommu_table_ops pnv_ioda1_iommu_ops = {
-+ .set = pnv_tce_build,
-+ .clear = pnv_tce_free,
-+ .get = pnv_tce_get,
-+};
-+
- static void pnv_pci_ioda2_tce_invalidate(struct pnv_ioda_pe *pe,
- struct iommu_table *tbl,
- __be64 *startp, __be64 *endp, bool rm)
-@@ -1755,6 +1761,12 @@ void pnv_pci_ioda_tce_invalidate(struct iommu_table *tbl,
- pnv_pci_ioda2_tce_invalidate(pe, tbl, startp, endp, rm);
- }
-
-+static struct iommu_table_ops pnv_ioda2_iommu_ops = {
-+ .set = pnv_tce_build,
-+ .clear = pnv_tce_free,
-+ .get = pnv_tce_get,
-+};
-+
- static void pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb,
- struct pnv_ioda_pe *pe, unsigned int base,
- unsigned int segs)
-@@ -1828,6 +1840,7 @@ static void pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb,
+@@ -1233,6 +1233,7 @@ static void pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb,
TCE_PCI_SWINV_FREE |
TCE_PCI_SWINV_PAIR);
}
-+ tbl->it_ops = &pnv_ioda1_iommu_ops;
++ tbl->it_ops = &pnv_iommu_ops;
iommu_init_table(tbl, phb->hose->node);
-
- if (pe->flags & PNV_IODA_PE_DEV) {
-@@ -1968,6 +1981,7 @@ static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb *phb,
+ iommu_register_group(tbl, phb->hose->global_number, pe->pe_number);
+
+@@ -1366,6 +1367,7 @@ static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb *phb,
8);
tbl->it_type |= (TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE);
}
-+ tbl->it_ops = &pnv_ioda2_iommu_ops;
++ tbl->it_ops = &pnv_iommu_ops;
iommu_init_table(tbl, phb->hose->node);
-
- if (pe->flags & PNV_IODA_PE_DEV) {
+ iommu_register_group(tbl, phb->hose->global_number, pe->pe_number);
+
diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
-index 4729ca7..f05057e 100644
+index 6ef6d4d..0256fcc 100644
--- a/arch/powerpc/platforms/powernv/pci-p5ioc2.c
+++ b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
-@@ -83,10 +83,17 @@ static void pnv_pci_init_p5ioc2_msis(struct pnv_phb *phb)
- static void pnv_pci_init_p5ioc2_msis(struct pnv_phb *phb) { }
- #endif /* CONFIG_PCI_MSI */
-
-+static struct iommu_table_ops pnv_p5ioc2_iommu_ops = {
-+ .set = pnv_tce_build,
-+ .clear = pnv_tce_free,
-+ .get = pnv_tce_get,
-+};
-+
- static void pnv_pci_p5ioc2_dma_dev_setup(struct pnv_phb *phb,
+@@ -87,6 +87,7 @@ static void pnv_pci_p5ioc2_dma_dev_setup(struct pnv_phb *phb,
struct pci_dev *pdev)
{
if (phb->p5ioc2.iommu_table.it_map == NULL) {
-+ phb->p5ioc2.iommu_table.it_ops = &pnv_p5ioc2_iommu_ops;
++ phb->p5ioc2.iommu_table.it_ops = &pnv_iommu_ops;
iommu_init_table(&phb->p5ioc2.iommu_table, phb->hose->node);
iommu_register_group(&phb->p5ioc2.iommu_table,
pci_domain_nr(phb->hose->bus), phb->opal_id);
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
-index b7ea245..4c3bbb1 100644
+index 609f5b1..c619ec6 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
-@@ -572,9 +572,9 @@ struct pci_ops pnv_pci_ops = {
- .write = pnv_pci_write_config,
- };
-
--static int pnv_tce_build(struct iommu_table *tbl, long index, long npages,
-- unsigned long uaddr, enum dma_data_direction direction,
-- struct dma_attrs *attrs, bool rm)
-+int pnv_tce_build(struct iommu_table *tbl, long index, long npages,
-+ unsigned long uaddr, enum dma_data_direction direction,
-+ struct dma_attrs *attrs)
- {
- u64 proto_tce = iommu_direction_to_tce_perm(direction);
- __be64 *tcep, *tces;
-@@ -592,22 +592,12 @@ static int pnv_tce_build(struct iommu_table *tbl, long index, long npages,
- * of flags if that becomes the case
- */
- if (tbl->it_type & TCE_PCI_SWINV_CREATE)
-- pnv_pci_ioda_tce_invalidate(tbl, tces, tcep - 1, rm);
-+ pnv_pci_ioda_tce_invalidate(tbl, tces, tcep - 1, false);
-
- return 0;
- }
-
--static int pnv_tce_build_vm(struct iommu_table *tbl, long index, long npages,
-- unsigned long uaddr,
-- enum dma_data_direction direction,
-- struct dma_attrs *attrs)
--{
-- return pnv_tce_build(tbl, index, npages, uaddr, direction, attrs,
-- false);
--}
--
--static void pnv_tce_free(struct iommu_table *tbl, long index, long npages,
-- bool rm)
-+void pnv_tce_free(struct iommu_table *tbl, long index, long npages)
- {
- __be64 *tcep, *tces;
-
-@@ -617,32 +607,14 @@ static void pnv_tce_free(struct iommu_table *tbl, long index, long npages,
- *(tcep++) = cpu_to_be64(0);
-
- if (tbl->it_type & TCE_PCI_SWINV_FREE)
-- pnv_pci_ioda_tce_invalidate(tbl, tces, tcep - 1, rm);
-+ pnv_pci_ioda_tce_invalidate(tbl, tces, tcep - 1, false);
- }
-
--static void pnv_tce_free_vm(struct iommu_table *tbl, long index, long npages)
--{
-- pnv_tce_free(tbl, index, npages, false);
--}
--
--static unsigned long pnv_tce_get(struct iommu_table *tbl, long index)
-+unsigned long pnv_tce_get(struct iommu_table *tbl, long index)
- {
+@@ -647,18 +647,11 @@ static unsigned long pnv_tce_get(struct iommu_table *tbl, long index)
return ((u64 *)tbl->it_base)[index - tbl->it_offset];
}
@@ -502,14 +398,26 @@
-{
- pnv_tce_free(tbl, index, npages, true);
-}
--
++struct iommu_table_ops pnv_iommu_ops = {
++ .set = pnv_tce_build_vm,
++ .clear = pnv_tce_free_vm,
++ .get = pnv_tce_get,
++};
+
void pnv_pci_setup_iommu_table(struct iommu_table *tbl,
void *tce_mem, u64 tce_size,
- u64 dma_offset, unsigned page_shift)
-@@ -757,11 +729,6 @@ void __init pnv_pci_init(void)
- pci_devs_phb_init();
+@@ -692,6 +685,7 @@ static struct iommu_table *pnv_pci_setup_bml_iommu(struct pci_controller *hose)
+ return NULL;
+ pnv_pci_setup_iommu_table(tbl, __va(be64_to_cpup(basep)),
+ be32_to_cpup(sizep), 0, IOMMU_PAGE_SHIFT_4K);
++ tbl->it_ops = &pnv_iommu_ops;
+ iommu_init_table(tbl, hose->node);
+ iommu_register_group(tbl, pci_domain_nr(hose->bus), 0);
+
+@@ -817,11 +811,6 @@ void __init pnv_pci_init(void)
/* Configure IOMMU DMA hooks */
+ ppc_md.pci_dma_dev_setup = pnv_pci_dma_dev_setup;
- ppc_md.tce_build = pnv_tce_build_vm;
- ppc_md.tce_free = pnv_tce_free_vm;
- ppc_md.tce_build_rm = pnv_tce_build_rm;
@@ -519,26 +427,22 @@
/* Configure MSIs */
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h
-index c954c64..7eb6076 100644
+index 6c02ff8..f726700 100644
--- a/arch/powerpc/platforms/powernv/pci.h
+++ b/arch/powerpc/platforms/powernv/pci.h
-@@ -200,6 +200,11 @@ struct pnv_phb {
- };
-
- extern struct pci_ops pnv_pci_ops;
-+extern int pnv_tce_build(struct iommu_table *tbl, long index, long npages,
-+ unsigned long uaddr, enum dma_data_direction direction,
-+ struct dma_attrs *attrs);
-+extern void pnv_tce_free(struct iommu_table *tbl, long index, long npages);
-+extern unsigned long pnv_tce_get(struct iommu_table *tbl, long index);
+@@ -216,6 +216,7 @@ extern struct pci_ops pnv_pci_ops;
+ #ifdef CONFIG_EEH
+ extern struct pnv_eeh_ops ioda_eeh_ops;
+ #endif
++extern struct iommu_table_ops pnv_iommu_ops;
void pnv_pci_dump_phb_diag_data(struct pci_controller *hose,
unsigned char *log_buff);
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
-index 61d5a17..e379acf 100644
+index 7803a19..48d1fde 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
-@@ -193,7 +193,7 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
+@@ -192,7 +192,7 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
int ret = 0;
unsigned long flags;
@@ -547,7 +451,7 @@
return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr,
direction, attrs);
}
-@@ -285,6 +285,9 @@ static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long n
+@@ -284,6 +284,9 @@ static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long n
{
u64 rc;
@@ -557,7 +461,7 @@
rc = plpar_tce_stuff((u64)tbl->it_index, (u64)tcenum << 12, 0, npages);
if (rc && printk_ratelimit()) {
-@@ -460,7 +463,6 @@ static int tce_setrange_multi_pSeriesLP_walk(unsigned long start_pfn,
+@@ -459,7 +462,6 @@ static int tce_setrange_multi_pSeriesLP_walk(unsigned long start_pfn,
return tce_setrange_multi_pSeriesLP(start_pfn, num_pfn, arg);
}
@@ -565,7 +469,7 @@
#ifdef CONFIG_PCI
static void iommu_table_setparms(struct pci_controller *phb,
struct device_node *dn,
-@@ -546,6 +548,12 @@ static void iommu_table_setparms_lpar(struct pci_controller *phb,
+@@ -545,6 +547,12 @@ static void iommu_table_setparms_lpar(struct pci_controller *phb,
tbl->it_size = size >> tbl->it_page_shift;
}
@@ -578,7 +482,7 @@
static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
{
struct device_node *dn;
-@@ -614,6 +622,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
+@@ -613,6 +621,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
pci->phb->node);
iommu_table_setparms(pci->phb, dn, tbl);
@@ -586,7 +490,7 @@
pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
iommu_register_group(tbl, pci_domain_nr(bus), 0);
-@@ -625,6 +634,11 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
+@@ -624,6 +633,11 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
pr_debug("ISA/IDE, window size is 0x%llx\n", pci->phb->dma_window_size);
}
@@ -598,7 +502,7 @@
static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus)
{
-@@ -659,6 +673,7 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus)
+@@ -658,6 +672,7 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus)
tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
ppci->phb->node);
iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window);
@@ -606,7 +510,7 @@
ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node);
iommu_register_group(tbl, pci_domain_nr(bus), 0);
pr_debug(" created table: %p\n", ppci->iommu_table);
-@@ -686,6 +701,7 @@ static void pci_dma_dev_setup_pSeries(struct pci_dev *dev)
+@@ -685,6 +700,7 @@ static void pci_dma_dev_setup_pSeries(struct pci_dev *dev)
tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
phb->node);
iommu_table_setparms(phb, dn, tbl);
@@ -614,7 +518,7 @@
PCI_DN(dn)->iommu_table = iommu_init_table(tbl, phb->node);
iommu_register_group(tbl, pci_domain_nr(phb->bus), 0);
set_iommu_table_base_and_group(&dev->dev,
-@@ -1108,6 +1124,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
+@@ -1107,6 +1123,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
pci->phb->node);
iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window);
@@ -622,7 +526,7 @@
pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
iommu_register_group(tbl, pci_domain_nr(pci->phb->bus), 0);
pr_debug(" created table: %p\n", pci->iommu_table);
-@@ -1300,22 +1317,11 @@ void iommu_init_early_pSeries(void)
+@@ -1299,22 +1316,11 @@ void iommu_init_early_pSeries(void)
return;
if (firmware_has_feature(FW_FEATURE_LPAR)) {
@@ -634,18 +538,18 @@
- ppc_md.tce_free = tce_free_pSeriesLP;
- }
- ppc_md.tce_get = tce_get_pSeriesLP;
- pseries_pci_controller_ops.dma_bus_setup = pci_dma_bus_setup_pSeriesLP;
- pseries_pci_controller_ops.dma_dev_setup = pci_dma_dev_setup_pSeriesLP;
+ ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_pSeriesLP;
+ ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_pSeriesLP;
ppc_md.dma_set_mask = dma_set_mask_pSeriesLP;
ppc_md.dma_get_required_mask = dma_get_required_mask_pSeriesLP;
} else {
- ppc_md.tce_build = tce_build_pSeries;
- ppc_md.tce_free = tce_free_pSeries;
- ppc_md.tce_get = tce_get_pseries;
- pseries_pci_controller_ops.dma_bus_setup = pci_dma_bus_setup_pSeries;
- pseries_pci_controller_ops.dma_dev_setup = pci_dma_dev_setup_pSeries;
- }
-@@ -1333,8 +1339,6 @@ static int __init disable_multitce(char *str)
+ ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_pSeries;
+ ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_pSeries;
+ }
+@@ -1332,8 +1338,6 @@ static int __init disable_multitce(char *str)
firmware_has_feature(FW_FEATURE_LPAR) &&
firmware_has_feature(FW_FEATURE_MULTITCE)) {
printk(KERN_INFO "Disabling MULTITCE firmware feature\n");
@@ -655,7 +559,7 @@
}
return 1;
diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c
-index d00a566..90bcdfe 100644
+index 9e5353f..ab361a3 100644
--- a/arch/powerpc/sysdev/dart_iommu.c
+++ b/arch/powerpc/sysdev/dart_iommu.c
@@ -286,6 +286,12 @@ static int __init dart_init(struct device_node *dart_node)
@@ -679,7 +583,7 @@
iommu_init_table(&iommu_table_dart, -1);
/* Reserve the last page of the DART to avoid possible prefetch
-@@ -386,11 +393,6 @@ void __init iommu_init_early_dart(struct pci_controller_ops *controller_ops)
+@@ -386,11 +393,6 @@ void __init iommu_init_early_dart(void)
if (dart_init(dn) != 0)
goto bail;