diff options
author | Sam Bobroff <sbobroff@linux.ibm.com> | 2019-08-16 14:48:07 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-08-22 23:11:48 +1000 |
commit | 617082a4817a4354fa3de05c80b5f6088e2083b7 (patch) | |
tree | c242040b942e651916e34632cc6dedcf5501aaec | |
parent | aa06e3d60e245284d1e55497eb3108828092818d (diff) |
powerpc/eeh: Improve debug messages around device addition
Also remove useless comment.
Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/59db84f4bf94718a12f206bc923ac797d47e4cc1.1565930772.git.sbobroff@linux.ibm.com
-rw-r--r-- | arch/powerpc/kernel/eeh.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/eeh-powernv.c | 14 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh_pseries.c | 23 |
3 files changed, 28 insertions, 11 deletions
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c index c0e4b73191f3..d187d2b290a8 100644 --- a/arch/powerpc/kernel/eeh.c +++ b/arch/powerpc/kernel/eeh.c @@ -1198,7 +1198,7 @@ void eeh_add_device_late(struct pci_dev *dev) pdn = pci_get_pdn_by_devfn(dev->bus, dev->devfn); edev = pdn_to_eeh_dev(pdn); if (edev->pdev == dev) { - pr_debug("EEH: Already referenced !\n"); + pr_debug("EEH: Device %s already referenced!\n", pci_name(dev)); return; } diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c index 620a986209f5..97461d49254e 100644 --- a/arch/powerpc/platforms/powernv/eeh-powernv.c +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c @@ -44,10 +44,7 @@ void pnv_pcibios_bus_add_device(struct pci_dev *pdev) if (!pdev->is_virtfn) return; - /* - * The following operations will fail if VF's sysfs files - * aren't created or its resources aren't finalized. - */ + pr_debug("%s: EEH: Setting up device %s.\n", __func__, pci_name(pdev)); eeh_add_device_early(pdn); eeh_add_device_late(pdev); eeh_sysfs_add_device(pdev); @@ -364,6 +361,10 @@ static void *pnv_eeh_probe(struct pci_dn *pdn, void *data) int ret; int config_addr = (pdn->busno << 8) | (pdn->devfn); + pr_debug("%s: probing %04x:%02x:%02x.%01x\n", + __func__, hose->global_number, pdn->busno, + PCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn)); + /* * When probing the root bridge, which doesn't have any * subordinate PCI devices. We don't have OF node for @@ -458,6 +459,11 @@ static void *pnv_eeh_probe(struct pci_dn *pdn, void *data) /* Save memory bars */ eeh_save_bars(edev); + pr_debug("%s: EEH enabled on %02x:%02x.%01x PHB#%x-PE#%x\n", + __func__, pdn->busno, PCI_SLOT(pdn->devfn), + PCI_FUNC(pdn->devfn), edev->pe->phb->global_number, + edev->pe->addr); + return NULL; } diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c index 9edae1863e2f..83ee69d22022 100644 --- a/arch/powerpc/platforms/pseries/eeh_pseries.c +++ b/arch/powerpc/platforms/pseries/eeh_pseries.c @@ -52,6 +52,8 @@ void pseries_pcibios_bus_add_device(struct pci_dev *pdev) if (!pdev->is_virtfn) return; + pr_debug("%s: EEH: Setting up device %s.\n", __func__, pci_name(pdev)); + pdn->device_id = pdev->device; pdn->vendor_id = pdev->vendor; pdn->class_code = pdev->class; @@ -238,6 +240,10 @@ static void *pseries_eeh_probe(struct pci_dn *pdn, void *data) int enable = 0; int ret; + pr_debug("%s: probing %04x:%02x:%02x.%01x\n", + __func__, pdn->phb->global_number, pdn->busno, + PCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn)); + /* Retrieve OF node and eeh device */ edev = pdn_to_eeh_dev(pdn); if (!edev || edev->pe) @@ -281,7 +287,12 @@ static void *pseries_eeh_probe(struct pci_dn *pdn, void *data) /* Enable EEH on the device */ ret = eeh_ops->set_option(&pe, EEH_OPT_ENABLE); - if (!ret) { + if (ret) { + pr_debug("%s: EEH failed to enable on %02x:%02x.%01x PHB#%x-PE#%x (code %d)\n", + __func__, pdn->busno, PCI_SLOT(pdn->devfn), + PCI_FUNC(pdn->devfn), pe.phb->global_number, + pe.addr, ret); + } else { /* Retrieve PE address */ edev->pe_config_addr = eeh_ops->get_pe_addr(&pe); pe.addr = edev->pe_config_addr; @@ -297,11 +308,6 @@ static void *pseries_eeh_probe(struct pci_dn *pdn, void *data) if (enable) { eeh_add_flag(EEH_ENABLED); eeh_add_to_parent_pe(edev); - - pr_debug("%s: EEH enabled on %02x:%02x.%01x PHB#%x-PE#%x\n", - __func__, pdn->busno, PCI_SLOT(pdn->devfn), - PCI_FUNC(pdn->devfn), pe.phb->global_number, - pe.addr); } else if (pdn->parent && pdn_to_eeh_dev(pdn->parent) && (pdn_to_eeh_dev(pdn->parent))->pe) { /* This device doesn't support EEH, but it may have an @@ -310,6 +316,11 @@ static void *pseries_eeh_probe(struct pci_dn *pdn, void *data) edev->pe_config_addr = pdn_to_eeh_dev(pdn->parent)->pe_config_addr; eeh_add_to_parent_pe(edev); } + pr_debug("%s: EEH %s on %02x:%02x.%01x PHB#%x-PE#%x (code %d)\n", + __func__, (enable ? "enabled" : "unsupported"), + pdn->busno, PCI_SLOT(pdn->devfn), + PCI_FUNC(pdn->devfn), pe.phb->global_number, + pe.addr, ret); } /* Save memory bars */ |