aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/iommu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/pseries/iommu.c')
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 44a507e6fb34..2f66dc6503ff 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -368,10 +368,11 @@ static void iommu_bus_setup_pSeries(struct pci_bus *bus)
368 pci->phb->dma_window_size = 0x8000000ul; 368 pci->phb->dma_window_size = 0x8000000ul;
369 pci->phb->dma_window_base_cur = 0x8000000ul; 369 pci->phb->dma_window_base_cur = 0x8000000ul;
370 370
371 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); 371 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
372 pci->phb->node);
372 373
373 iommu_table_setparms(pci->phb, dn, tbl); 374 iommu_table_setparms(pci->phb, dn, tbl);
374 pci->iommu_table = iommu_init_table(tbl); 375 pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
375 376
376 /* Divide the rest (1.75GB) among the children */ 377 /* Divide the rest (1.75GB) among the children */
377 pci->phb->dma_window_size = 0x80000000ul; 378 pci->phb->dma_window_size = 0x80000000ul;
@@ -414,12 +415,12 @@ static void iommu_bus_setup_pSeriesLP(struct pci_bus *bus)
414 415
415 ppci->bussubno = bus->number; 416 ppci->bussubno = bus->number;
416 417
417 tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table), 418 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
418 GFP_KERNEL); 419 ppci->phb->node);
419 420
420 iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window); 421 iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window);
421 422
422 ppci->iommu_table = iommu_init_table(tbl); 423 ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node);
423 } 424 }
424 425
425 if (pdn != dn) 426 if (pdn != dn)
@@ -442,9 +443,11 @@ static void iommu_dev_setup_pSeries(struct pci_dev *dev)
442 */ 443 */
443 if (!dev->bus->self) { 444 if (!dev->bus->self) {
444 DBG(" --> first child, no bridge. Allocating iommu table.\n"); 445 DBG(" --> first child, no bridge. Allocating iommu table.\n");
445 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); 446 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
447 PCI_DN(dn)->phb->node);
446 iommu_table_setparms(PCI_DN(dn)->phb, dn, tbl); 448 iommu_table_setparms(PCI_DN(dn)->phb, dn, tbl);
447 PCI_DN(mydn)->iommu_table = iommu_init_table(tbl); 449 PCI_DN(dn)->iommu_table = iommu_init_table(tbl,
450 PCI_DN(dn)->phb->node);
448 451
449 return; 452 return;
450 } 453 }
@@ -526,12 +529,12 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
526 /* iommu_table_setparms_lpar needs bussubno. */ 529 /* iommu_table_setparms_lpar needs bussubno. */
527 pci->bussubno = pci->phb->bus->number; 530 pci->bussubno = pci->phb->bus->number;
528 531
529 tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table), 532 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
530 GFP_KERNEL); 533 pci->phb->node);
531 534
532 iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window); 535 iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window);
533 536
534 pci->iommu_table = iommu_init_table(tbl); 537 pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
535 } 538 }
536 539
537 if (pdn != dn) 540 if (pdn != dn)