aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/iommu.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2008-04-24 01:13:19 -0400
committerPaul Mackerras <paulus@samba.org>2008-04-24 07:08:12 -0400
commitf7ebf352b2e04ee89efb426e33dd450d8f1cfcd5 (patch)
tree9a46055bfeb2ab5392cdef3650a000898b58f4c6 /arch/powerpc/platforms/pseries/iommu.c
parentcb1e2ab45a92b31114dfe6e34832a084f9b0b263 (diff)
[POWERPC] Convert from DBG() to pr_debug() in platforms/pseries/
In pseries/lpar.c, fix some printf specifier mismatches, and add a newline to one printk. In pseries/rtasd.c add "rtasd" to some messages to make it clear where they're coming from. In pseries/scanlog.c remove the hand-rolled runtime debugging support in there. This file has been largely unchanged for eons, if we need to debug it in future we can recompile. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/iommu.c')
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index a65c76308201..176f1f39d2d5 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -47,7 +47,6 @@
47 47
48#include "plpar_wrappers.h" 48#include "plpar_wrappers.h"
49 49
50#define DBG(fmt...)
51 50
52static void tce_build_pSeries(struct iommu_table *tbl, long index, 51static void tce_build_pSeries(struct iommu_table *tbl, long index,
53 long npages, unsigned long uaddr, 52 long npages, unsigned long uaddr,
@@ -322,7 +321,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
322 321
323 dn = pci_bus_to_OF_node(bus); 322 dn = pci_bus_to_OF_node(bus);
324 323
325 DBG("pci_dma_bus_setup_pSeries: setting up bus %s\n", dn->full_name); 324 pr_debug("pci_dma_bus_setup_pSeries: setting up bus %s\n", dn->full_name);
326 325
327 if (bus->self) { 326 if (bus->self) {
328 /* This is not a root bus, any setup will be done for the 327 /* This is not a root bus, any setup will be done for the
@@ -347,7 +346,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
347 for (children = 0, tmp = dn->child; tmp; tmp = tmp->sibling) 346 for (children = 0, tmp = dn->child; tmp; tmp = tmp->sibling)
348 children++; 347 children++;
349 348
350 DBG("Children: %d\n", children); 349 pr_debug("Children: %d\n", children);
351 350
352 /* Calculate amount of DMA window per slot. Each window must be 351 /* Calculate amount of DMA window per slot. Each window must be
353 * a power of two (due to pci_alloc_consistent requirements). 352 * a power of two (due to pci_alloc_consistent requirements).
@@ -361,8 +360,8 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
361 360
362 while (pci->phb->dma_window_size * children > 0x80000000ul) 361 while (pci->phb->dma_window_size * children > 0x80000000ul)
363 pci->phb->dma_window_size >>= 1; 362 pci->phb->dma_window_size >>= 1;
364 DBG("No ISA/IDE, window size is 0x%lx\n", 363 pr_debug("No ISA/IDE, window size is 0x%lx\n",
365 pci->phb->dma_window_size); 364 pci->phb->dma_window_size);
366 pci->phb->dma_window_base_cur = 0; 365 pci->phb->dma_window_base_cur = 0;
367 366
368 return; 367 return;
@@ -387,8 +386,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
387 while (pci->phb->dma_window_size * children > 0x70000000ul) 386 while (pci->phb->dma_window_size * children > 0x70000000ul)
388 pci->phb->dma_window_size >>= 1; 387 pci->phb->dma_window_size >>= 1;
389 388
390 DBG("ISA/IDE, window size is 0x%lx\n", pci->phb->dma_window_size); 389 pr_debug("ISA/IDE, window size is 0x%lx\n", pci->phb->dma_window_size);
391
392} 390}
393 391
394 392
@@ -401,7 +399,8 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus)
401 399
402 dn = pci_bus_to_OF_node(bus); 400 dn = pci_bus_to_OF_node(bus);
403 401
404 DBG("pci_dma_bus_setup_pSeriesLP: setting up bus %s\n", dn->full_name); 402 pr_debug("pci_dma_bus_setup_pSeriesLP: setting up bus %s\n",
403 dn->full_name);
405 404
406 /* Find nearest ibm,dma-window, walking up the device tree */ 405 /* Find nearest ibm,dma-window, walking up the device tree */
407 for (pdn = dn; pdn != NULL; pdn = pdn->parent) { 406 for (pdn = dn; pdn != NULL; pdn = pdn->parent) {
@@ -411,14 +410,14 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus)
411 } 410 }
412 411
413 if (dma_window == NULL) { 412 if (dma_window == NULL) {
414 DBG(" no ibm,dma-window property !\n"); 413 pr_debug(" no ibm,dma-window property !\n");
415 return; 414 return;
416 } 415 }
417 416
418 ppci = PCI_DN(pdn); 417 ppci = PCI_DN(pdn);
419 418
420 DBG(" parent is %s, iommu_table: 0x%p\n", 419 pr_debug(" parent is %s, iommu_table: 0x%p\n",
421 pdn->full_name, ppci->iommu_table); 420 pdn->full_name, ppci->iommu_table);
422 421
423 if (!ppci->iommu_table) { 422 if (!ppci->iommu_table) {
424 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL, 423 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
@@ -426,7 +425,7 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus)
426 iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window, 425 iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window,
427 bus->number); 426 bus->number);
428 ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node); 427 ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node);
429 DBG(" created table: %p\n", ppci->iommu_table); 428 pr_debug(" created table: %p\n", ppci->iommu_table);
430 } 429 }
431 430
432 if (pdn != dn) 431 if (pdn != dn)
@@ -439,7 +438,7 @@ static void pci_dma_dev_setup_pSeries(struct pci_dev *dev)
439 struct device_node *dn; 438 struct device_node *dn;
440 struct iommu_table *tbl; 439 struct iommu_table *tbl;
441 440
442 DBG("pci_dma_dev_setup_pSeries: %s\n", pci_name(dev)); 441 pr_debug("pci_dma_dev_setup_pSeries: %s\n", pci_name(dev));
443 442
444 dn = dev->dev.archdata.of_node; 443 dn = dev->dev.archdata.of_node;
445 444
@@ -450,7 +449,7 @@ static void pci_dma_dev_setup_pSeries(struct pci_dev *dev)
450 if (!dev->bus->self) { 449 if (!dev->bus->self) {
451 struct pci_controller *phb = PCI_DN(dn)->phb; 450 struct pci_controller *phb = PCI_DN(dn)->phb;
452 451
453 DBG(" --> first child, no bridge. Allocating iommu table.\n"); 452 pr_debug(" --> first child, no bridge. Allocating iommu table.\n");
454 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL, 453 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
455 phb->node); 454 phb->node);
456 iommu_table_setparms(phb, dn, tbl); 455 iommu_table_setparms(phb, dn, tbl);
@@ -480,7 +479,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
480 const void *dma_window = NULL; 479 const void *dma_window = NULL;
481 struct pci_dn *pci; 480 struct pci_dn *pci;
482 481
483 DBG("pci_dma_dev_setup_pSeriesLP: %s\n", pci_name(dev)); 482 pr_debug("pci_dma_dev_setup_pSeriesLP: %s\n", pci_name(dev));
484 483
485 /* dev setup for LPAR is a little tricky, since the device tree might 484 /* dev setup for LPAR is a little tricky, since the device tree might
486 * contain the dma-window properties per-device and not neccesarily 485 * contain the dma-window properties per-device and not neccesarily
@@ -489,7 +488,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
489 * already allocated. 488 * already allocated.
490 */ 489 */
491 dn = pci_device_to_OF_node(dev); 490 dn = pci_device_to_OF_node(dev);
492 DBG(" node is %s\n", dn->full_name); 491 pr_debug(" node is %s\n", dn->full_name);
493 492
494 for (pdn = dn; pdn && PCI_DN(pdn) && !PCI_DN(pdn)->iommu_table; 493 for (pdn = dn; pdn && PCI_DN(pdn) && !PCI_DN(pdn)->iommu_table;
495 pdn = pdn->parent) { 494 pdn = pdn->parent) {
@@ -504,13 +503,13 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
504 pci_name(dev), dn? dn->full_name : "<null>"); 503 pci_name(dev), dn? dn->full_name : "<null>");
505 return; 504 return;
506 } 505 }
507 DBG(" parent is %s\n", pdn->full_name); 506 pr_debug(" parent is %s\n", pdn->full_name);
508 507
509 /* Check for parent == NULL so we don't try to setup the empty EADS 508 /* Check for parent == NULL so we don't try to setup the empty EADS
510 * slots on POWER4 machines. 509 * slots on POWER4 machines.
511 */ 510 */
512 if (dma_window == NULL || pdn->parent == NULL) { 511 if (dma_window == NULL || pdn->parent == NULL) {
513 DBG(" no dma window for device, linking to parent\n"); 512 pr_debug(" no dma window for device, linking to parent\n");
514 dev->dev.archdata.dma_data = PCI_DN(pdn)->iommu_table; 513 dev->dev.archdata.dma_data = PCI_DN(pdn)->iommu_table;
515 return; 514 return;
516 } 515 }
@@ -522,9 +521,9 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
522 iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window, 521 iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window,
523 pci->phb->bus->number); 522 pci->phb->bus->number);
524 pci->iommu_table = iommu_init_table(tbl, pci->phb->node); 523 pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
525 DBG(" created table: %p\n", pci->iommu_table); 524 pr_debug(" created table: %p\n", pci->iommu_table);
526 } else { 525 } else {
527 DBG(" found DMA window, table: %p\n", pci->iommu_table); 526 pr_debug(" found DMA window, table: %p\n", pci->iommu_table);
528 } 527 }
529 528
530 dev->dev.archdata.dma_data = pci->iommu_table; 529 dev->dev.archdata.dma_data = pci->iommu_table;