aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGavin Shan <shangw@linux.vnet.ibm.com>2012-09-07 18:44:11 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-09-09 19:35:32 -0400
commitc533b46cc7da58e5ccbd20ac2f607ff60d24eb4e (patch)
tree233bd775d9452863a911f8e452c8380a3da1b6f8
parent82e8882f7f430806bd6bfd203aa4c3f41e3812e9 (diff)
powerpc/eeh: Build EEH event based on PE
The original implementation builds EEH event based on EEH device. We already had dedicated struct to depict PE. It's reasonable to build EEH event based on PE. Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/include/asm/eeh_event.h4
-rw-r--r--arch/powerpc/platforms/pseries/eeh_event.c29
2 files changed, 10 insertions, 23 deletions
diff --git a/arch/powerpc/include/asm/eeh_event.h b/arch/powerpc/include/asm/eeh_event.h
index c68b012b7797..dc722b58216c 100644
--- a/arch/powerpc/include/asm/eeh_event.h
+++ b/arch/powerpc/include/asm/eeh_event.h
@@ -28,10 +28,10 @@
28 */ 28 */
29struct eeh_event { 29struct eeh_event {
30 struct list_head list; /* to form event queue */ 30 struct list_head list; /* to form event queue */
31 struct eeh_dev *edev; /* EEH device */ 31 struct eeh_pe *pe; /* EEH PE */
32}; 32};
33 33
34int eeh_send_failure_event(struct eeh_dev *edev); 34int eeh_send_failure_event(struct eeh_pe *pe);
35struct eeh_dev *handle_eeh_events(struct eeh_event *); 35struct eeh_dev *handle_eeh_events(struct eeh_event *);
36 36
37#endif /* __KERNEL__ */ 37#endif /* __KERNEL__ */
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c
index 61327722b4fc..7f89f1e3fe2b 100644
--- a/arch/powerpc/platforms/pseries/eeh_event.c
+++ b/arch/powerpc/platforms/pseries/eeh_event.c
@@ -119,36 +119,23 @@ static void eeh_thread_launcher(struct work_struct *dummy)
119 119
120/** 120/**
121 * eeh_send_failure_event - Generate a PCI error event 121 * eeh_send_failure_event - Generate a PCI error event
122 * @edev: EEH device 122 * @pe: EEH PE
123 * 123 *
124 * This routine can be called within an interrupt context; 124 * This routine can be called within an interrupt context;
125 * the actual event will be delivered in a normal context 125 * the actual event will be delivered in a normal context
126 * (from a workqueue). 126 * (from a workqueue).
127 */ 127 */
128int eeh_send_failure_event(struct eeh_dev *edev) 128int eeh_send_failure_event(struct eeh_pe *pe)
129{ 129{
130 unsigned long flags; 130 unsigned long flags;
131 struct eeh_event *event; 131 struct eeh_event *event;
132 struct device_node *dn = eeh_dev_to_of_node(edev);
133 const char *location;
134
135 if (!mem_init_done) {
136 printk(KERN_ERR "EEH: event during early boot not handled\n");
137 location = of_get_property(dn, "ibm,loc-code", NULL);
138 printk(KERN_ERR "EEH: device node = %s\n", dn->full_name);
139 printk(KERN_ERR "EEH: PCI location = %s\n", location);
140 return 1;
141 }
142 event = kzalloc(sizeof(*event), GFP_ATOMIC);
143 if (event == NULL) {
144 printk(KERN_ERR "EEH: out of memory, event not handled\n");
145 return 1;
146 }
147
148 if (edev->pdev)
149 pci_dev_get(edev->pdev);
150 132
151 event->edev = edev; 133 event = kzalloc(sizeof(*event), GFP_ATOMIC);
134 if (!event) {
135 pr_err("EEH: out of memory, event not handled\n");
136 return -ENOMEM;
137 }
138 event->pe = pe;
152 139
153 /* We may or may not be called in an interrupt context */ 140 /* We may or may not be called in an interrupt context */
154 spin_lock_irqsave(&eeh_eventlist_lock, flags); 141 spin_lock_irqsave(&eeh_eventlist_lock, flags);