diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-12-08 23:24:01 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-12-08 23:24:01 -0500 |
commit | b8c49def6d73321724bab66dd30526744b482f0a (patch) | |
tree | f560a5f8a6a0bdbe723a3660c2704b4aafd863a5 /arch/powerpc/platforms/pseries/iommu.c | |
parent | 4af2da25ede8af6536254e92b6ed5c4026105870 (diff) |
powerpc/pseries: Pass phb only to iommu_table_setparms_lpar
iommu_table_setparms_lpar needs either the phb or the subbusnumber
(not both), pass the phb to make it similar to iommu_table_setparms.
Note: In cases where a caller was passing bus->number previously to
iommu_table_setparms_lpar() rather than phb->bus->number, this can lead
to a different value in tbl->it_busno. The only example of this was the
removed pci_dma_dev_setup_pSeriesLP(), removed in "ppc/iommu: remove
unneeded pci_dma_dev_setup_pSeriesLP".
[BenH: You updated only one of the two callers. Fixed that for you]
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/iommu.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/iommu.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 0c1958ac1011..edea60b7ee90 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c | |||
@@ -323,14 +323,13 @@ static void iommu_table_setparms(struct pci_controller *phb, | |||
323 | static void iommu_table_setparms_lpar(struct pci_controller *phb, | 323 | static void iommu_table_setparms_lpar(struct pci_controller *phb, |
324 | struct device_node *dn, | 324 | struct device_node *dn, |
325 | struct iommu_table *tbl, | 325 | struct iommu_table *tbl, |
326 | const void *dma_window, | 326 | const void *dma_window) |
327 | int bussubno) | ||
328 | { | 327 | { |
329 | unsigned long offset, size; | 328 | unsigned long offset, size; |
330 | 329 | ||
331 | tbl->it_busno = bussubno; | ||
332 | of_parse_dma_window(dn, dma_window, &tbl->it_index, &offset, &size); | 330 | of_parse_dma_window(dn, dma_window, &tbl->it_index, &offset, &size); |
333 | 331 | ||
332 | tbl->it_busno = phb->bus->number; | ||
334 | tbl->it_base = 0; | 333 | tbl->it_base = 0; |
335 | tbl->it_blocksize = 16; | 334 | tbl->it_blocksize = 16; |
336 | tbl->it_type = TCE_PCI; | 335 | tbl->it_type = TCE_PCI; |
@@ -450,8 +449,7 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus) | |||
450 | if (!ppci->iommu_table) { | 449 | if (!ppci->iommu_table) { |
451 | tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL, | 450 | tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL, |
452 | ppci->phb->node); | 451 | ppci->phb->node); |
453 | iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window, | 452 | iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window); |
454 | bus->number); | ||
455 | ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node); | 453 | ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node); |
456 | pr_debug(" created table: %p\n", ppci->iommu_table); | 454 | pr_debug(" created table: %p\n", ppci->iommu_table); |
457 | } | 455 | } |
@@ -534,8 +532,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev) | |||
534 | if (!pci->iommu_table) { | 532 | if (!pci->iommu_table) { |
535 | tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL, | 533 | tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL, |
536 | pci->phb->node); | 534 | pci->phb->node); |
537 | iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window, | 535 | iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window); |
538 | pci->phb->bus->number); | ||
539 | pci->iommu_table = iommu_init_table(tbl, pci->phb->node); | 536 | pci->iommu_table = iommu_init_table(tbl, pci->phb->node); |
540 | pr_debug(" created table: %p\n", pci->iommu_table); | 537 | pr_debug(" created table: %p\n", pci->iommu_table); |
541 | } else { | 538 | } else { |