aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Bobroff <sbobroff@linux.ibm.com>2019-08-16 00:48:13 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2019-08-22 09:12:47 -0400
commit1ff8f36fc770dd2b3eb294312f270db8cf94cc13 (patch)
treee24faab51c12a4f45c349de2786ddedf715d30d8
parentb093f2cbedfbaba6bf1c520fbfcb46403f3c7802 (diff)
powerpc/eeh: Convert log messages to eeh_edev_* macros
Convert existing messages, where appropriate, to use the eeh_edev_* logging macros. The only effect should be minor adjustments to the log messages, apart from: - A new message in pseries_eeh_probe() "Probing device" to match the powernv case. - The "Probing device" message in pnv_eeh_probe() is now generated slightly later, which will mean that it is no longer emitted for devices that aren't probed due to the initial checks. Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/ce505a0a7a4a5b0367f0f40f8b26e7c0a9cf4cb7.1565930772.git.sbobroff@linux.ibm.com
-rw-r--r--arch/powerpc/include/asm/ppc-pci.h5
-rw-r--r--arch/powerpc/kernel/eeh.c19
-rw-r--r--arch/powerpc/kernel/eeh_cache.c8
-rw-r--r--arch/powerpc/kernel/eeh_driver.c7
-rw-r--r--arch/powerpc/kernel/eeh_pe.c51
-rw-r--r--arch/powerpc/platforms/powernv/eeh-powernv.c17
-rw-r--r--arch/powerpc/platforms/pseries/eeh_pseries.c21
7 files changed, 39 insertions, 89 deletions
diff --git a/arch/powerpc/include/asm/ppc-pci.h b/arch/powerpc/include/asm/ppc-pci.h
index 72860de205a0..7f4be5a05eb3 100644
--- a/arch/powerpc/include/asm/ppc-pci.h
+++ b/arch/powerpc/include/asm/ppc-pci.h
@@ -62,11 +62,6 @@ void eeh_pe_dev_mode_mark(struct eeh_pe *pe, int mode);
62void eeh_sysfs_add_device(struct pci_dev *pdev); 62void eeh_sysfs_add_device(struct pci_dev *pdev);
63void eeh_sysfs_remove_device(struct pci_dev *pdev); 63void eeh_sysfs_remove_device(struct pci_dev *pdev);
64 64
65static inline const char *eeh_pci_name(struct pci_dev *pdev)
66{
67 return pdev ? pci_name(pdev) : "<null>";
68}
69
70static inline const char *eeh_driver_name(struct pci_dev *pdev) 65static inline const char *eeh_driver_name(struct pci_dev *pdev)
71{ 66{
72 return (pdev && pdev->driver) ? pdev->driver->name : "<null>"; 67 return (pdev && pdev->driver) ? pdev->driver->name : "<null>";
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index fc975342e242..958e03ca1db6 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -470,8 +470,7 @@ int eeh_dev_check_failure(struct eeh_dev *edev)
470 /* Access to IO BARs might get this far and still not want checking. */ 470 /* Access to IO BARs might get this far and still not want checking. */
471 if (!pe) { 471 if (!pe) {
472 eeh_stats.ignored_check++; 472 eeh_stats.ignored_check++;
473 pr_debug("EEH: Ignored check for %s\n", 473 eeh_edev_dbg(edev, "Ignored check\n");
474 eeh_pci_name(dev));
475 return 0; 474 return 0;
476 } 475 }
477 476
@@ -511,12 +510,11 @@ int eeh_dev_check_failure(struct eeh_dev *edev)
511 if (dn) 510 if (dn)
512 location = of_get_property(dn, "ibm,loc-code", 511 location = of_get_property(dn, "ibm,loc-code",
513 NULL); 512 NULL);
514 printk(KERN_ERR "EEH: %d reads ignored for recovering device at " 513 eeh_edev_err(edev, "%d reads ignored for recovering device at location=%s driver=%s\n",
515 "location=%s driver=%s pci addr=%s\n",
516 pe->check_count, 514 pe->check_count,
517 location ? location : "unknown", 515 location ? location : "unknown",
518 eeh_driver_name(dev), eeh_pci_name(dev)); 516 eeh_driver_name(dev));
519 printk(KERN_ERR "EEH: Might be infinite loop in %s driver\n", 517 eeh_edev_err(edev, "Might be infinite loop in %s driver\n",
520 eeh_driver_name(dev)); 518 eeh_driver_name(dev));
521 dump_stack(); 519 dump_stack();
522 } 520 }
@@ -1188,12 +1186,11 @@ void eeh_add_device_late(struct pci_dev *dev)
1188 if (!dev) 1186 if (!dev)
1189 return; 1187 return;
1190 1188
1191 pr_debug("EEH: Adding device %s\n", pci_name(dev));
1192
1193 pdn = pci_get_pdn_by_devfn(dev->bus, dev->devfn); 1189 pdn = pci_get_pdn_by_devfn(dev->bus, dev->devfn);
1194 edev = pdn_to_eeh_dev(pdn); 1190 edev = pdn_to_eeh_dev(pdn);
1191 eeh_edev_dbg(edev, "Adding device\n");
1195 if (edev->pdev == dev) { 1192 if (edev->pdev == dev) {
1196 pr_debug("EEH: Device %s already referenced!\n", pci_name(dev)); 1193 eeh_edev_dbg(edev, "Device already referenced!\n");
1197 return; 1194 return;
1198 } 1195 }
1199 1196
@@ -1296,10 +1293,10 @@ void eeh_remove_device(struct pci_dev *dev)
1296 edev = pci_dev_to_eeh_dev(dev); 1293 edev = pci_dev_to_eeh_dev(dev);
1297 1294
1298 /* Unregister the device with the EEH/PCI address search system */ 1295 /* Unregister the device with the EEH/PCI address search system */
1299 pr_debug("EEH: Removing device %s\n", pci_name(dev)); 1296 dev_dbg(&dev->dev, "EEH: Removing device\n");
1300 1297
1301 if (!edev || !edev->pdev || !edev->pe) { 1298 if (!edev || !edev->pdev || !edev->pe) {
1302 pr_debug("EEH: Not referenced !\n"); 1299 dev_dbg(&dev->dev, "EEH: Device not referenced!\n");
1303 return; 1300 return;
1304 } 1301 }
1305 1302
diff --git a/arch/powerpc/kernel/eeh_cache.c b/arch/powerpc/kernel/eeh_cache.c
index 1e47cd04a1bd..cf11277ebd02 100644
--- a/arch/powerpc/kernel/eeh_cache.c
+++ b/arch/powerpc/kernel/eeh_cache.c
@@ -148,8 +148,8 @@ eeh_addr_cache_insert(struct pci_dev *dev, resource_size_t alo,
148 piar->pcidev = dev; 148 piar->pcidev = dev;
149 piar->flags = flags; 149 piar->flags = flags;
150 150
151 pr_debug("PIAR: insert range=[%pap:%pap] dev=%s\n", 151 eeh_edev_dbg(piar->edev, "PIAR: insert range=[%pap:%pap]\n",
152 &alo, &ahi, pci_name(dev)); 152 &alo, &ahi);
153 153
154 rb_link_node(&piar->rb_node, parent, p); 154 rb_link_node(&piar->rb_node, parent, p);
155 rb_insert_color(&piar->rb_node, &pci_io_addr_cache_root.rb_root); 155 rb_insert_color(&piar->rb_node, &pci_io_addr_cache_root.rb_root);
@@ -229,8 +229,8 @@ restart:
229 piar = rb_entry(n, struct pci_io_addr_range, rb_node); 229 piar = rb_entry(n, struct pci_io_addr_range, rb_node);
230 230
231 if (piar->pcidev == dev) { 231 if (piar->pcidev == dev) {
232 pr_debug("PIAR: remove range=[%pap:%pap] dev=%s\n", 232 eeh_edev_dbg(piar->edev, "PIAR: remove range=[%pap:%pap]\n",
233 &piar->addr_lo, &piar->addr_hi, pci_name(dev)); 233 &piar->addr_lo, &piar->addr_hi);
234 rb_erase(n, &pci_io_addr_cache_root.rb_root); 234 rb_erase(n, &pci_io_addr_cache_root.rb_root);
235 kfree(piar); 235 kfree(piar);
236 goto restart; 236 goto restart;
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index ab576bcbe4dd..274075a814b6 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -456,12 +456,9 @@ static void *eeh_add_virt_device(struct eeh_dev *edev)
456{ 456{
457 struct pci_driver *driver; 457 struct pci_driver *driver;
458 struct pci_dev *dev = eeh_dev_to_pci_dev(edev); 458 struct pci_dev *dev = eeh_dev_to_pci_dev(edev);
459 struct pci_dn *pdn = eeh_dev_to_pdn(edev);
460 459
461 if (!(edev->physfn)) { 460 if (!(edev->physfn)) {
462 pr_warn("%s: EEH dev %04x:%02x:%02x.%01x not for VF\n", 461 eeh_edev_warn(edev, "Not for VF\n");
463 __func__, pdn->phb->global_number, pdn->busno,
464 PCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn));
465 return NULL; 462 return NULL;
466 } 463 }
467 464
@@ -475,7 +472,7 @@ static void *eeh_add_virt_device(struct eeh_dev *edev)
475 } 472 }
476 473
477#ifdef CONFIG_PCI_IOV 474#ifdef CONFIG_PCI_IOV
478 pci_iov_add_virtfn(edev->physfn, pdn->vf_index); 475 pci_iov_add_virtfn(edev->physfn, eeh_dev_to_pdn(edev)->vf_index);
479#endif 476#endif
480 return NULL; 477 return NULL;
481} 478}
diff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.c
index 854cef7b18f4..317a31624526 100644
--- a/arch/powerpc/kernel/eeh_pe.c
+++ b/arch/powerpc/kernel/eeh_pe.c
@@ -379,8 +379,7 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)
379 379
380 /* Check if the PE number is valid */ 380 /* Check if the PE number is valid */
381 if (!eeh_has_flag(EEH_VALID_PE_ZERO) && !edev->pe_config_addr) { 381 if (!eeh_has_flag(EEH_VALID_PE_ZERO) && !edev->pe_config_addr) {
382 pr_err("%s: Invalid PE#0 for edev 0x%x on PHB#%x\n", 382 eeh_edev_err(edev, "PE#0 is invalid for this PHB!\n");
383 __func__, config_addr, pdn->phb->global_number);
384 return -EINVAL; 383 return -EINVAL;
385 } 384 }
386 385
@@ -398,12 +397,7 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)
398 397
399 /* Put the edev to PE */ 398 /* Put the edev to PE */
400 list_add_tail(&edev->entry, &pe->edevs); 399 list_add_tail(&edev->entry, &pe->edevs);
401 pr_debug("EEH: Add %04x:%02x:%02x.%01x to Bus PE#%x\n", 400 eeh_edev_dbg(edev, "Added to bus PE\n");
402 pdn->phb->global_number,
403 pdn->busno,
404 PCI_SLOT(pdn->devfn),
405 PCI_FUNC(pdn->devfn),
406 pe->addr);
407 return 0; 401 return 0;
408 } else if (pe && (pe->type & EEH_PE_INVALID)) { 402 } else if (pe && (pe->type & EEH_PE_INVALID)) {
409 list_add_tail(&edev->entry, &pe->edevs); 403 list_add_tail(&edev->entry, &pe->edevs);
@@ -420,13 +414,8 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)
420 parent = parent->parent; 414 parent = parent->parent;
421 } 415 }
422 416
423 pr_debug("EEH: Add %04x:%02x:%02x.%01x to Device " 417 eeh_edev_dbg(edev, "Added to device PE (parent: PE#%x)\n",
424 "PE#%x, Parent PE#%x\n", 418 pe->parent->addr);
425 pdn->phb->global_number,
426 pdn->busno,
427 PCI_SLOT(pdn->devfn),
428 PCI_FUNC(pdn->devfn),
429 pe->addr, pe->parent->addr);
430 return 0; 419 return 0;
431 } 420 }
432 421
@@ -468,13 +457,8 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)
468 list_add_tail(&pe->child, &parent->child_list); 457 list_add_tail(&pe->child, &parent->child_list);
469 list_add_tail(&edev->entry, &pe->edevs); 458 list_add_tail(&edev->entry, &pe->edevs);
470 edev->pe = pe; 459 edev->pe = pe;
471 pr_debug("EEH: Add %04x:%02x:%02x.%01x to " 460 eeh_edev_dbg(edev, "Added to device PE (parent: PE#%x)\n",
472 "Device PE#%x, Parent PE#%x\n", 461 pe->parent->addr);
473 pdn->phb->global_number,
474 pdn->busno,
475 PCI_SLOT(pdn->devfn),
476 PCI_FUNC(pdn->devfn),
477 pe->addr, pe->parent->addr);
478 462
479 return 0; 463 return 0;
480} 464}
@@ -492,15 +476,10 @@ int eeh_rmv_from_parent_pe(struct eeh_dev *edev)
492{ 476{
493 struct eeh_pe *pe, *parent, *child; 477 struct eeh_pe *pe, *parent, *child;
494 int cnt; 478 int cnt;
495 struct pci_dn *pdn = eeh_dev_to_pdn(edev);
496 479
497 pe = eeh_dev_to_pe(edev); 480 pe = eeh_dev_to_pe(edev);
498 if (!pe) { 481 if (!pe) {
499 pr_debug("%s: No PE found for device %04x:%02x:%02x.%01x\n", 482 eeh_edev_dbg(edev, "No PE found for device.\n");
500 __func__, pdn->phb->global_number,
501 pdn->busno,
502 PCI_SLOT(pdn->devfn),
503 PCI_FUNC(pdn->devfn));
504 return -EEXIST; 483 return -EEXIST;
505 } 484 }
506 485
@@ -717,17 +696,13 @@ static void eeh_bridge_check_link(struct eeh_dev *edev)
717 if (!(edev->mode & (EEH_DEV_ROOT_PORT | EEH_DEV_DS_PORT))) 696 if (!(edev->mode & (EEH_DEV_ROOT_PORT | EEH_DEV_DS_PORT)))
718 return; 697 return;
719 698
720 pr_debug("%s: Check PCIe link for %04x:%02x:%02x.%01x ...\n", 699 eeh_edev_dbg(edev, "Checking PCIe link...\n");
721 __func__, pdn->phb->global_number,
722 pdn->busno,
723 PCI_SLOT(pdn->devfn),
724 PCI_FUNC(pdn->devfn));
725 700
726 /* Check slot status */ 701 /* Check slot status */
727 cap = edev->pcie_cap; 702 cap = edev->pcie_cap;
728 eeh_ops->read_config(pdn, cap + PCI_EXP_SLTSTA, 2, &val); 703 eeh_ops->read_config(pdn, cap + PCI_EXP_SLTSTA, 2, &val);
729 if (!(val & PCI_EXP_SLTSTA_PDS)) { 704 if (!(val & PCI_EXP_SLTSTA_PDS)) {
730 pr_debug(" No card in the slot (0x%04x) !\n", val); 705 eeh_edev_dbg(edev, "No card in the slot (0x%04x) !\n", val);
731 return; 706 return;
732 } 707 }
733 708
@@ -736,7 +711,7 @@ static void eeh_bridge_check_link(struct eeh_dev *edev)
736 if (val & PCI_EXP_SLTCAP_PCP) { 711 if (val & PCI_EXP_SLTCAP_PCP) {
737 eeh_ops->read_config(pdn, cap + PCI_EXP_SLTCTL, 2, &val); 712 eeh_ops->read_config(pdn, cap + PCI_EXP_SLTCTL, 2, &val);
738 if (val & PCI_EXP_SLTCTL_PCC) { 713 if (val & PCI_EXP_SLTCTL_PCC) {
739 pr_debug(" In power-off state, power it on ...\n"); 714 eeh_edev_dbg(edev, "In power-off state, power it on ...\n");
740 val &= ~(PCI_EXP_SLTCTL_PCC | PCI_EXP_SLTCTL_PIC); 715 val &= ~(PCI_EXP_SLTCTL_PCC | PCI_EXP_SLTCTL_PIC);
741 val |= (0x0100 & PCI_EXP_SLTCTL_PIC); 716 val |= (0x0100 & PCI_EXP_SLTCTL_PIC);
742 eeh_ops->write_config(pdn, cap + PCI_EXP_SLTCTL, 2, val); 717 eeh_ops->write_config(pdn, cap + PCI_EXP_SLTCTL, 2, val);
@@ -752,7 +727,7 @@ static void eeh_bridge_check_link(struct eeh_dev *edev)
752 /* Check link */ 727 /* Check link */
753 eeh_ops->read_config(pdn, cap + PCI_EXP_LNKCAP, 4, &val); 728 eeh_ops->read_config(pdn, cap + PCI_EXP_LNKCAP, 4, &val);
754 if (!(val & PCI_EXP_LNKCAP_DLLLARC)) { 729 if (!(val & PCI_EXP_LNKCAP_DLLLARC)) {
755 pr_debug(" No link reporting capability (0x%08x) \n", val); 730 eeh_edev_dbg(edev, "No link reporting capability (0x%08x) \n", val);
756 msleep(1000); 731 msleep(1000);
757 return; 732 return;
758 } 733 }
@@ -769,10 +744,10 @@ static void eeh_bridge_check_link(struct eeh_dev *edev)
769 } 744 }
770 745
771 if (val & PCI_EXP_LNKSTA_DLLLA) 746 if (val & PCI_EXP_LNKSTA_DLLLA)
772 pr_debug(" Link up (%s)\n", 747 eeh_edev_dbg(edev, "Link up (%s)\n",
773 (val & PCI_EXP_LNKSTA_CLS_2_5GB) ? "2.5GB" : "5GB"); 748 (val & PCI_EXP_LNKSTA_CLS_2_5GB) ? "2.5GB" : "5GB");
774 else 749 else
775 pr_debug(" Link not ready (0x%04x)\n", val); 750 eeh_edev_dbg(edev, "Link not ready (0x%04x)\n", val);
776} 751}
777 752
778#define BYTE_SWAP(OFF) (8*((OFF)/4)+3-(OFF)) 753#define BYTE_SWAP(OFF) (8*((OFF)/4)+3-(OFF))
diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c
index 6ed9b6ccafcc..e7b867912f24 100644
--- a/arch/powerpc/platforms/powernv/eeh-powernv.c
+++ b/arch/powerpc/platforms/powernv/eeh-powernv.c
@@ -44,7 +44,7 @@ void pnv_pcibios_bus_add_device(struct pci_dev *pdev)
44 if (eeh_has_flag(EEH_FORCE_DISABLED)) 44 if (eeh_has_flag(EEH_FORCE_DISABLED))
45 return; 45 return;
46 46
47 pr_debug("%s: EEH: Setting up device %s.\n", __func__, pci_name(pdev)); 47 dev_dbg(&pdev->dev, "EEH: Setting up device\n");
48 eeh_add_device_early(pdn); 48 eeh_add_device_early(pdn);
49 eeh_add_device_late(pdev); 49 eeh_add_device_late(pdev);
50 eeh_sysfs_add_device(pdev); 50 eeh_sysfs_add_device(pdev);
@@ -370,10 +370,6 @@ static void *pnv_eeh_probe(struct pci_dn *pdn, void *data)
370 int ret; 370 int ret;
371 int config_addr = (pdn->busno << 8) | (pdn->devfn); 371 int config_addr = (pdn->busno << 8) | (pdn->devfn);
372 372
373 pr_debug("%s: probing %04x:%02x:%02x.%01x\n",
374 __func__, hose->global_number, pdn->busno,
375 PCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn));
376
377 /* 373 /*
378 * When probing the root bridge, which doesn't have any 374 * When probing the root bridge, which doesn't have any
379 * subordinate PCI devices. We don't have OF node for 375 * subordinate PCI devices. We don't have OF node for
@@ -387,6 +383,8 @@ static void *pnv_eeh_probe(struct pci_dn *pdn, void *data)
387 if ((pdn->class_code >> 8) == PCI_CLASS_BRIDGE_ISA) 383 if ((pdn->class_code >> 8) == PCI_CLASS_BRIDGE_ISA)
388 return NULL; 384 return NULL;
389 385
386 eeh_edev_dbg(edev, "Probing device\n");
387
390 /* Initialize eeh device */ 388 /* Initialize eeh device */
391 edev->class_code = pdn->class_code; 389 edev->class_code = pdn->class_code;
392 edev->mode &= 0xFFFFFF00; 390 edev->mode &= 0xFFFFFF00;
@@ -412,9 +410,7 @@ static void *pnv_eeh_probe(struct pci_dn *pdn, void *data)
412 /* Create PE */ 410 /* Create PE */
413 ret = eeh_add_to_parent_pe(edev); 411 ret = eeh_add_to_parent_pe(edev);
414 if (ret) { 412 if (ret) {
415 pr_warn("%s: Can't add PCI dev %04x:%02x:%02x.%01x to parent PE (%x)\n", 413 eeh_edev_warn(edev, "Failed to add device to PE (code %d)\n", ret);
416 __func__, hose->global_number, pdn->busno,
417 PCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn), ret);
418 return NULL; 414 return NULL;
419 } 415 }
420 416
@@ -472,10 +468,7 @@ static void *pnv_eeh_probe(struct pci_dn *pdn, void *data)
472 /* Save memory bars */ 468 /* Save memory bars */
473 eeh_save_bars(edev); 469 eeh_save_bars(edev);
474 470
475 pr_debug("%s: EEH enabled on %02x:%02x.%01x PHB#%x-PE#%x\n", 471 eeh_edev_dbg(edev, "EEH enabled on device\n");
476 __func__, pdn->busno, PCI_SLOT(pdn->devfn),
477 PCI_FUNC(pdn->devfn), edev->pe->phb->global_number,
478 edev->pe->addr);
479 472
480 return NULL; 473 return NULL;
481} 474}
diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c
index 02454c737d11..893ba3f562c4 100644
--- a/arch/powerpc/platforms/pseries/eeh_pseries.c
+++ b/arch/powerpc/platforms/pseries/eeh_pseries.c
@@ -49,7 +49,7 @@ void pseries_pcibios_bus_add_device(struct pci_dev *pdev)
49 if (eeh_has_flag(EEH_FORCE_DISABLED)) 49 if (eeh_has_flag(EEH_FORCE_DISABLED))
50 return; 50 return;
51 51
52 pr_debug("%s: EEH: Setting up device %s.\n", __func__, pci_name(pdev)); 52 dev_dbg(&pdev->dev, "EEH: Setting up device\n");
53#ifdef CONFIG_PCI_IOV 53#ifdef CONFIG_PCI_IOV
54 if (pdev->is_virtfn) { 54 if (pdev->is_virtfn) {
55 struct pci_dn *physfn_pdn; 55 struct pci_dn *physfn_pdn;
@@ -238,10 +238,6 @@ static void *pseries_eeh_probe(struct pci_dn *pdn, void *data)
238 int enable = 0; 238 int enable = 0;
239 int ret; 239 int ret;
240 240
241 pr_debug("%s: probing %04x:%02x:%02x.%01x\n",
242 __func__, pdn->phb->global_number, pdn->busno,
243 PCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn));
244
245 /* Retrieve OF node and eeh device */ 241 /* Retrieve OF node and eeh device */
246 edev = pdn_to_eeh_dev(pdn); 242 edev = pdn_to_eeh_dev(pdn);
247 if (!edev || edev->pe) 243 if (!edev || edev->pe)
@@ -255,6 +251,8 @@ static void *pseries_eeh_probe(struct pci_dn *pdn, void *data)
255 if ((pdn->class_code >> 8) == PCI_CLASS_BRIDGE_ISA) 251 if ((pdn->class_code >> 8) == PCI_CLASS_BRIDGE_ISA)
256 return NULL; 252 return NULL;
257 253
254 eeh_edev_dbg(edev, "Probing device\n");
255
258 /* 256 /*
259 * Update class code and mode of eeh device. We need 257 * Update class code and mode of eeh device. We need
260 * correctly reflects that current device is root port 258 * correctly reflects that current device is root port
@@ -284,12 +282,10 @@ static void *pseries_eeh_probe(struct pci_dn *pdn, void *data)
284 pe.config_addr = (pdn->busno << 16) | (pdn->devfn << 8); 282 pe.config_addr = (pdn->busno << 16) | (pdn->devfn << 8);
285 283
286 /* Enable EEH on the device */ 284 /* Enable EEH on the device */
285 eeh_edev_dbg(edev, "Enabling EEH on device\n");
287 ret = eeh_ops->set_option(&pe, EEH_OPT_ENABLE); 286 ret = eeh_ops->set_option(&pe, EEH_OPT_ENABLE);
288 if (ret) { 287 if (ret) {
289 pr_debug("%s: EEH failed to enable on %02x:%02x.%01x PHB#%x-PE#%x (code %d)\n", 288 eeh_edev_dbg(edev, "EEH failed to enable on device (code %d)\n", ret);
290 __func__, pdn->busno, PCI_SLOT(pdn->devfn),
291 PCI_FUNC(pdn->devfn), pe.phb->global_number,
292 pe.addr, ret);
293 } else { 289 } else {
294 /* Retrieve PE address */ 290 /* Retrieve PE address */
295 edev->pe_config_addr = eeh_ops->get_pe_addr(&pe); 291 edev->pe_config_addr = eeh_ops->get_pe_addr(&pe);
@@ -314,11 +310,8 @@ static void *pseries_eeh_probe(struct pci_dn *pdn, void *data)
314 edev->pe_config_addr = pdn_to_eeh_dev(pdn->parent)->pe_config_addr; 310 edev->pe_config_addr = pdn_to_eeh_dev(pdn->parent)->pe_config_addr;
315 eeh_add_to_parent_pe(edev); 311 eeh_add_to_parent_pe(edev);
316 } 312 }
317 pr_debug("%s: EEH %s on %02x:%02x.%01x PHB#%x-PE#%x (code %d)\n", 313 eeh_edev_dbg(edev, "EEH is %s on device (code %d)\n",
318 __func__, (enable ? "enabled" : "unsupported"), 314 (enable ? "enabled" : "unsupported"), ret);
319 pdn->busno, PCI_SLOT(pdn->devfn),
320 PCI_FUNC(pdn->devfn), pe.phb->global_number,
321 pe.addr, ret);
322 } 315 }
323 316
324 /* Save memory bars */ 317 /* Save memory bars */