Skip to contentSkip to conversation

powerpc/eeh: Display eeh error location for bus and device

PATCH In review Richard A Lary 2 participants 3 messages May 4, 2011 – May 6, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 powerpc/eeh: Display eeh error location for bus and device

From: Richard A Lary <[email protected]>

For adapters which have devices under a PCIe switch/bridge it is informative to display information for both the PCIe switch/bridge and the device on which the bus error was detected.

rebased to powerpc-next

---
---
arch/powerpc/platforms/pseries/eeh_driver.c | 22 13 + 9 - 0 !

 1 file changed, 13 insertions(+), 9 deletions(-)
arch/powerpc/platforms/pseries/eeh_driver.c +13 -9
Index: b/arch/powerpc/platforms/pseries/eeh_driver.c
===================================================================
@@ -328,7 +328,7 @@ struct pci_dn * handle_eeh_events (struc
 	struct pci_bus *frozen_bus;
 	int rc = 0;
 	enum pci_ers_result result = PCI_ERS_RESULT_NONE;
-	const char *location, *pci_str, *drv_str;
+	const char *location, *pci_str, *drv_str, *bus_pci_str, *bus_drv_str;
 
 	frozen_dn = find_device_pe(event->dn);
 	if (!frozen_dn) {
@@ -364,13 +364,8 @@ struct pci_dn * handle_eeh_events (struc
 	frozen_pdn = PCI_DN(frozen_dn);
 	frozen_pdn->eeh_freeze_count++;
 
-	if (frozen_pdn->pcidev) {
-		pci_str = pci_name (frozen_pdn->pcidev);
-		drv_str = pcid_name (frozen_pdn->pcidev);
-	} else {
-		pci_str = eeh_pci_name(event->dev);
-		drv_str = pcid_name (event->dev);
-	}
+	pci_str = eeh_pci_name(event->dev);
+	drv_str = pcid_name(event->dev);
 	
 	if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES)
 		goto excess_failures;
@@ -378,8 +373,17 @@ struct pci_dn * handle_eeh_events (struc
 	printk(KERN_WARNING
 	   "EEH: This PCI device has failed %d times in the last hour:\n",
 		frozen_pdn->eeh_freeze_count);
+
+	if (frozen_pdn->pcidev) {
+		bus_pci_str = pci_name(frozen_pdn->pcidev);
+		bus_drv_str = pcid_name(frozen_pdn->pcidev);
+		printk(KERN_WARNING
+			"EEH: Bus location=%s driver=%s pci addr=%s\n",
+			location, bus_drv_str, bus_pci_str);
+	}
+
 	printk(KERN_WARNING
-		"EEH: location=%s driver=%s pci addr=%s\n",
+		"EEH: Device location=%s driver=%s pci addr=%s\n",
 		location, drv_str, pci_str);
 
 	/* Walk the various device drivers attached to this slot through
#1 lore raw
Quoted 10 lines · Richard A Lary

From: Richard A Lary <[email protected]>

For adapters which have devices under a PCIe switch/bridge it is informative to display information for both the PCIe switch/bridge and the device on which the bus error was detected.

rebased to powerpc-next

---

Not sure what you're doing but it still doesn't apply for me. I think the patch is whitespace damaged. IE. Some spaces have been added at the beginning of each line. IE. "context" lines (nor patch lines that start with - or +) seem to have -two- spaces at the beginning of each line for some reason.

I suspect whatever you're using for email is corrupting patches.

Cheers,
Ben.

Quoted 52 lines

---
arch/powerpc/platforms/pseries/eeh_driver.c | 22 13 + 9 - 0 !

  1 file changed, 13 insertions(+), 9 deletions(-)

Index: b/arch/powerpc/platforms/pseries/eeh_driver.c
===================================================================

arch/powerpc/platforms/pseries/eeh_driver.c +13 -9
@@ -328,7 +328,7 @@ struct pci_dn * handle_eeh_events (struc
  	struct pci_bus *frozen_bus;
  	int rc = 0;
  	enum pci_ers_result result = PCI_ERS_RESULT_NONE;
-	const char *location, *pci_str, *drv_str;
+	const char *location, *pci_str, *drv_str, *bus_pci_str, *bus_drv_str;
 
  	frozen_dn = find_device_pe(event->dn);
  	if (!frozen_dn) {
@@ -364,13 +364,8 @@ struct pci_dn * handle_eeh_events (struc
  	frozen_pdn = PCI_DN(frozen_dn);
  	frozen_pdn->eeh_freeze_count++;
 
-	if (frozen_pdn->pcidev) {
-		pci_str = pci_name (frozen_pdn->pcidev);
-		drv_str = pcid_name (frozen_pdn->pcidev);
-	} else {
-		pci_str = eeh_pci_name(event->dev);
-		drv_str = pcid_name (event->dev);
-	}
+	pci_str = eeh_pci_name(event->dev);
+	drv_str = pcid_name(event->dev);
 
  	if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES)
  		goto excess_failures;
@@ -378,8 +373,17 @@ struct pci_dn * handle_eeh_events (struc
  	printk(KERN_WARNING
  	   "EEH: This PCI device has failed %d times in the last hour:\n",
  		frozen_pdn->eeh_freeze_count);
+
+	if (frozen_pdn->pcidev) {
+		bus_pci_str = pci_name(frozen_pdn->pcidev);
+		bus_drv_str = pcid_name(frozen_pdn->pcidev);
+		printk(KERN_WARNING
+			"EEH: Bus location=%s driver=%s pci addr=%s\n",
+			location, bus_drv_str, bus_pci_str);
+	}
+
  	printk(KERN_WARNING
-		"EEH: location=%s driver=%s pci addr=%s\n",
+		"EEH: Device location=%s driver=%s pci addr=%s\n",
  		location, drv_str, pci_str);
 
  	/* Walk the various device drivers attached to this slot through
#2 lore raw
Quoted 12 lines · Benjamin Herrenschmidt
Quoted 10 lines · Richard A Lary

From: Richard A Lary <[email protected]>

For adapters which have devices under a PCIe switch/bridge it is informative to display information for both the PCIe switch/bridge and the device on which the bus error was detected.

rebased to powerpc-next

---

Quoted 7 lines

Not sure what you're doing but it still doesn't apply for me. I think the patch is whitespace damaged. IE. Some spaces have been added at the beginning of each line. IE. "context" lines (nor patch lines that start with - or +) seem to have -two- spaces at the beginning of each line for some reason.

I suspect whatever you're using for email is corrupting patches.

BTW. I've hand applied it this time.

Cheers,
Ben.

Quoted 56 lines

Cheers,
Ben.

Quoted 52 lines

---
arch/powerpc/platforms/pseries/eeh_driver.c | 22 13 + 9 - 0 !

  1 file changed, 13 insertions(+), 9 deletions(-)

Index: b/arch/powerpc/platforms/pseries/eeh_driver.c
===================================================================

arch/powerpc/platforms/pseries/eeh_driver.c +13 -9
@@ -328,7 +328,7 @@ struct pci_dn * handle_eeh_events (struc
  	struct pci_bus *frozen_bus;
  	int rc = 0;
  	enum pci_ers_result result = PCI_ERS_RESULT_NONE;
-	const char *location, *pci_str, *drv_str;
+	const char *location, *pci_str, *drv_str, *bus_pci_str, *bus_drv_str;
 
  	frozen_dn = find_device_pe(event->dn);
  	if (!frozen_dn) {
@@ -364,13 +364,8 @@ struct pci_dn * handle_eeh_events (struc
  	frozen_pdn = PCI_DN(frozen_dn);
  	frozen_pdn->eeh_freeze_count++;
 
-	if (frozen_pdn->pcidev) {
-		pci_str = pci_name (frozen_pdn->pcidev);
-		drv_str = pcid_name (frozen_pdn->pcidev);
-	} else {
-		pci_str = eeh_pci_name(event->dev);
-		drv_str = pcid_name (event->dev);
-	}
+	pci_str = eeh_pci_name(event->dev);
+	drv_str = pcid_name(event->dev);
 
  	if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES)
  		goto excess_failures;
@@ -378,8 +373,17 @@ struct pci_dn * handle_eeh_events (struc
  	printk(KERN_WARNING
  	   "EEH: This PCI device has failed %d times in the last hour:\n",
  		frozen_pdn->eeh_freeze_count);
+
+	if (frozen_pdn->pcidev) {
+		bus_pci_str = pci_name(frozen_pdn->pcidev);
+		bus_drv_str = pcid_name(frozen_pdn->pcidev);
+		printk(KERN_WARNING
+			"EEH: Bus location=%s driver=%s pci addr=%s\n",
+			location, bus_drv_str, bus_pci_str);
+	}
+
  	printk(KERN_WARNING
-		"EEH: location=%s driver=%s pci addr=%s\n",
+		"EEH: Device location=%s driver=%s pci addr=%s\n",
  		location, drv_str, pci_str);
 
  	/* Walk the various device drivers attached to this slot through