[PATCH] ppc64: Allow EEH to be disabled

Anton Blanchard anton at samba.org
Fri Jan 14 10:51:19 EST 2005


Hi,

I was thinking of sending this upstream. Any thoughts?

Anton

--

Allow EEH to be disabled for pSeries targets, but only if the EMBEDDED
option is enabled.

Signed-off-by: Anton Blanchard <anton at samba.org>

diff -puN arch/ppc64/Kconfig~no-eeh arch/ppc64/Kconfig
--- foobar2/arch/ppc64/Kconfig~no-eeh	2005-01-12 00:34:25.902201644 +1100
+++ foobar2-anton/arch/ppc64/Kconfig	2005-01-12 00:34:25.934199201 +1100
@@ -231,6 +231,11 @@ config PREEMPT
 	  Say Y here if you are building a kernel for a desktop, embedded
 	  or real-time system.  Say N if you are unsure.
 
+config EEH
+	bool "PCI Extended Error Handling (EEH)" if EMBEDDED
+	depends on PPC_PSERIES
+	default y if !EMBEDDED
+
 #
 # Use the generic interrupt handling code in kernel/irq/:
 #
diff -puN arch/ppc64/kernel/Makefile~no-eeh arch/ppc64/kernel/Makefile
--- foobar2/arch/ppc64/kernel/Makefile~no-eeh	2005-01-12 00:34:25.908201186 +1100
+++ foobar2-anton/arch/ppc64/kernel/Makefile	2005-01-12 00:34:25.932199354 +1100
@@ -30,9 +30,10 @@ obj-$(CONFIG_PPC_ISERIES) += iSeries_irq
 obj-$(CONFIG_PPC_MULTIPLATFORM) += nvram.o i8259.o prom_init.o prom.o mpic.o
 
 obj-$(CONFIG_PPC_PSERIES) += pSeries_pci.o pSeries_lpar.o pSeries_hvCall.o \
-			     eeh.o pSeries_nvram.o rtasd.o ras.o \
+			     pSeries_nvram.o rtasd.o ras.o \
 			     xics.o rtas.o pSeries_setup.o pSeries_iommu.o
 
+obj-$(CONFIG_EEH)		+= eeh.o
 obj-$(CONFIG_PROC_FS)		+= proc_ppc64.o
 obj-$(CONFIG_RTAS_FLASH)	+= rtas_flash.o
 obj-$(CONFIG_SMP)		+= smp.o
diff -puN include/asm-ppc64/eeh.h~no-eeh include/asm-ppc64/eeh.h
--- foobar2/include/asm-ppc64/eeh.h~no-eeh	2005-01-12 00:34:25.913200804 +1100
+++ foobar2-anton/include/asm-ppc64/eeh.h	2005-01-12 00:34:25.931199430 +1100
@@ -23,7 +23,6 @@
 #include <linux/init.h>
 #include <linux/list.h>
 #include <linux/string.h>
-#include <linux/notifier.h>
 
 struct pci_dev;
 struct device_node;
@@ -33,14 +32,18 @@ struct device_node;
 #define EEH_MODE_NOCHECK	(1<<1)
 #define EEH_MODE_ISOLATED	(1<<2)
 
-#ifdef CONFIG_PPC_PSERIES
-extern void __init eeh_init(void);
-unsigned long eeh_check_failure(const volatile void __iomem *token, unsigned long val);
+#ifdef CONFIG_EEH
+void __init eeh_init(void);
+unsigned long eeh_check_failure(const volatile void __iomem *token,
+				unsigned long val);
 int eeh_dn_check_failure (struct device_node *dn, struct pci_dev *dev);
 void __iomem *eeh_ioremap(unsigned long addr, void __iomem *vaddr);
 void __init pci_addr_cache_build(void);
 #else
+#define eeh_init()
 #define eeh_check_failure(token, val) (val)
+#define eeh_dn_check_failure(dn, dev) (0)
+#define pci_addr_cache_build()
 #endif
 
 /**
@@ -69,8 +72,6 @@ void eeh_remove_device(struct pci_dev *)
 #define EEH_ENABLE		1
 #define EEH_RELEASE_LOADSTORE	2
 #define EEH_RELEASE_DMA		3
-int eeh_set_option(struct pci_dev *dev, int options);
-
 
 /**
  * Notifier event flags.
@@ -89,6 +90,7 @@ struct eeh_event {
 };
 
 /** Register to find out about EEH events. */
+struct notifier_block;
 int eeh_register_notifier(struct notifier_block *nb);
 int eeh_unregister_notifier(struct notifier_block *nb);
 
@@ -194,7 +196,8 @@ static inline void eeh_raw_writeq(u64 va
 #define EEH_CHECK_ALIGN(v,a) \
 	((((unsigned long)(v)) & ((a) - 1)) == 0)
 
-static inline void eeh_memset_io(volatile void __iomem *addr, int c, unsigned long n)
+static inline void eeh_memset_io(volatile void __iomem *addr, int c,
+				 unsigned long n)
 {
 	u32 lc = c;
 	lc |= lc << 8;
_



More information about the Linuxppc64-dev mailing list