diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-12-05 21:40:29 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-10 21:41:36 -0500 |
commit | 96188ce57ba2e497dbbac78a137ae5c732db5fed (patch) | |
tree | 2cb0645fbc05d11e183cc11e2bc2095ce91a7c9d | |
parent | 68d315f5975c05595af52e3b758b5b6ebae1a266 (diff) |
[POWERPC] pSeries: Remove dependency on pci_dn bussubno
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/platforms/pseries/iommu.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index d4e9d851bb6..ebb9313b6e9 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c | |||
@@ -296,11 +296,12 @@ static void iommu_table_setparms(struct pci_controller *phb, | |||
296 | static void iommu_table_setparms_lpar(struct pci_controller *phb, | 296 | static void iommu_table_setparms_lpar(struct pci_controller *phb, |
297 | struct device_node *dn, | 297 | struct device_node *dn, |
298 | struct iommu_table *tbl, | 298 | struct iommu_table *tbl, |
299 | const void *dma_window) | 299 | const void *dma_window, |
300 | int bussubno) | ||
300 | { | 301 | { |
301 | unsigned long offset, size; | 302 | unsigned long offset, size; |
302 | 303 | ||
303 | tbl->it_busno = PCI_DN(dn)->bussubno; | 304 | tbl->it_busno = bussubno; |
304 | of_parse_dma_window(dn, dma_window, &tbl->it_index, &offset, &size); | 305 | of_parse_dma_window(dn, dma_window, &tbl->it_index, &offset, &size); |
305 | 306 | ||
306 | tbl->it_base = 0; | 307 | tbl->it_base = 0; |
@@ -420,17 +421,10 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus) | |||
420 | pdn->full_name, ppci->iommu_table); | 421 | pdn->full_name, ppci->iommu_table); |
421 | 422 | ||
422 | if (!ppci->iommu_table) { | 423 | if (!ppci->iommu_table) { |
423 | /* Bussubno hasn't been copied yet. | ||
424 | * Do it now because iommu_table_setparms_lpar needs it. | ||
425 | */ | ||
426 | |||
427 | ppci->bussubno = bus->number; | ||
428 | |||
429 | tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL, | 424 | tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL, |
430 | ppci->phb->node); | 425 | ppci->phb->node); |
431 | 426 | iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window, | |
432 | iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window); | 427 | bus->number); |
433 | |||
434 | ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node); | 428 | ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node); |
435 | DBG(" created table: %p\n", ppci->iommu_table); | 429 | DBG(" created table: %p\n", ppci->iommu_table); |
436 | } | 430 | } |
@@ -523,14 +517,10 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev) | |||
523 | 517 | ||
524 | pci = PCI_DN(pdn); | 518 | pci = PCI_DN(pdn); |
525 | if (!pci->iommu_table) { | 519 | if (!pci->iommu_table) { |
526 | /* iommu_table_setparms_lpar needs bussubno. */ | ||
527 | pci->bussubno = pci->phb->bus->number; | ||
528 | |||
529 | tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL, | 520 | tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL, |
530 | pci->phb->node); | 521 | pci->phb->node); |
531 | 522 | iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window, | |
532 | iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window); | 523 | pci->phb->bus->number); |
533 | |||
534 | pci->iommu_table = iommu_init_table(tbl, pci->phb->node); | 524 | pci->iommu_table = iommu_init_table(tbl, pci->phb->node); |
535 | DBG(" created table: %p\n", pci->iommu_table); | 525 | DBG(" created table: %p\n", pci->iommu_table); |
536 | } else { | 526 | } else { |