Skip to contentSkip to conversation

powerpc: EEH blinkenlights, copyright cleanup

PATCH In review Linas Vepstas 3 participants 11 messages May 23, 2007 – May 24, 2007

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

cover powerpc: EEH blinkenlights, copyright cleanup

Hi Paul,

A series of fun but low-priority patches to add per-device EEH statistics to sysfs. Also, a copyright cleanup.

One RFC: summary EEH info is currently in /proc/ppc64/eeh. I could prepare a patch to move this to somewhere in the sysfs tree ... but I couldn't see the point. Is it worth the effort? Do you (or anyone else) care?

--linas

#1 lore raw

PATCH 1/4 powerpc: Add EEH sysfs blinkenlights

Add sysfs blinkenlights for EEH statistics. Shuffle the eeh_add_device_tree() call so that it appears in the correct sequence.

----

 arch/powerpc/platforms/pseries/Makefile    |    2 
 arch/powerpc/platforms/pseries/eeh.c       |    4 +
 arch/powerpc/platforms/pseries/eeh_cache.c |    2 
 arch/powerpc/platforms/pseries/eeh_sysfs.c |   84 +++++++++++++++++++++++++++++
 arch/powerpc/platforms/pseries/pci_dlpar.c |    7 +-
 include/asm-powerpc/ppc-pci.h              |    3 +
 6 files changed, 98 insertions(+), 4 deletions(-)
arch/powerpc/platforms/pseries/eeh_sysfs.c new file +84 -0
Index: linux-2.6.22-rc1/arch/powerpc/platforms/pseries/eeh_sysfs.c
===================================================================
@@ -0,0 +1,84 @@
+/*
+ * Sysfs entries for PCI Error Recovery for PAPR-compliant platform.
+ * Copyright IBM Corporation 2007
+ * Copyright Linas Vepstas <[email protected]> 2007
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Send comments and feedback to Linas Vepstas <[email protected]>
+ */
+#include <linux/pci.h>
+#include <asm/ppc-pci.h>
+#include <asm/pci-bridge.h>
+#include <linux/kobject.h>
+
+/**
+ * EEH_SHOW_ATTR -- create sysfs entry for eeh statistic
+ * @_name: name of file in sysfs directory
+ * @_memb: name of member in struct pci_dn to access
+ * @_format: printf format for display
+ *
+ * All of the attributes look very similar, so just
+ * auto-gen a cut-n-paste routine to display them.
+ */
+#define EEH_SHOW_ATTR(_name,_memb,_format)               \
+static ssize_t eeh_show_##_name(struct device *dev,      \
+		struct device_attribute *attr, char *buf)          \
+{                                                        \
+	struct pci_dev *pdev = to_pci_dev(dev);               \
+	struct device_node *dn = pci_device_to_OF_node(pdev); \
+	struct pci_dn *pdn;                                   \
+	                                                      \
+	if (!dn || PCI_DN(dn) == NULL)                        \
+		return 0;                                          \
+	                                                      \
+	pdn = PCI_DN(dn);                                     \
+	return sprintf(buf, _format "\n", pdn->_memb);        \
+}                                                        \
+static DEVICE_ATTR(_name, S_IRUGO, eeh_show_##_name, NULL);
+
+
+EEH_SHOW_ATTR(eeh_mode, eeh_mode, "0x%x");
+EEH_SHOW_ATTR(eeh_config_addr, eeh_config_addr, "0x%x");
+EEH_SHOW_ATTR(eeh_pe_config_addr, eeh_pe_config_addr, "0x%x");
+EEH_SHOW_ATTR(eeh_check_count, eeh_check_count, "%d");
+EEH_SHOW_ATTR(eeh_freeze_count, eeh_freeze_count, "%d");
+
+void eeh_sysfs_add_device(struct pci_dev *pdev)
+{
+	int rc=0;
+
+	rc += device_create_file(&pdev->dev, &dev_attr_eeh_mode);
+	rc += device_create_file(&pdev->dev, &dev_attr_eeh_config_addr);
+	rc += device_create_file(&pdev->dev, &dev_attr_eeh_pe_config_addr);
+	rc += device_create_file(&pdev->dev, &dev_attr_eeh_check_count);
+	rc += device_create_file(&pdev->dev, &dev_attr_eeh_freeze_count);
+
+	if (rc)
+		printk(KERN_WARNING "EEH: Unable to create sysfs entries\n");
+}
+
+void eeh_sysfs_remove_device(struct pci_dev *pdev)
+{
+	device_remove_file(&pdev->dev, &dev_attr_eeh_mode);
+	device_remove_file(&pdev->dev, &dev_attr_eeh_config_addr);
+	device_remove_file(&pdev->dev, &dev_attr_eeh_pe_config_addr);
+	device_remove_file(&pdev->dev, &dev_attr_eeh_check_count);
+	device_remove_file(&pdev->dev, &dev_attr_eeh_freeze_count);
+}
+
arch/powerpc/platforms/pseries/Makefile +1 -1
Index: linux-2.6.22-rc1/arch/powerpc/platforms/pseries/Makefile
===================================================================
@@ -8,7 +8,7 @@ obj-y			:= lpar.o hvCall.o nvram.o recon
 obj-$(CONFIG_SMP)	+= smp.o
 obj-$(CONFIG_XICS)	+= xics.o
 obj-$(CONFIG_SCANLOG)	+= scanlog.o
-obj-$(CONFIG_EEH)	+= eeh.o eeh_cache.o eeh_driver.o eeh_event.o
+obj-$(CONFIG_EEH)	+= eeh.o eeh_cache.o eeh_driver.o eeh_event.o eeh_sysfs.o
 obj-$(CONFIG_KEXEC)	+= kexec.o
 obj-$(CONFIG_PCI)	+= pci.o pci_dlpar.o
 obj-$(CONFIG_PCI_MSI)	+= msi.o
arch/powerpc/platforms/pseries/eeh.c +3 -1
Index: linux-2.6.22-rc1/arch/powerpc/platforms/pseries/eeh.c
===================================================================
@@ -1139,7 +1139,8 @@ static void eeh_add_device_late(struct p
 	pdn = PCI_DN(dn);
 	pdn->pcidev = dev;
 
-	pci_addr_cache_insert_device (dev);
+	pci_addr_cache_insert_device(dev);
+	eeh_sysfs_add_device(dev);
 }
 
 void eeh_add_device_tree_late(struct pci_bus *bus)
@@ -1178,6 +1179,7 @@ static void eeh_remove_device(struct pci
 	printk(KERN_DEBUG "EEH: remove device %s\n", pci_name(dev));
 #endif
 	pci_addr_cache_remove_device(dev);
+	eeh_sysfs_remove_device(dev);
 
 	dn = pci_device_to_OF_node(dev);
 	if (PCI_DN(dn)->pcidev) {
arch/powerpc/platforms/pseries/eeh_cache.c +2 -0
Index: linux-2.6.22-rc1/arch/powerpc/platforms/pseries/eeh_cache.c
===================================================================
@@ -295,6 +295,8 @@ void __init pci_addr_cache_build(void)
 			continue;
 		pci_dev_get (dev);  /* matching put is in eeh_remove_device() */
 		PCI_DN(dn)->pcidev = dev;
+
+		eeh_sysfs_add_device(dev);
 	}
 
 #ifdef DEBUG
arch/powerpc/platforms/pseries/pci_dlpar.c +5 -2
Index: linux-2.6.22-rc1/arch/powerpc/platforms/pseries/pci_dlpar.c
===================================================================
@@ -110,8 +110,6 @@ pcibios_fixup_new_pci_devices(struct pci
 			}
 		}
 	}
-
-	eeh_add_device_tree_late(bus);
 }
 EXPORT_SYMBOL_GPL(pcibios_fixup_new_pci_devices);
 
@@ -139,6 +137,8 @@ pcibios_pci_config_bridge(struct pci_dev
 
 	/* Make the discovered devices available */
 	pci_bus_add_devices(child_bus);
+
+	eeh_add_device_tree_late(child_bus);
 	return 0;
 }
 
@@ -171,6 +171,7 @@ pcibios_add_pci_devices(struct pci_bus *
 		if (!list_empty(&bus->devices)) {
 			pcibios_fixup_new_pci_devices(bus, 0);
 			pci_bus_add_devices(bus);
+			eeh_add_device_tree_late(bus);
 		}
 	} else if (mode == PCI_PROBE_NORMAL) {
 		/* use legacy probe */
@@ -179,6 +180,7 @@ pcibios_add_pci_devices(struct pci_bus *
 		if (num) {
 			pcibios_fixup_new_pci_devices(bus, 1);
 			pci_bus_add_devices(bus);
+			eeh_add_device_tree_late(bus);
 		}
 
 		list_for_each_entry(dev, &bus->devices, bus_list)
@@ -210,6 +212,7 @@ struct pci_controller * __devinit init_p
 	scan_phb(phb);
 	pcibios_fixup_new_pci_devices(phb->bus, 0);
 	pci_bus_add_devices(phb->bus);
+	eeh_add_device_tree_late(phb->bus);
 
 	return phb;
 }
include/asm-powerpc/ppc-pci.h +3 -0
Index: linux-2.6.22-rc1/include/asm-powerpc/ppc-pci.h
===================================================================
@@ -139,6 +139,9 @@ void eeh_clear_slot (struct device_node 
  */
 struct device_node * find_device_pe(struct device_node *dn);
 
+void eeh_sysfs_add_device(struct pci_dev *pdev);
+void eeh_sysfs_remove_device(struct pci_dev *pdev);
+
 #endif /* CONFIG_EEH */
 
 #else /* CONFIG_PCI */
#5 lore raw

PATCH 2/4 powerpc: show EEH per-device false positives.

In reply to Linas Vepstas

Track and report the number of 0xff false 0xff reads generated by a specific device.

----

 arch/powerpc/platforms/pseries/eeh.c       |    5 +++++
 arch/powerpc/platforms/pseries/eeh_sysfs.c |    3 +++
 include/asm-powerpc/pci-bridge.h           |    1 +
 3 files changed, 9 insertions(+)
arch/powerpc/platforms/pseries/eeh.c +5 -0
Index: linux-2.6.22-rc1/arch/powerpc/platforms/pseries/eeh.c
===================================================================
@@ -505,6 +505,7 @@ int eeh_dn_check_failure(struct device_n
 		printk(KERN_WARNING "EEH: read_slot_reset_state() failed; rc=%d dn=%s\n",
 		       ret, dn->full_name);
 		false_positives++;
+		pdn->eeh_false_positives ++;
 		rc = 0;
 		goto dn_unlock;
 	}
@@ -513,6 +514,7 @@ int eeh_dn_check_failure(struct device_n
 	 * they are empty when they don't have children. */
 	if ((rets[0] == 5) && (dn->child == NULL)) {
 		false_positives++;
+		pdn->eeh_false_positives ++;
 		rc = 0;
 		goto dn_unlock;
 	}
@@ -522,6 +524,7 @@ int eeh_dn_check_failure(struct device_n
 		printk(KERN_WARNING "EEH: event on unsupported device, rc=%d dn=%s\n",
 		       ret, dn->full_name);
 		false_positives++;
+		pdn->eeh_false_positives ++;
 		rc = 0;
 		goto dn_unlock;
 	}
@@ -529,6 +532,7 @@ int eeh_dn_check_failure(struct device_n
 	/* If not the kind of error we know about, punt. */
 	if (rets[0] != 1 && rets[0] != 2 && rets[0] != 4 && rets[0] != 5) {
 		false_positives++;
+		pdn->eeh_false_positives ++;
 		rc = 0;
 		goto dn_unlock;
 	}
@@ -921,6 +925,7 @@ static void *early_enable_eeh(struct dev
 	pdn->eeh_mode = 0;
 	pdn->eeh_check_count = 0;
 	pdn->eeh_freeze_count = 0;
+	pdn->eeh_false_positives = 0;
 
 	if (status && strcmp(status, "ok") != 0)
 		return NULL;	/* ignore devices with bad status */
include/asm-powerpc/pci-bridge.h +1 -0
Index: linux-2.6.22-rc1/include/asm-powerpc/pci-bridge.h
===================================================================
@@ -83,6 +83,7 @@ struct pci_dn {
 	int	eeh_pe_config_addr; /* new-style partition endpoint address */
 	int 	eeh_check_count;	/* # times driver ignored error */
 	int 	eeh_freeze_count;	/* # times this device froze up. */
+	int 	eeh_false_positives;	/* # times this device reported #ff's */
 	u32	config_space[16];	/* saved PCI config space */
 #endif
 };
arch/powerpc/platforms/pseries/eeh_sysfs.c +3 -0
Index: linux-2.6.22-rc1/arch/powerpc/platforms/pseries/eeh_sysfs.c
===================================================================
@@ -58,6 +58,7 @@ EEH_SHOW_ATTR(eeh_config_addr, eeh_confi
 EEH_SHOW_ATTR(eeh_pe_config_addr, eeh_pe_config_addr, "0x%x");
 EEH_SHOW_ATTR(eeh_check_count, eeh_check_count, "%d");
 EEH_SHOW_ATTR(eeh_freeze_count, eeh_freeze_count, "%d");
+EEH_SHOW_ATTR(eeh_false_positives, eeh_false_positives, "%d");
 
 void eeh_sysfs_add_device(struct pci_dev *pdev)
 {
@@ -67,6 +68,7 @@ void eeh_sysfs_add_device(struct pci_dev
 	rc += device_create_file(&pdev->dev, &dev_attr_eeh_config_addr);
 	rc += device_create_file(&pdev->dev, &dev_attr_eeh_pe_config_addr);
 	rc += device_create_file(&pdev->dev, &dev_attr_eeh_check_count);
+	rc += device_create_file(&pdev->dev, &dev_attr_eeh_false_positives);
 	rc += device_create_file(&pdev->dev, &dev_attr_eeh_freeze_count);
 
 	if (rc)
@@ -79,6 +81,7 @@ void eeh_sysfs_remove_device(struct pci_
 	device_remove_file(&pdev->dev, &dev_attr_eeh_config_addr);
 	device_remove_file(&pdev->dev, &dev_attr_eeh_pe_config_addr);
 	device_remove_file(&pdev->dev, &dev_attr_eeh_check_count);
+	device_remove_file(&pdev->dev, &dev_attr_eeh_false_positives);
 	device_remove_file(&pdev->dev, &dev_attr_eeh_freeze_count);
 }
 
#6 lore raw

PATCH 3/4 powerpc: remove dead EEH code.

In reply to Linas Vepstas

Remove some dead code.

----

 arch/powerpc/platforms/pseries/eeh.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/powerpc/platforms/pseries/eeh.c +1 -3
Index: linux-2.6.22-rc1/arch/powerpc/platforms/pseries/eeh.c
===================================================================
@@ -117,7 +117,6 @@ static unsigned long no_cfg_addr;
 static unsigned long ignored_check;
 static unsigned long total_mmio_ffs;
 static unsigned long false_positives;
-static unsigned long ignored_failures;
 static unsigned long slot_resets;
 
 #define IS_BRIDGE(class_code) (((class_code)<<16) == PCI_BASE_CLASS_BRIDGE)
@@ -1221,11 +1220,10 @@ static int proc_eeh_show(struct seq_file
 				"check not wanted=%ld\n"
 				"eeh_total_mmio_ffs=%ld\n"
 				"eeh_false_positives=%ld\n"
-				"eeh_ignored_failures=%ld\n"
 				"eeh_slot_resets=%ld\n",
 				no_device, no_dn, no_cfg_addr, 
 				ignored_check, total_mmio_ffs, 
-				false_positives, ignored_failures, 
+				false_positives,
 				slot_resets);
 	}
 
#9 lore raw

PATCH 4/4 powerpc: tweak EEH copyright info

In reply to Linas Vepstas

Twiddle the copyright notices. Per current guidelines, the use of the (C) or (c) in source code is deprecated.

----

 arch/powerpc/platforms/pseries/eeh.c        |    6 +++++-
 arch/powerpc/platforms/pseries/eeh_cache.c  |    3 ++-
 arch/powerpc/platforms/pseries/eeh_driver.c |    6 +++---
 3 files changed, 10 insertions(+), 5 deletions(-)
arch/powerpc/platforms/pseries/eeh.c +5 -1
Index: linux-2.6.22-rc1/arch/powerpc/platforms/pseries/eeh.c
===================================================================
@@ -1,6 +1,8 @@
 /*
  * eeh.c
- * Copyright (C) 2001 Dave Engebretsen & Todd Inglett IBM Corporation
+ * Copyright IBM Corporation 2001, 2005, 2006
+ * Copyright Dave Engebretsen & Todd Inglett 2001
+ * Copyright Linas Vepstas 2005, 2006
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -15,6 +17,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ * Please address comments and feedback to Linas Vepstas <[email protected]>
  */
 
 #include <linux/delay.h>
arch/powerpc/platforms/pseries/eeh_cache.c +2 -1
Index: linux-2.6.22-rc1/arch/powerpc/platforms/pseries/eeh_cache.c
===================================================================
@@ -2,7 +2,8 @@
  * eeh_cache.c
  * PCI address cache; allows the lookup of PCI devices based on I/O address
  *
- * Copyright (C) 2004 Linas Vepstas <[email protected]> IBM Corporation
+ * Copyright IBM Corporation 2004
+ * Copyright Linas Vepstas <[email protected]> 2004
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
arch/powerpc/platforms/pseries/eeh_driver.c +3 -3
Index: linux-2.6.22-rc1/arch/powerpc/platforms/pseries/eeh_driver.c
===================================================================
@@ -1,6 +1,7 @@
 /*
  * PCI Error Recovery Driver for RPA-compliant PPC64 platform.
- * Copyright (C) 2004, 2005 Linas Vepstas <[email protected]>
+ * Copyright IBM Corp. 2004 2005
+ * Copyright Linas Vepstas <[email protected]> 2004, 2005
  *
  * All rights reserved.
  *
@@ -19,8 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * Send feedback to <[email protected]>
- *
+ * Send comments and feedback to Linas Vepstas <[email protected]>
  */
 #include <linux/delay.h>
 #include <linux/interrupt.h>
#2 lore raw

Re: [PATCH 1/4] powerpc: Add EEH sysfs blinkenlights

In reply to Linas Vepstas

Hi Linas-

Quoted 4 lines · Linas Vepstas

Add sysfs blinkenlights for EEH statistics. Shuffle the eeh_add_device_tree() call so that it appears in the correct sequence.

( blinkenlights? :)

To me this seems a somewhat terse changelog considering that the patch introduces a user-visible interface. The changelog does not really say what the code is doing or why, or who will use it.

arch/powerpc/platforms/pseries/eeh_sysfs.c line 2

Quoted 7 lines

Index: linux-2.6.22-rc1/arch/powerpc/platforms/pseries/eeh_sysfs.c
===================================================================

arch/powerpc/platforms/pseries/eeh_sysfs.c new file +2 -0
@@ -0,0 +1,84 @@
+/*
+ * Sysfs entries for PCI Error Recovery for PAPR-compliant platform.

platforms?

arch/powerpc/platforms/pseries/eeh_sysfs.c line 28

Quoted 4 lines
arch/powerpc/platforms/pseries/eeh_sysfs.c new file +4 -0
+#include <linux/pci.h>
+#include <asm/ppc-pci.h>
+#include <asm/pci-bridge.h>
+#include <linux/kobject.h>

Include linux/ before asm/ please.

arch/powerpc/platforms/pseries/eeh_sysfs.c line 41

Quoted 12 lines
arch/powerpc/platforms/pseries/eeh_sysfs.c new file +12 -0
+/**
+ * EEH_SHOW_ATTR -- create sysfs entry for eeh statistic
+ * @_name: name of file in sysfs directory
+ * @_memb: name of member in struct pci_dn to access
+ * @_format: printf format for display
+ *
+ * All of the attributes look very similar, so just
+ * auto-gen a cut-n-paste routine to display them.
+ */
+#define EEH_SHOW_ATTR(_name,_memb,_format)               \
+static ssize_t eeh_show_##_name(struct device *dev,      \
+		struct device_attribute *attr, char *buf)          \

I have been frustrated by similar constructions more than once in the midst of debugging. I know this has become a common practice with sysfs-related code, but using cpp to generate function names completely defeats grep etc. when you're trying to track down a problem, and I'd not like to see this sort of thing propagated.

include/asm-powerpc/ppc-pci.h void eeh_clear_slot (struct device_node · line 143

Quoted 8 lines
include/asm-powerpc/ppc-pci.h +2 -0
@@ -139,6 +139,9 @@ void eeh_clear_slot (struct device_node 
  */
 struct device_node * find_device_pe(struct device_node *dn);
 
+void eeh_sysfs_add_device(struct pci_dev *pdev);
+void eeh_sysfs_remove_device(struct pci_dev *pdev);

Don't you need dummy static inline placeholders for CONFIG_EEH=n?

#4 lore raw

Re: [PATCH 1/4] powerpc: Add EEH sysfs blinkenlights

In reply to Linas Vepstas

Hi Linas,

arch/powerpc/platforms/pseries/eeh_sysfs.c line 73

Quoted 4 lines · On Wed, 23 May 2007 12:16:46 -0500 [email protected] (Linas Vepstas) wrote:
arch/powerpc/platforms/pseries/eeh_sysfs.c new file +2 -0
+	if (rc)
+		printk(KERN_WARNING "EEH: Unable to create sysfs entries\n");

Maybe use dev_warn?

--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/

#7 lore raw

Re: [PATCH 3/4] powerpc: remove dead EEH code.

In reply to Linas Vepstas

arch/powerpc/platforms/pseries/eeh.c static int proc_eeh_show(struct seq_file · line 1227

Quoted 12 lines · On Wed, 23 May 2007 12:23:38 -0500 [email protected] (Linas Vepstas) wrote:
arch/powerpc/platforms/pseries/eeh.c +1 -2
@@ -1221,11 +1220,10 @@ static int proc_eeh_show(struct seq_file
 				"check not wanted=%ld\n"
 				"eeh_total_mmio_ffs=%ld\n"
 				"eeh_false_positives=%ld\n"
-				"eeh_ignored_failures=%ld\n"
 				"eeh_slot_resets=%ld\n",
 				no_device, no_dn, no_cfg_addr,
 				ignored_check, total_mmio_ffs,
-				false_positives, ignored_failures,
+				false_positives,
 				slot_resets);

This changes a user visible interface - are we sure noone uses it? (I suspect it is fine because of the format, but just asking anyway.)

--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/

#3 lore raw

Re: [PATCH 1/4] powerpc: Add EEH sysfs blinkenlights

In reply to Nathan Lynch
Quoted 9 lines · Nathan Lynch

Hi Linas-

Quoted 4 lines · Linas Vepstas

Add sysfs blinkenlights for EEH statistics. Shuffle the eeh_add_device_tree() call so that it appears in the correct sequence.

( blinkenlights? :)

Alles touristen und non-technischen looken peepers! Das machinkontrol is nicht for gefengerpoken und mittengrabben. Oderwise is easy schnappen der springenverk, blowenfus, und poppencorken mit spitzensparken. Der machine is diggen by experten only. Is nicht fur geverken by das dumpkopfen. Das rubber necken sightseenen keepen das cotton-picken hands in das pockets. So relaxen, und vatchen das blinkenlights.

Quoted 3 lines

To me this seems a somewhat terse changelog considering that the patch introduces a user-visible interface. The changelog does not really say what the code is doing or why, or who will use it.

At this time, there are no planned user-space tools that would look at this. Its intended primarily for sysadmins and service, to determine what, exactly, is going on in the system. I'd been planning on adding this for years, but recent email exchanges made it clear that this needs to get done.

Quoted 9 lines

arch/powerpc/platforms/pseries/eeh_sysfs.c line 41

Quoted 3 lines
arch/powerpc/platforms/pseries/eeh_sysfs.c new file +3 -0
+#define EEH_SHOW_ATTR(_name,_memb,_format)               \
+static ssize_t eeh_show_##_name(struct device *dev,      \
+		struct device_attribute *attr, char *buf)          \

I have been frustrated by similar constructions more than once in the midst of debugging. I know this has become a common practice with sysfs-related code, but using cpp to generate function names completely defeats grep etc. when you're trying to track down a problem, and I'd not like to see this sort of thing propagated.

I understand the frustration. But I also would hate to have 5 or 6 nearly identidical subroutines, one after the other. Perhaps the answer is to avoid te ## pste token, and instead do something like this:

+#define EEH_SHOW_ATTR(_fullname,_memb,_format)         \
+static ssize_t _fullname(struct device *dev,           \
+    struct device_attribute *attr, char *buf)          \

That way, grep will suceed in finding the "full name".

Quoted 4 lines

include/asm-powerpc/ppc-pci.h void eeh_clear_slot (struct device_node · line 143

Quoted 2 lines
include/asm-powerpc/ppc-pci.h +2 -0
+void eeh_sysfs_add_device(struct pci_dev *pdev);
+void eeh_sysfs_remove_device(struct pci_dev *pdev);

Don't you need dummy static inline placeholders for CONFIG_EEH=n?

Hmm. I think these are only called fom the dlpar code, and neither dlpar nor pseries pci will work if eeh is config'ed off...

I don't know how to make CONFIG_PCI depend on CONFIG_EEH, though ... strange situation.

--linas

#8 lore raw

Re: [PATCH 3/4] powerpc: remove dead EEH code.

In reply to Stephen Rothwell
Quoted 16 lines · Stephen Rothwell

arch/powerpc/platforms/pseries/eeh.c static int proc_eeh_show(struct seq_file · line 1227

Quoted 12 lines · On Wed, 23 May 2007 12:23:38 -0500 [email protected] (Linas Vepstas) wrote:
arch/powerpc/platforms/pseries/eeh.c +1 -2
@@ -1221,11 +1220,10 @@ static int proc_eeh_show(struct seq_file
 				"check not wanted=%ld\n"
 				"eeh_total_mmio_ffs=%ld\n"
 				"eeh_false_positives=%ld\n"
-				"eeh_ignored_failures=%ld\n"
 				"eeh_slot_resets=%ld\n",
 				no_device, no_dn, no_cfg_addr,
 				ignored_check, total_mmio_ffs,
-				false_positives, ignored_failures,
+				false_positives,
 				slot_resets);

This changes a user visible interface - are we sure noone uses it? (I suspect it is fine because of the format, but just asking anyway.)

The only user I know of is a "how to test eeh" document that has a snapshot of this. For the most part, EEH has been very out-of-the-limelight.

--linas