aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinas Vepstas <linas@austin.ibm.com>2006-04-27 05:31:20 -0400
committerPaul Mackerras <paulus@samba.org>2006-05-03 09:06:40 -0400
commit054d8ff37710efaebd1998ce94d366df315a354f (patch)
tree5496fbdd8b3b27e8ca4850055c1c00f30d52e0b3 /arch
parente17df688f7064dae1417ce425dd1e4b71d24d63b (diff)
[PATCH] powerpc/pseries: avoid crash in PCI code if mem system not up
The powerpc code is currently performing PCI setup before memory initialization. PCI setup touches PCI config space registers. If the PCI card is bad, this will evoke an error, which currrently can't be handled, as the PCI error recovery code expects kmalloc() to be functional. This patch will cause the system to punt instead of crashing with cpu 0x0: Vector: 300 (Data Access) at [c0000000004434d0] pc: c0000000000c06b4: .kmem_cache_alloc+0x8c/0xf4 lr: c00000000004ad6c: .eeh_send_failure_event+0x48/0xfc This patch will also print name of the offending pci device. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/pseries/eeh_event.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c
index a1bda6f96fd1..40020c65c89e 100644
--- a/arch/powerpc/platforms/pseries/eeh_event.c
+++ b/arch/powerpc/platforms/pseries/eeh_event.c
@@ -118,7 +118,15 @@ int eeh_send_failure_event (struct device_node *dn,
118{ 118{
119 unsigned long flags; 119 unsigned long flags;
120 struct eeh_event *event; 120 struct eeh_event *event;
121 char *location;
121 122
123 if (!mem_init_done) {
124 printk(KERN_ERR "EEH: event during early boot not handled\n");
125 location = (char *) get_property(dn, "ibm,loc-code", NULL);
126 printk(KERN_ERR "EEH: device node = %s\n", dn->full_name);
127 printk(KERN_ERR "EEH: PCI location = %s\n", location);
128 return 1;
129 }
122 event = kmalloc(sizeof(*event), GFP_ATOMIC); 130 event = kmalloc(sizeof(*event), GFP_ATOMIC);
123 if (event == NULL) { 131 if (event == NULL) {
124 printk (KERN_ERR "EEH: out of memory, event not handled\n"); 132 printk (KERN_ERR "EEH: out of memory, event not handled\n");